import { PvModel } from '@picovoice/web-utils'; import { RhinoError } from "./rhino_errors"; export declare enum PvStatus { SUCCESS = 10000, OUT_OF_MEMORY = 10001, IO_ERROR = 10002, INVALID_ARGUMENT = 10003, STOP_ITERATION = 10004, KEY_ERROR = 10005, INVALID_STATE = 10006, RUNTIME_ERROR = 10007, ACTIVATION_ERROR = 10008, ACTIVATION_LIMIT_REACHED = 10009, ACTIVATION_THROTTLED = 10010, ACTIVATION_REFUSED = 10011 } export type RhinoContext = PvModel & { /** @defaultValue '0.5' */ sensitivity?: number; }; export type RhinoModel = PvModel; export type RhinoOptions = { /** @defaultValue 'best' */ device?: string; /** @defaultValue '1.0' */ endpointDurationSec?: number; /** @defaultValue 'false' */ requireEndpoint?: boolean; /** @defaultValue '(error) => {}' */ processErrorCallback?: (error: RhinoError) => void; }; export 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; }; export type InferenceCallback = (inference: RhinoInference) => void; export type RhinoWorkerInitRequest = { command: 'init'; accessKey: string; contextPath: string; sensitivity: number; modelPath: string; wasmSimd: string; wasmSimdLib: string; wasmPThread: string; wasmPThreadLib: string; sdk: string; options: RhinoOptions; }; export type RhinoWorkerProcessRequest = { command: 'process'; inputFrame: Int16Array; }; export type RhinoWorkerResetRequest = { command: 'reset'; }; export type RhinoWorkerReleaseRequest = { command: 'release'; }; export type RhinoWorkerRequest = RhinoWorkerInitRequest | RhinoWorkerProcessRequest | RhinoWorkerResetRequest | RhinoWorkerReleaseRequest; export type RhinoWorkerFailureResponse = { command: 'failed' | 'error'; status: PvStatus; shortMessage: string; messageStack: string[]; }; export type RhinoWorkerInitResponse = RhinoWorkerFailureResponse | { command: 'ok'; frameLength: number; sampleRate: number; version: string; contextInfo: string; }; export type RhinoWorkerProcessResponse = RhinoWorkerFailureResponse | { command: 'ok-process'; inference: RhinoInference; }; export type RhinoWorkerResetResponse = RhinoWorkerFailureResponse | { command: 'ok'; }; export type RhinoWorkerReleaseResponse = RhinoWorkerFailureResponse | { command: 'ok'; }; export type RhinoWorkerResponse = RhinoWorkerInitResponse | RhinoWorkerProcessResponse | RhinoWorkerResetResponse | RhinoWorkerReleaseResponse; //# sourceMappingURL=types.d.ts.map