Skip to content

Commit 58f75fc

Browse files
authored
Merge pull request #75 from qwtel/improve-types
Improve types
2 parents 63f713e + fce37dd commit 58f75fc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

index.d.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ declare class OpfsDatabase extends Database {
12441244
* `c`. These modes are ignored for the special `":memory:"` and `""`
12451245
* names and may be ignored by specific VFSes.
12461246
*/
1247-
constructor(filename: string, flags: string);
1247+
constructor(filename: string, flags?: string);
12481248

12491249
/**
12501250
* Import a database into OPFS storage. It only works with database files and
@@ -2032,7 +2032,15 @@ declare type Sqlite3Static = {
20322032
installVfs: (obj: {
20332033
io?: {
20342034
struct: sqlite3_io_methods;
2035-
methods: Omit<sqlite3_io_methods, 'iVersion'>;
2035+
methods: { [K in keyof sqlite3_io_methods as K extends `x${string}` ? K : never]?: sqlite3_io_methods[K] };
2036+
applyArgcCheck?: boolean;
2037+
};
2038+
vfs?: {
2039+
struct: sqlite3_vfs;
2040+
methods: { [K in keyof sqlite3_vfs as K extends `x${string}` ? K : never]?: sqlite3_vfs[K] };
2041+
applyArgcCheck?: boolean;
2042+
name?: string;
2043+
asDefault?: boolean;
20362044
};
20372045
}) => Sqlite3Static['vfs'];
20382046
};
@@ -2792,7 +2800,7 @@ declare type WASM_API = {
27922800
poke32: (addr: WasmPointer, value: number) => WASM_API;
27932801

27942802
/** Equivalent to poke(X,Y,'i64') */
2795-
poke64: (addr: WasmPointer, value: number) => WASM_API;
2803+
poke64: (addr: WasmPointer, value: number|bigint) => WASM_API;
27962804

27972805
/** Equivalent to poke(X,Y,'f32') */
27982806
poke32f: (addr: WasmPointer, value: number) => WASM_API;
@@ -5729,7 +5737,7 @@ declare type CAPI = {
57295737
*
57305738
* See https://www.sqlite.org/c3ref/vfs_find.html
57315739
*/
5732-
sqlite3_vfs_find: (vfsName: string) => sqlite3_vfs;
5740+
sqlite3_vfs_find: (vfsName: string|null) => WasmPointer;
57335741

57345742
/**
57355743
* Register a new VFS. Becomes the default if the makeDflt parameter is set.

0 commit comments

Comments
 (0)