import { Db } from './db' export declare type KeyVal = { [key: string]: V } export declare type ValueOf = T[keyof T] export declare type PrimaryKeyTypes = 'INTEGER' | 'NVARCHAR' | 'CHAR' export declare type ColumnTypes = | PrimaryKeyTypes | 'BOOLEAN' | 'DECIMAL' | 'DATETIME' | 'MONEY' export interface ConstructorClass extends Function { new (): T } export interface TableInfo { db: Db name: string columns: { [key: string]: { primary: boolean } & ColumnInfo } descriptor: {} } export interface ColumnInfo { type: ColumnTypes size: number } export declare type QueryCallback = (result: any) => void export declare type TransactionCallback = ( transaction: Transaction, resultSet: any ) => void export declare type SuccessCallback = (resultSet?: any) => any export declare type ErrorCallback = (error: any) => any export interface Transaction { execSql( sql: string, args?: any[], success?: SuccessCallback, error?: ErrorCallback ): void } export interface ResultSet { insertId: number rowsAffected: number rows: { length: number item(index: number): any items(): any[] } } export interface DbDriver { init?: () => Promise close: () => Promise transaction( scope: (tx: Transaction) => void, error?: (error: any) => void, success?: () => void ): void query( sql: string, args: any[], error: ErrorCallback, success: QueryCallback ): void getQueryResult(resultSet: any): ResultSet }