-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql.js.d.ts
More file actions
33 lines (28 loc) · 889 Bytes
/
Copy pathsql.js.d.ts
File metadata and controls
33 lines (28 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
declare module 'sql.js' {
interface QueryExecResult {
columns: string[];
values: unknown[][];
}
interface Statement {
bind(params?: unknown[] | Record<string, unknown>): boolean;
step(): boolean;
getAsObject(): Record<string, unknown>;
free(): void;
}
interface Database {
run(sql: string, params?: unknown[] | Record<string, unknown>): Database;
exec(sql: string): QueryExecResult[];
prepare(sql: string): Statement;
getRowsModified(): number;
export(): Uint8Array;
close(): void;
}
interface SqlJsStatic {
Database: new (data?: ArrayLike<number> | Buffer | null) => Database;
}
interface InitSqlJsOptions {
locateFile?: (file: string) => string;
}
export type { Database, Statement, QueryExecResult, SqlJsStatic };
export default function initSqlJs(options?: InitSqlJsOptions): Promise<SqlJsStatic>;
}