/// <reference types="node" />
import Stream from 'stream';
import * as Tp from 'thingpedia';
import { SchemaRetriever } from 'thingtalk';
import { SentenceExample } from '../parsers';
import { AnyEntity } from '../../utils/entity-utils';
interface Constant {
    key: string;
    value: AnyEntity;
    display: string;
    unit?: string;
}
interface SampleResult {
    id: string;
    utterance: string;
    target_code: string;
    depth: number;
    sentence_length: number;
    num_functions: number;
    num_entities: number;
    num_pp: number;
    num_filters: number;
    prim_type: string;
    function_signature: string;
    context?: string;
    context_utterance?: string;
    assistant_action?: string;
}
interface SampleOptions {
    rng: () => number;
    debug: boolean;
    functionHighValueList?: Set<string>;
}
interface SamplingStrategy<StateType> {
    init(): StateType;
    iterate(state: StateType): Iterable<[string, SampleResult[]]>;
    collect(state: StateType, input: SentenceExample, result: SampleResult, options: SampleOptions): void;
    sample(key: string, choices: SampleResult[], options: SampleOptions): SampleResult[];
}
interface BySentenceSampleState {
    s: number;
    sentences: string[];
    bags: Map<string, SampleResult[] & {
        n: number;
    }>;
}
declare const SAMPLING_STRATEGIES: {
    bySignature: SamplingStrategy<Map<string, SampleResult[]>>;
    byCode: SamplingStrategy<Map<string, SampleResult[]>>;
    bySentence: SamplingStrategy<BySentenceSampleState>;
};
interface SentenceSamplerOptions {
    samplingStrategy?: keyof typeof SAMPLING_STRATEGIES;
    functionHighValueList?: Set<string>;
    functionBlackList?: Set<string>;
    deviceBlackList?: Set<string>;
    functionWhiteList?: Set<string>;
    deviceWhiteList?: Set<string>;
    compoundOnly: boolean;
    locale: string;
    rng: () => number;
    debug: boolean;
}
export default class SentenceSampler extends Stream.Transform {
    private _tpClient;
    private _schemaRetriever;
    private _constants;
    private _options;
    private _samplingStrategy;
    private _samplingState;
    private _detokenizer;
    constructor(tpClient: Tp.BaseClient, schemaRetriever: SchemaRetriever, constants: Record<string, Constant[]>, options: SentenceSamplerOptions);
    private _run;
    _transform(input: SentenceExample, encoding: BufferEncoding, callback: (err?: Error) => void): void;
    _flush(callback: () => void): void;
}
export {};
