// 測試用 node 內建模組最小型別宣告。tsconfig types 只掛 @cloudflare/workers-types(worker 本體 // 不該看見 node API),但測試在 node 跑:library-map 測試用 node:sqlite 當真 SQLite 驗聚合 SQL //(零新依賴;Node ≥22.5 內建)。這份 d.ts 只為 tsc --noEmit 過關,不影響 runtime。 declare module 'node:sqlite' { export class DatabaseSync { constructor(location: string); exec(sql: string): void; prepare(sql: string): { all(...params: unknown[]): Record[]; get(...params: unknown[]): Record | undefined; run(...params: unknown[]): { changes: number | bigint }; }; close(): void; } } declare module 'node:fs' { export function readFileSync(path: URL | string, encoding: string): string; } // workers-types 的 ImportMeta 沒宣告 url(worker bundle 不用);測試以 import.meta.url 定位 // migrations 原檔 → 全域補上(僅型別,node/vitest runtime 本來就有)。 interface ImportMeta { url: string }