export declare type RhinoInference = {
    /** Rhino has concluded the inference (isUnderstood is now set) */
    isFinalized: boolean;
    /** The intent was understood (it matched an expression in the context) */
    isUnderstood?: boolean;
    /** The name of the intent */
    intent?: string;
    /** Map of the slot variables and values extracted from the utterance */
    slots?: Record<string, string>;
};
export interface RhinoEngine {
    /** Release all resources acquired by Rhino */
    release(): void;
    /** Process a single frame of 16-bit 16kHz PCM audio.
     * When the returned RhinoInference isFinalized=true, Rhino has concluded this interaction. */
    process(frame: Int16Array): Promise<RhinoInference>;
    /** The version of the Rhino engine */
    readonly version: string;
    /** The sampling rate of audio expected by the Rhino engine */
    readonly sampleRate: number;
    /** The frame length of audio expected by the Rhino engine */
    readonly frameLength: number;
    /** The source of the Rhino context (YAML format) */
    readonly contextInfo: string;
}
export declare type RhinoContext = {
    /** Base64 representation of a trained Rhino context (`.rhn` file) */
    base64: string;
    /** Value in range [0,1] that trades off miss rate for false alarm */
    sensitivity?: number;
};
export declare type RhinoWorkerResponseInference = {
    command: 'rhn-inference';
    inference: RhinoInference;
};
export declare type RhinoWorkerResponseInfo = {
    command: 'rhn-info';
    info: string;
};
export declare type PorcupineKeywordCustom = {
    /** Base64 representation of a trained Porcupine keyword (`.ppn` file) */
    base64: string;
    /** An arbitrary label that you want Picovoice to report when the detection occurs */
    custom: string;
    /** Value in range [0,1] that trades off miss rate for false alarm */
    sensitivity?: number;
};
export declare type PorcupineKeywordBuiltin = {
    /** Name of a builtin keyword for the specific language (e.g. "Grasshopper" for English, or "Ananas" for German) */
    builtin: string;
    /** Value in range [0,1] that trades off miss rate for false alarm */
    sensitivity?: number;
};
export declare type PorcupineKeyword = PorcupineKeywordCustom | PorcupineKeywordBuiltin;
export declare type PorcupineWorkerResponseKeyword = {
    command: 'ppn-keyword';
    keywordLabel: string;
};
export interface PorcupineEngine {
    /** Release all resources acquired by Rhino */
    release(): void;
    /** Process a single frame of 16-bit 16kHz PCM audio */
    process(frame: Int16Array): Promise<number>;
    /** The version of the Rhino engine */
    readonly version: string;
    /** The sampling rate of audio expected by the Rhino engine */
    readonly sampleRate: number;
    /** The frame length of audio expected by the Rhino engine */
    readonly frameLength: number;
    /** Maps the keyword detection index (e.g. 0, 1) returned by Porcupine to the label (e.g. "Hey Pico", "Grasshopper") */
    readonly keywordLabels: Map<number, string>;
}
export declare type PicovoiceWorkerArgs = {
    accessKey: string;
    porcupineKeyword: PorcupineKeyword;
    rhinoContext: RhinoContext;
    requireEndpoint?: boolean;
    start?: boolean;
};
export declare type PicovoiceEngineArgs = {
    accessKey: string;
    porcupineKeyword: PorcupineKeyword;
    rhinoContext: RhinoContext;
    porcupineCallback: (keywordLabel: string) => void;
    rhinoCallback: (inference: RhinoInference) => void;
    requireEndpoint?: boolean;
};
export interface PicovoiceEngine {
    /** Release all resources acquired by Rhino */
    release(): void;
    /** Process a single frame of 16-bit 16kHz PCM audio */
    process(frame: Int16Array): Promise<void>;
    /** The version of the Rhino engine */
    readonly version: string;
    /** The sampling rate of audio expected by the Rhino engine */
    readonly sampleRate: number;
    /** The frame length of audio expected by the Rhino engine */
    readonly frameLength: number;
    /** The source of the Rhino context (YAML format) */
    readonly contextInfo: string;
}
export declare type WorkerRequestProcess = {
    command: 'process';
    inputFrame: Int16Array;
};
export declare type WorkerRequestVoid = {
    command: 'reset' | 'pause' | 'resume' | 'release';
};
export declare type PicovoiceWorkerResponseErrorInit = {
    command: 'pv-error-init';
    error: Error | string;
};
export declare type PicovoiceWorkerRequestInit = {
    command: 'init';
    picovoiceArgs: PicovoiceWorkerArgs;
};
export declare type PicovoiceWorkerRequestInfo = {
    command: 'info';
};
export declare type PicovoiceWorkerResponseReady = {
    command: 'pv-ready';
};
export declare type WorkerRequestFileOperation = {
    command: 'file-save-succeeded' | 'file-save-failed' | 'file-load-succeeded' | 'file-load-failed' | 'file-exists-succeeded' | 'file-exists-failed' | 'file-delete-succeeded' | 'file-delete-failed';
    message?: string;
    content?: string;
};
export declare type WorkerResponseFileOperation = {
    command: 'file-save' | 'file-load' | 'file-exists' | 'file-delete' | 'file-save' | 'file-load' | 'file-exists' | 'file-delete';
    path: string;
    content?: string;
};
export declare type PicovoiceWorkerRequest = PicovoiceWorkerRequestInit | WorkerRequestVoid | PicovoiceWorkerRequestInfo | WorkerRequestProcess | WorkerRequestFileOperation;
export declare type PicovoiceWorkerResponse = PicovoiceWorkerResponseErrorInit | PicovoiceWorkerResponseReady | PorcupineWorkerResponseKeyword | RhinoWorkerResponseInference | RhinoWorkerResponseInfo | WorkerResponseFileOperation;
export interface PicovoiceWorker extends Omit<Worker, 'postMessage'> {
    postMessage(command: PicovoiceWorkerRequest): void;
}
//# sourceMappingURL=picovoice_types.d.ts.map