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: any): Promise; /** * @see Database.run */ run(sql: SqlType, ...params: any[]): Promise; /** * @see Database.get */ get(sql: SqlType, ...params: any[]): Promise; /** * @see Database.each */ each(sql: SqlType, callback: (err: any, row: T) => void): Promise; each(sql: SqlType, param1: any, callback: (err: any, row: T) => void): Promise; each(sql: SqlType, param1: any, param2: any, callback: (err: any, row: T) => void): Promise; each(sql: SqlType, param1: any, param2: any, param3: any, callback: (err: any, row: T) => void): Promise; each(sql: SqlType, ...params: any[]): Promise; /** * @see Database.all */ all(sql: SqlType, ...params: any[]): Promise; /** * @see Database.exec */ exec(sql: SqlType, ...params: any[]): Promise; /** * @see Database.prepare */ prepare(sql: SqlType, ...params: any[]): Promise; }