baa-conductor


baa-conductor / packages / artifact-db / src
im_wower  ·  2026-03-28

node-shims.d.ts

 1declare module "node:fs" {
 2  export function existsSync(path: string): boolean;
 3  export function mkdirSync(
 4    path: string,
 5    options?: {
 6      recursive?: boolean;
 7    }
 8  ): void;
 9  export function readFileSync(path: string, encoding: "utf8"): string;
10  export function readFileSync(path: string): Uint8Array;
11  export function rmSync(
12    path: string,
13    options?: {
14      force?: boolean;
15      recursive?: boolean;
16    }
17  ): void;
18  export function writeFileSync(path: string, data: string | Uint8Array): void;
19}
20
21declare module "node:path" {
22  export function dirname(path: string): string;
23  export function join(...paths: string[]): string;
24}
25
26declare module "node:sqlite" {
27  export interface DatabaseColumnDefinition {
28    name: string;
29  }
30
31  export interface StatementRunResult {
32    changes?: number;
33    lastInsertRowid?: number | bigint;
34  }
35
36  export class StatementSync {
37    all(...params: unknown[]): unknown[];
38    columns(): DatabaseColumnDefinition[];
39    get(...params: unknown[]): unknown;
40    run(...params: unknown[]): StatementRunResult;
41    setReturnArrays(enabled: boolean): void;
42  }
43
44  export class DatabaseSync {
45    constructor(path: string);
46    close(): void;
47    exec(query: string): void;
48    prepare(query: string): StatementSync;
49  }
50}