Skip to content

Commit

Permalink
Merge pull request #75 from qwtel/improve-types
Browse files Browse the repository at this point in the history
Improve types
  • Loading branch information
tomayac authored May 21, 2024
2 parents 63f713e + fce37dd commit 58f75fc
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ declare class OpfsDatabase extends Database {
* `c`. These modes are ignored for the special `":memory:"` and `""`
* names and may be ignored by specific VFSes.
*/
constructor(filename: string, flags: string);
constructor(filename: string, flags?: string);

/**
* Import a database into OPFS storage. It only works with database files and
Expand Down Expand Up @@ -2032,7 +2032,15 @@ declare type Sqlite3Static = {
installVfs: (obj: {
io?: {
struct: sqlite3_io_methods;
methods: Omit<sqlite3_io_methods, 'iVersion'>;
methods: { [K in keyof sqlite3_io_methods as K extends `x${string}` ? K : never]?: sqlite3_io_methods[K] };
applyArgcCheck?: boolean;
};
vfs?: {
struct: sqlite3_vfs;
methods: { [K in keyof sqlite3_vfs as K extends `x${string}` ? K : never]?: sqlite3_vfs[K] };
applyArgcCheck?: boolean;
name?: string;
asDefault?: boolean;
};
}) => Sqlite3Static['vfs'];
};
Expand Down Expand Up @@ -2792,7 +2800,7 @@ declare type WASM_API = {
poke32: (addr: WasmPointer, value: number) => WASM_API;

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

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

/**
* Register a new VFS. Becomes the default if the makeDflt parameter is set.
Expand Down

0 comments on commit 58f75fc

Please sign in to comment.