import { CheetahOptions, CheetahInputOptions } from './types';
/**
 * Node.js binding for Cheetah streaming speech-to-text engine
 *
 * Performs the calls to the Cheetah node library. Does some basic parameter validation to prevent
 * errors occurring in the library layer. Provides clearer error messages in native JavaScript.
 */
export default class Cheetah {
    private _pvCheetah;
    private _handle;
    private readonly _version;
    private readonly _frameLength;
    private readonly _sampleRate;
    /**
     * Creates an instance of Cheetah.
     * @param {string} accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
     * @param options Optional configuration arguments.
     * @param {string} options.modelPath the path to the Cheetah model (.pv extension)
     * @param {string} options.device String representation of the device (e.g., CPU or GPU) to use.
     *   If set to `best`, the most suitable device is selected automatically.
     *   If set to `gpu`, the engine uses the first available GPU device.
     *   To select a specific GPU device, set this argument to `gpu:${GPU_INDEX}`.
     *   If set to `cpu`, the engine will run on the CPU with the default number of threads.
     *   To specify the number of threads, set this argument to `cpu:${NUM_THREADS}`.
     * @param {string} options.libraryPath the path to the Cheetah library (.node extension)
     * @param {number} options.endpointDurationSec Duration of endpoint in seconds. A speech endpoint is detected when there is a
     * chunk of audio (with a duration specified herein) after an utterance without any speech in it. Set to `0`
     * to disable endpoint detection.
     * @param {boolean} options.enableAutomaticPunctuation Flag to enable automatic punctuation insertion.
     * @param {boolean} options.enableTextNormalization Flag to enable text normalization. Enabling this feature
     * improves the readability and formatting of Cheetah's transcriptions (e.g. converts number words to digits)
     * at the cost of some additional latency.
     */
    constructor(accessKey: string, options?: CheetahOptions);
    /**
     * @returns number of audio samples per frame (i.e. the length of the array provided to the process function)
     * @see {@link process}
     */
    get frameLength(): number;
    /**
     * @returns the audio sampling rate accepted by the process function
     * @see {@link process}
     */
    get sampleRate(): number;
    /**
     * @returns the version of the Cheetah engine
     */
    get version(): string;
    /**
     * Lists all available devices that Cheetah can use for inference. Each entry in the list can be the `device` argument
     * of the constructor.
     *
     * @returns List of all available devices that Cheetah can use for inference.
     */
    static listAvailableDevices(options?: CheetahInputOptions): string[];
    /**
     * Processes a frame of audio and returns newly-transcribed text and a flag indicating if an endpoint has been detected.
     * Upon detection of an endpoint, the client may invoke `Cheetah.flush()` to retrieve any remaining transcription.
     *
     * @param {Int16Array} pcm Audio data. The audio needs to have a sample rate equal to `Cheetah.sampleRate` and be 16-bit linearly-encoded.
     * The specific array length can be attained by calling `Cheetah.frameLength`. This function operates on single-channel audio.
     * @returns {string, boolean} Inferred transcription, and a flag indicating if an endpoint has been detected.
     */
    process(pcm: Int16Array): [string, boolean];
    /**
     * Marks the end of the audio stream, flushes internal state of the object, and returns any remaining transcript.
     *
     * @returns {string} Inferred transcription.
     */
    flush(): string;
    /**
     * Releases the resources acquired by Cheetah.
     *
     * Be sure to call this when finished with the instance
     * to reclaim the memory that was allocated by the C library.
     */
    release(): void;
    private handlePvStatus;
}
//# sourceMappingURL=cheetah.d.ts.map