import { ISqlite, Statement } from "sqlite"; export type RunResult = ISqlite.RunResult; export type SqlType = ISqlite.SqlType; export { Statement }; export interface TypedDatabase { /** * @see Database.on */ on(event: string, listener: unknown): Promise; /** * @see Database.run */ run(sql: SqlType, ...params: unknown[]): Promise; /** * @see Database.get */ get(sql: SqlType, ...params: unknown[]): Promise; /** * @see Database.each */ each( sql: SqlType, callback: (err: unknown, row: T) => void ): Promise; each( sql: SqlType, param1: unknown, callback: (err: unknown, row: T) => void ): Promise; each( sql: SqlType, param1: unknown, param2: unknown, callback: (err: unknown, row: T) => void ): Promise; each( sql: SqlType, param1: unknown, param2: unknown, param3: unknown, callback: (err: unknown, row: T) => void ): Promise; // eslint-disable-next-line @typescript-eslint/no-unused-vars each(sql: SqlType, ...params: unknown[]): Promise; /** * @see Database.all */ all(sql: SqlType, ...params: unknown[]): Promise; /** * @see Database.exec */ exec(sql: SqlType, ...params: unknown[]): Promise; /** * @see Database.prepare */ prepare(sql: SqlType, ...params: unknown[]): Promise; }