import { ManagedTransaction } from "../transaction/managed-transaction"; export declare type DatabaseBase = DatabaseTransaction | DatabaseObject | DatabaseBaseTransaction; export interface DatabaseBaseTransaction { executeSql(sql: string, values: any): Promise; } export interface DatabaseTransaction extends DatabaseBaseTransaction { } export interface DatabaseObject { /** * @param fn {any} * @returns {Promise} */ transaction(fn: (transaction: DatabaseBaseTransaction) => void): Promise; /** * Execute SQL on the opened database. Note, you must call `create` first, and * ensure it resolved and successfully opened the database. */ executeSql(statement: string, params: any): Promise; /** * @param sqlStatements {string[] | string[][] | any[]} * @returns {Promise} */ sqlBatch(sqlStatements: Array<(string | string[] | any)>): Promise; managedTransaction(): ManagedTransaction; } export interface DatabaseResult { rows: DatabaseRowList; rowsAffected: number; insertId: any; } export interface DatabaseRowList { length: number; item(index: number): any; }