// Type declarations for sql.js (no native types package available)
declare module "sql.js" {
  export interface Database {
    run(sql: string, params?: BindParams): void;
    exec(sql: string): void;
    prepare(sql: string): Statement;
    export(): Uint8Array;
    close(): void;
    getRowsModified(): number;
  }

  export interface Statement {
    bind(params?: BindParams): boolean;
    step(): boolean;
    getAsObject<T = Record<string, unknown>>(): T;
    getColumnNames(): string[];
    free(): boolean;
  }

  export type BindParams = unknown[] | Record<string, unknown>;

  export interface SqlJsStatic {
    Database: new (data?: ArrayLike<number>) => Database;
  }

  export default function initSqlJs(config?: Record<string, unknown>): Promise<SqlJsStatic>;
}
