Skip to content

Commit bf4b0e0

Browse files
committed
Fix function parameter types for create_function and wrappers
1 parent a22372d commit bf4b0e0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

index.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ declare type FunctionOptions = {
548548

549549
declare type ScalarFunctionOptions = FunctionOptions & {
550550
/** Scalar function to be defined. */
551-
xFunc: (ctxPtr: number, ...args: any[]) => any;
551+
xFunc: (ctxPtr: number, ...args: SqlValue[]) => SqlValue;
552552
};
553553

554554
declare type AggregateFunctionOptions = FunctionOptions & {
@@ -970,11 +970,11 @@ declare class Database {
970970
*/
971971
createFunction(
972972
name: string,
973-
func: (ctxPtr: number, ...args: any[]) => SqlValue,
973+
func: (ctxPtr: number, ...values: SqlValue[]) => SqlValue,
974974
): this;
975975
createFunction(
976976
name: string,
977-
func: (ctxPtr: number, ...args: any[]) => void,
977+
func: (ctxPtr: number, ...values: SqlValue[]) => void,
978978
options: FunctionOptions,
979979
): this;
980980
createFunction(
@@ -4636,10 +4636,10 @@ declare type CAPI = {
46364636
eTextRep: CAPI['SQLITE_UTF8'],
46374637
pApp: WasmPointer,
46384638
xFunc:
4639-
| ((ctx: WasmPointer, nArg: number, args: WasmPointer) => SqlValue)
4639+
| ((ctx: WasmPointer, ...values: SqlValue[]) => SqlValue)
46404640
| WasmPointer,
46414641
xStep:
4642-
| ((ctx: WasmPointer, nArg: number, args: WasmPointer) => void)
4642+
| ((ctx: WasmPointer, ...values: SqlValue[]) => void)
46434643
| WasmPointer,
46444644
xFinal: ((ctx: WasmPointer) => SqlValue) | WasmPointer,
46454645
) => number;
@@ -4671,10 +4671,10 @@ declare type CAPI = {
46714671
eTextRep: CAPI['SQLITE_UTF8'],
46724672
pApp: WasmPointer,
46734673
xFunc:
4674-
| ((ctx: WasmPointer, nArg: number, args: WasmPointer) => SqlValue)
4674+
| ((ctx: WasmPointer, ...values: SqlValue[]) => SqlValue)
46754675
| WasmPointer,
46764676
xStep:
4677-
| ((ctx: WasmPointer, nArg: number, args: WasmPointer) => void)
4677+
| ((ctx: WasmPointer, ...values: SqlValue[]) => void)
46784678
| WasmPointer,
46794679
xFinal: ((ctx: WasmPointer) => SqlValue) | WasmPointer,
46804680
xDestroy: (() => void) | WasmPointer,
@@ -4708,12 +4708,12 @@ declare type CAPI = {
47084708
eTextRep: CAPI['SQLITE_UTF8'],
47094709
pApp: WasmPointer,
47104710
xStep:
4711-
| ((ctx: WasmPointer, nArg: number, args: WasmPointer) => SqlValue)
4711+
| ((ctx: WasmPointer, ...values: SqlValue[]) => SqlValue)
47124712
| WasmPointer,
47134713
xFinal: ((ctx: WasmPointer) => SqlValue) | WasmPointer,
47144714
xValue: ((ctx: WasmPointer) => void) | WasmPointer,
47154715
xInverse:
4716-
| ((ctx: WasmPointer, nArg: number, args: WasmPointer) => void)
4716+
| ((ctx: WasmPointer, ...values: SqlValue[]) => void)
47174717
| WasmPointer,
47184718
xDestroy: (() => void) | WasmPointer,
47194719
) => number;

0 commit comments

Comments
 (0)