import { ObjectOrType } from '@itrocks/class-type';
import { Connection } from 'mariadb';
import { QueryOptions } from 'mariadb-share';
import { SqlError } from 'mariadb-share';
export type Context = ObjectOrType | ObjectOrType[];
export declare class Contextual implements Partial<Connection> {
    [x: number]: (() => Promise<void>) | undefined;
    contexts: Context[];
    errorCount: Record<string, Record<string, Array<number>>>;
    superQuery: <T = any>(sql: string | QueryOptions, values?: any) => Promise<T>;
    applyTo(connection: ContextualConnection): Promise<ContextualConnection>;
    incrementErrorCount(sql: string, error: any): this is Connection;
    isSqlError(error: any): error is SqlError;
    query<T = any>(sql: string | QueryOptions, values?: any): Promise<T>;
}
export type ContextualConnection = Connection & Contextual;
