/*! * Jodit Editor PRO (https://xdsoft.net/jodit/) * See LICENSE.md in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/ */ /** * Pluggable voice-recognition engine contract. The mic button drives an engine * and reacts to its callbacks; this lets you point voice dictation at any * backend — the built-in Jodit transcription proxy, OpenAI Realtime directly, or * your own service — via the `voiceInputApi` option. * * @module plugins/ai-assistant-pro/voice */ export interface IVoiceEngineCallbacks { /** Recognition is live — audio is now streaming. */ onReady?(): void; /** Interim (partial) transcript for the current phrase. */ onInterim?(text: string): void; /** Committed transcript for a finished phrase. */ onFinal?(text: string): void; /** A recoverable error (mic denied, connection/provider error). */ onError?(message: string): void; /** The session ended. */ onEnd?(): void; } export interface IVoiceEngine { /** Begin capturing and recognising speech. */ start(): void; /** Stop and release resources. */ stop(): void; } /** * Factory for a voice engine. Receives the mic button's callbacks and returns an * engine bound to them. Assign to `voiceInputApi` to use a custom backend. */ export type VoiceEngineFactory = (callbacks: IVoiceEngineCallbacks) => IVoiceEngine;