/** * Type declaration for @dotdo/pglite * This allows TypeScript to recognize the module without requiring type definitions */ declare module '@dotdo/pglite' { export type DebugLevel = 0 | 1 | 2 | 3 | 4 | 5 export interface PGliteOptions { wasmModule?: WebAssembly.Module fsBundle?: Blob dataDir?: string debug?: DebugLevel relaxedDurability?: boolean extensions?: Record username?: string database?: string } export interface QueryOptions { rowMode?: 'array' | 'object' } export interface Results> { rows: T[] fields: { name: string; dataTypeID: number }[] affectedRows?: number } export interface Transaction { query>(sql: string, params?: unknown[], options?: QueryOptions): Promise> exec(sql: string): Promise rollback(): Promise } export class PGlite { constructor(options?: PGliteOptions | string) static create(options?: PGliteOptions | string): Promise query>(sql: string, params?: unknown[], options?: QueryOptions): Promise> exec(sql: string): Promise transaction(callback: (tx: Transaction) => Promise): Promise close(): Promise listen(channel: string, callback: (payload: string) => void): Promise<() => Promise> notify(channel: string, payload?: string): Promise waitReady: Promise ready: boolean closed: boolean } }