Skip to content

Commit 16c074c

Browse files
committed
Add TypeScript declaration for commit_hook
1 parent 65b1681 commit 16c074c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/types/index.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,19 @@ declare interface SQLiteAPI {
458458
*/
459459
column_type(stmt: number, i: number): number;
460460

461+
/**
462+
* Register a commit hook
463+
*
464+
* @see https://www.sqlite.org/c3ref/commit_hook.html
465+
*
466+
* @param db database pointer
467+
* @param callback If a non-zero value is returned, commit is converted into
468+
* a rollback; disables callback when null
469+
*/
470+
commit_hook(
471+
db: number,
472+
callback: (() => number) | null): void;
473+
461474
/**
462475
* Create or redefine SQL functions
463476
*

0 commit comments

Comments
 (0)