/** * DevExtreme (ui/speech_to_text.d.ts) * Version: 25.2.3 * Build date: Fri Dec 12 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { EventInfo, NativeEventInfo, InitializedEventInfo, ChangedOptionInfo, InteractionEvent, } from '../events'; import Widget, { WidgetOptions } from './widget/ui.widget'; import type { ButtonStyle, ButtonType } from './button'; /** * Configures the Web Speech API (SpeechRecognition properties). */ export type SpeechRecognitionConfig = { /** * Configures the SpeechRecognition.continuous property. */ continuous?: boolean; /** * Configures the SpeechRecognition.grammars property. */ grammars?: string[]; /** * Configures the SpeechRecognition.interimResults property. */ interimResults?: boolean; /** * Configures the SpeechRecognition.lang property. */ lang?: string; /** * Configures the SpeechRecognition.maxAlternatives property. */ maxAlternatives?: number; }; /** * Allows you to implement custom speech recognition engines. */ export type CustomSpeechRecognizer = { /** * Specifies whether a custom speech recognition engine is implemented. */ enabled?: boolean; /** * Indicates whether the custom speech recognition engine is listening. */ isListening?: boolean; }; /** * The argument type in the startClick event. */ export type StartClickEvent = NativeEventInfo; /** * The argument type in the stopClick event. */ export type StopClickEvent = NativeEventInfo; /** * The argument type in the result event. */ export type ResultEvent = EventInfo & { event: Event }; /** * The argument type in the error event. */ export type ErrorEvent = EventInfo & { event: Event }; /** * The argument type in the end event. */ export type EndEvent = EventInfo & { event: Event }; /** * The argument type in the contentReady event. */ export type ContentReadyEvent = EventInfo; /** * The argument type in the disposing event. */ export type DisposingEvent = EventInfo; /** * The argument type in the initialized event. */ export type InitializedEvent = InitializedEventInfo; /** * The argument type in the optionChanged event. */ export type OptionChangedEvent = EventInfo & ChangedOptionInfo; /** * */ export interface Properties extends WidgetOptions { /** * Allows you to implement custom speech recognition engines. */ customSpeechRecognizer?: CustomSpeechRecognizer; /** * The SpeechToText button text in the initial component state. */ startText?: string; /** * The SpeechToText button text in the 'listening' component state. */ stopText?: string; /** * Specifies SpeechToText button styling. */ stylingMode?: ButtonStyle; /** * The SpeechToText button icon in the initial component state. */ startIcon?: string; /** * The SpeechToText button icon in the 'listening' component state. */ stopIcon?: string; /** * Specifies the SpeechToText button type. */ type?: ButtonType | string; /** * Configures the Web Speech API (SpeechRecognition properties). */ speechRecognitionConfig?: SpeechRecognitionConfig | { [key: string]: any }; /** * A function that is executed when the SpeechToText button is clicked or tapped in the initial component state. */ onStartClick?: ((e: StartClickEvent) => void) | undefined; /** * A function that is executed when the SpeechToText button is clicked or tapped in the 'listening' component state. */ onStopClick?: ((e: StopClickEvent) => void) | undefined; /** * A function that is executed when the Web Speech API returns a result. */ onResult?: ((e: ResultEvent) => void) | undefined; /** * A function that is executed when the Web Speech API encounters an error. */ onError?: ((e: ErrorEvent) => void) | undefined; /** * A function that is executed when the Web Speech API finishes transcription and SpeechToText switches to the initial component state. */ onEnd?: ((e: EndEvent) => void) | undefined; } /** * The SpeechToText UI component is TBA. */ export default class dxSpeechToText extends Widget { } export type ExplicitTypes = { Properties: Properties; ContentReadyEvent: ContentReadyEvent; DisposingEvent: DisposingEvent; InitializedEvent: InitializedEvent; OptionChangedEvent: OptionChangedEvent; StartClickEvent: StartClickEvent; StopClickEvent: StopClickEvent; ResultEvent: ResultEvent; ErrorEvent: ErrorEvent; };