import * as ThingTalk from 'thingtalk';
import { Ast, ExecEnvironment, SchemaRetriever } from 'thingtalk';
import TextFormatter from '../card-output/text-formatter';
import { SimulationDatabase } from './statement_simulator';
declare type CompiledFilterHint = [string, string, unknown];
export interface CompiledQueryHints {
    filter?: CompiledFilterHint[];
    sort?: [string, 'asc' | 'desc'];
    projection?: string[];
    limit?: number;
}
declare class ResultGenerator {
    private _rng;
    private _overrides;
    private _candidates;
    private _constants;
    constructor(rng: () => number, overrides: Map<string, unknown>);
    private _doAddCandidate;
    addCandidate(value: Ast.Value): void;
    generate(schema: Ast.FunctionDef, params: Record<string, unknown>, index: number): Record<string, unknown>;
    private _generateValue;
    private _generateTime;
    private _generateDate;
    private _generateLocation;
    private _generateNumber;
    private _generateString;
    generateString(): string;
    private _reuseConstant;
}
declare class SimulatedError extends Error {
    code: string | undefined;
    constructor(message: string, code?: string);
}
declare class SimulationExecEnvironment extends ExecEnvironment {
    format: TextFormatter;
    private _schemas;
    private _database;
    private _rng;
    private _simulateErrors;
    private _execCache;
    output: (type: string, value: Record<string, unknown>) => Promise<void>;
    generator: ResultGenerator | null;
    constructor(locale: string, timezone: string | undefined, schemas: SchemaRetriever, database: SimulationDatabase | undefined, { rng, simulateErrors }: {
        rng: () => number;
        simulateErrors?: boolean;
    });
    get program_id(): ThingTalk.Builtin.Entity;
    clearGetCache(): void;
    private _findInCache;
    private _failAction;
    invokeAction(kind: string, attrs: Record<string, string>, fname: string, params: Record<string, unknown>): AsyncIterable<[string, Record<string, unknown>]>;
    private _tryFromSimulationDatabase;
    private _doInvokeQuery;
    invokeQuery(kind: string, attrs: Record<string, string>, fname: string, params: Record<string, unknown>, hints: CompiledQueryHints): AsyncIterable<[string, Record<string, unknown>]>;
    invokeDBQuery(kind: string, attrs: Record<string, string>, query: Ast.Program): AsyncIterable<[string, Record<string, unknown>]>;
    formatEvent(outputType: string, output: Record<string, unknown>, hint: string): Promise<string>;
}
export { ResultGenerator, SimulationExecEnvironment, SimulatedError };
