import { SpeechRecognitionResult } from 'recorder/index';
export type onCreatingBlockUpdatedHandler = (text: string) => void;
export type onBlockCreatedHandler = (payload: {
    blockId: string;
    time: number;
    lang: string;
    text: string;
    voiceStart: number;
    voiceEnd: number;
}) => void;
export type onVoiceCreatedHandler = (payload: {
    blockId: string;
    voiceId: string;
    ext: string;
    file: File;
}) => Promise<void>;
export interface TrawVoiceBlockGeneratorOptions {
    /**
     * pull voiceStart time by the given value in milliseconds
     * @default 500
     */
    voiceStartAdjustment?: number;
    /**
     * When the voice duration is less than the given value in milliseconds without recognized text, the voice is discarded
     * @default 3500
     */
    emptyBlockThreshold?: number;
    /**
     * Speech recognition language
     */
    speechRecognitionLanguage: string;
    /**
     * Called when a creating block is edited (text is changed)
     */
    onCreatingBlockUpdated?: onCreatingBlockUpdatedHandler;
    /**
     * Called when a block is created
     */
    onBlockCreated?: onBlockCreatedHandler;
    /**
     * Called when a voice file is created
     */
    onVoiceCreated?: onVoiceCreatedHandler;
}
export declare class TrawVoiceBlockGenerator {
    /**
     * BlockIds queue. Shift when a "BlockVoice" is created.
     * @private
     */
    private _blockIdsQueue;
    /**
     * Timestamp of the current block started regardless of the talking state
     * @private
     */
    private _blockStartedAt;
    /**
     * Timestamp of the meaningful block started when the user is talking
     * @private
     */
    private _speakingStartedAt;
    /**
     * Text of the block being created. Reset to empty after creating a block.
     * @private
     */
    private _recognitions;
    /**
     * pull voiceStart time by the given value in milliseconds
     * @private
     */
    private _voiceStartAdjustment;
    /**
     * When the voice duration is less than the given value in milliseconds without recognized text, the voice is discarded
     * @private
     */
    private _emptyBlockThreshold;
    /**
     * Speech recognition language
     */
    private _speechRecognitionLanguage;
    onCreatingBlockUpdated?: onCreatingBlockUpdatedHandler;
    onBlockCreated?: onBlockCreatedHandler;
    onBlockVoiceCreated?: onVoiceCreatedHandler;
    constructor({ voiceStartAdjustment, emptyBlockThreshold, speechRecognitionLanguage, onCreatingBlockUpdated, onBlockCreated, onVoiceCreated, }: TrawVoiceBlockGeneratorOptions);
    readonly onRecognized: (action: 'add' | 'update', result: SpeechRecognitionResult) => void;
    readonly markBlockStartedAt: () => void;
    readonly onStartTalking: () => void;
    /**
     * Create a block
     * @returns {boolean} true if a block is created, false if not
     */
    readonly createBlock: () => boolean;
    /**
     * Attach a voice file to the last block
     * @param file
     * @param ext
     */
    readonly createBlockVoice: (file: File, ext: string) => void;
    /**
     * Change Language
     */
    readonly changeSpeechRecognitionLanguage: (lang: string) => void;
}
//# sourceMappingURL=TrawVoiceBlockGenerator.d.ts.map