/**
 * JSI BINDINGS DO NOT WORK WHEN CONNECTED TO THE CHROME DEBUGGER
 * Use flipper to debug your RN apps from now on
 */
/**
 * Object returned by SQL Query executions {
 *  status: 0 or undefined for correct execution, 1 for error
 *  insertId: Represent the auto-generated row id if applicable
 *  rowsAffected: Number of affected rows if result of a update query
 *  message: if status === 1, here you will find error description
 *  rows: if status is undefined or 0 this object will contain the query results
 * }
 *
 * @interface QueryResult
 */
export interface QueryResult {
    status?: 0 | 1;
    insertId?: number;
    rowsAffected: number;
    message?: string;
    rows?: {
        /** Raw array with all dataset */
        _array: any[];
        /** The lengh of the dataset */
        length: number;
        /** A convenience function to acess the index based the row object
         * @param idx the row index
         * @returns the row structure identified by column names
         */
        item: (idx: number) => any;
    };
    /**
     * Query metadata, avaliable only for select query results
     */
    metadata?: ColumnMetadata[];
}
/**
 * Column metadata
 * Describes some information about columns fetched by the query
 */
export declare type ColumnMetadata = {
    /** The name used for this column for this resultset */
    columnName: string;
    /** The declared column type for this column, when fetched directly from a table or a View resulting from a table column. "UNKNOWN" for dynamic values, like function returned ones. */
    columnDeclaredType: string;
    /**
     * The index for this column for this resultset*/
    columnIndex: number;
};
/**
 * Allows the execution of bulk of sql commands
 * inside a transaction
 * If a single query must be executed many times with different arguments, its preferred
 * to declare it a single time, and use an array of array parameters.
 */
declare type SQLBatchParams = [string] | [string, Array<any> | Array<Array<any>>];
/**
 * status: 0 or undefined for correct execution, 1 for error
 * message: if status === 1, here you will find error description
 * rowsAffected: Number of affected rows if status == 0
 */
export interface BatchQueryResult {
    status?: 0 | 1;
    rowsAffected?: number;
    message?: string;
}
/**
 * Result of loading a file and executing every line as a SQL command
 * Similar to BatchQueryResult
 */
export interface FileLoadResult {
    rowsAffected?: number;
    commands?: number;
    message?: string;
    status?: 0 | 1;
}
export interface Transaction {
    executeSql: (query: string, params?: any[]) => QueryResult;
}
export interface PendingTransaction {
    start: () => void;
}
interface ISQLite {
    open: (dbName: string, location?: string) => {
        status: 0 | 1;
        message?: string;
    };
    close: (dbName: string) => {
        status: 0 | 1;
        message?: string;
    };
    delete: (dbName: string, location?: string) => {
        status: 0 | 1;
        message?: string;
    };
    transaction: (dbName: string, fn: (tx: Transaction) => boolean) => void;
    executeSql: (dbName: string, query: string, params: any[] | undefined) => QueryResult;
    asyncExecuteSql: (dbName: string, query: string, params: any[] | undefined, cb: (res: QueryResult) => void) => void;
    executeSqlBatch: (dbName: string, commands: SQLBatchParams[]) => BatchQueryResult;
    asyncExecuteSqlBatch: (dbName: string, commands: SQLBatchParams[], cb: (res: BatchQueryResult) => void) => void;
    loadSqlFile: (dbName: string, location: string) => FileLoadResult;
    asyncLoadSqlFile: (dbName: string, location: string, cb: (res: FileLoadResult) => void) => void;
}
declare global {
    const sqlite: ISQLite;
}
interface IConnectionOptions {
    name: string;
    location?: string;
}
interface IDBConnection {
    executeSql: (sql: string, args: any[], ok: (res: QueryResult) => void, fail: (msg: string) => void) => void;
    asyncExecuteSql: (query: string, params: any[] | undefined, cb: (res: QueryResult) => void) => void;
    executeSqlBatch: (commands: SQLBatchParams[], callback?: (res: BatchQueryResult) => void) => void;
    asyncExecuteSqlBatch: (commands: SQLBatchParams[], cb: (res: BatchQueryResult) => void) => void;
    close: (ok: (res: any) => void, fail: (msg: string) => void) => void;
    transaction: (fn: (tx: Transaction) => boolean) => void;
    loadSqlFile: (location: string, callback: (result: FileLoadResult) => void) => void;
    asyncLoadSqlFile: (location: string, callback: (res: FileLoadResult) => void) => void;
}
export declare const openDatabase: (options: IConnectionOptions, ok: (db: IDBConnection) => void, fail: (msg: string) => void) => IDBConnection;
export {};
