import sqlite3 from 'sqlite3'; import Emittery from 'emittery'; import { Table, Column, UndefinedEqNull } from './table'; import { SQLParams, RawSQL } from './utils'; export declare class Db extends Emittery.Typed<{ 'pre-find': { cond: any; tables: { type?: 'inner' | 'left' | 'cross' | 'natural'; from?: Column; cond?: string; to: Column | Table; }[]; select: { [alias: string]: string | RawSQL | Column; }; options: { postfix?: string; sort?: { key: Column | string; desc?: boolean; }; offset?: number; limit?: number; }; }; 'find-sql': { stmt: string; params: SQLParams; }; }> { sql: sqlite3.Database; constructor(filename: string | sqlite3.Database, options?: any); /** * Initialize tables sequentially, just in case foreign keys matter * * @param tables */ init(tables: Table[]): Promise; create(table: Table): (entry: UndefinedEqNull, options?: { postfix?: string | undefined; ignoreErrors?: boolean | undefined; } | undefined) => Promise; each(table0: Table, ...tables: (Table | { type?: 'inner' | 'left' | 'cross' | 'natural'; from?: Column; cond?: string; to: Column | Table; })[]): ; } = Required<{ [x: string]: Column; }>>(qCond: Record, select: "*" | Select, options?: { postfix?: string; sort?: { key: Column | string; desc?: boolean; }; offset?: number; limit?: number; }) => Promise ? T : any; }>[]>; count(table0: Table, ...tables: (Table | { type?: 'inner' | 'left' | 'cross' | 'natural'; from?: Column; cond?: string; to: Column | Table; })[]): (qCond: Record) => Promise; first(table0: Table, ...tables: (Table | { type?: 'inner' | 'left' | 'cross' | 'natural'; from?: Column; cond?: string; to: Column | Table; })[]):