From 7b3da8f486acaf2a2de56e55775bc272274c24b2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 10:51:33 +0000 Subject: [PATCH] Refactor: Replace 'any' in sql.js declarations with SqlValue This replaces the unsafe `any` and `any[]` types in `src/declarations.d.ts` with a concrete `SqlValue` type (`number | string | Uint8Array | null`) that accurately reflects what sql.js natively supports. --- src/declarations.d.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/declarations.d.ts b/src/declarations.d.ts index 679fdbd..6a7c7bc 100644 --- a/src/declarations.d.ts +++ b/src/declarations.d.ts @@ -1,24 +1,26 @@ declare module 'sql.js' { + export type SqlValue = number | string | Uint8Array | null; + export interface Database { - run(sql: string, params?: any[]): void; - exec(sql: string, params?: any[]): QueryResults[]; - prepare(sql: string, params?: any[]): Statement; + run(sql: string, params?: SqlValue[]): void; + exec(sql: string, params?: SqlValue[]): QueryResults[]; + prepare(sql: string, params?: SqlValue[]): Statement; export(): Uint8Array; close(): void; } export interface QueryResults { columns: string[]; - values: any[][]; + values: SqlValue[][]; } export interface Statement { - bind(values: any[]): boolean; + bind(values: SqlValue[]): boolean; step(): boolean; - get(params?: any[]): any[]; + get(params?: SqlValue[]): SqlValue[]; getColumnNames(): string[]; - getAsObject(params?: any[]): any; - run(params?: any[]): void; + getAsObject(params?: SqlValue[]): Record; + run(params?: SqlValue[]): void; free(): void; }