UNPKG

@progress/kendo-angular-buttons

Version:
200 lines (199 loc) 6.85 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core'; import { Subscription } from 'rxjs'; import { SVGIcon } from '@progress/kendo-svg-icons'; import { LocalizationService } from '@progress/kendo-angular-l10n'; import { IntegrationMode } from './models/integration-mode'; import { SpeechToTextResultEvent } from './models/result-event'; import { SpeechToTextErrorEvent } from './models/error-event'; import { ButtonFillMode, ButtonRounded, ButtonSize, ButtonThemeColor } from '../common/models'; import * as i0 from "@angular/core"; /** * Represents the Kendo UI SpeechToTextButton component for Angular. * * @example * ```html * <button kendoSpeechToTextButton></button> * ``` */ export declare class SpeechToTextButtonComponent implements OnInit, OnDestroy { renderer: Renderer2; ngZone: NgZone; /** * When `true`, disables the SpeechToTextButton and prevents user interaction. * * @default false */ set disabled(disabled: boolean); get disabled(): boolean; /** * Sets the padding of the SpeechToTextButton. * * @default 'medium' */ set size(size: ButtonSize); get size(): ButtonSize; /** * Sets the border radius of the SpeechToTextButton. * * @default 'medium' */ set rounded(rounded: ButtonRounded); get rounded(): ButtonRounded; /** * Sets the background and border styles of the SpeechToTextButton. * * @default 'solid' */ set fillMode(fillMode: ButtonFillMode); get fillMode(): ButtonFillMode; /** * Sets a predefined theme color for the SpeechToTextButton. * The theme color applies as a background and border color and adjusts the text color. * * @default 'base' */ set themeColor(themeColor: ButtonThemeColor); get themeColor(): ButtonThemeColor; /** * Specifies which speech recognition engine or integration the component should use. Allows the component to operate in different environments or use alternative implementations. */ integrationMode: IntegrationMode; /** * Specifies a `BCP 47` language tag (e.g., 'en-US', 'bg-BG') used for speech recognition. * * @default 'en-US' */ lang: string; /** * Specifies whether continuous results are returned for each recognition, or only a single result once recognition stops. * * @default false */ continuous: boolean; /** * Specifies whether interim results should be returned or not. Interim results are results that are not yet final. * * @default false */ interimResults: boolean; /** * Represents the maximum number of alternative transcriptions to return for each result. * * @default 1 */ maxAlternatives: number; /** * Fires when the speech recognition service has begun listening to incoming audio. */ start: EventEmitter<any>; /** * Fires when the speech recognition service has disconnected. */ end: EventEmitter<any>; /** * Fires when the speech recognition service returns a result - a word or phrase has been positively recognized. */ result: EventEmitter<SpeechToTextResultEvent>; /** * Fires when a speech recognition error occurs. The event argument is a string, containing the error message. */ error: EventEmitter<SpeechToTextErrorEvent>; /** * Fires when the user clicks the SpeechToTextButton. */ click: EventEmitter<any>; get iconButtonClass(): boolean; get listeningClass(): boolean; speechToTextButtonClass: boolean; classButton: boolean; get classDisabled(): boolean; get getDirection(): string; get ariaPressed(): boolean; /** * @hidden */ onFocus(): void; /** * @hidden */ onBlur(): void; /** * Focuses the SpeechToTextButton component. */ focus(): void; /** * Removes focus from the SpeechToTextButton component. */ blur(): void; ngOnInit(): void; ngOnChanges(changes: any): void; ngAfterViewInit(): void; ngOnDestroy(): void; constructor(element: ElementRef, renderer: Renderer2, localization: LocalizationService, ngZone: NgZone); /** * Indicates whether the button is actively listening for incoming audio. */ isListening: boolean; /** * Indicates whether web speech functionality is supported. */ get isWebSpeechSupported(): boolean; set isFocused(isFocused: boolean); get isFocused(): boolean; /** * @hidden */ get hasText(): boolean; /** * @hidden */ onClick(): void; /** * @hidden */ get buttonSvgIcon(): SVGIcon; /** * @hidden */ get buttonIcon(): string; /** * @hidden */ setAttribute(attribute: string, value: string): void; /** * @hidden */ element: HTMLElement; /** * @hidden */ isDisabled: boolean; /** * @hidden */ subs: Subscription; private microphoneSvgIcon; private stopSvgIcon; private speechRecognition; private _size; private _rounded; private _fillMode; private _themeColor; private _focused; private direction; private handleClasses; private handleStart; private handleEnd; private handleResult; private handleError; private toObservable; private handleThemeColor; private destroyWebSpeech; private createWebSpeech; static ɵfac: i0.ɵɵFactoryDeclaration<SpeechToTextButtonComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SpeechToTextButtonComponent, "button[kendoSpeechToTextButton]", ["kendoSpeechToTextButton"], { "disabled": { "alias": "disabled"; "required": false; }; "size": { "alias": "size"; "required": false; }; "rounded": { "alias": "rounded"; "required": false; }; "fillMode": { "alias": "fillMode"; "required": false; }; "themeColor": { "alias": "themeColor"; "required": false; }; "integrationMode": { "alias": "integrationMode"; "required": false; }; "lang": { "alias": "lang"; "required": false; }; "continuous": { "alias": "continuous"; "required": false; }; "interimResults": { "alias": "interimResults"; "required": false; }; "maxAlternatives": { "alias": "maxAlternatives"; "required": false; }; }, { "start": "start"; "end": "end"; "result": "result"; "error": "error"; "click": "click"; }, never, ["*"], true, never>; }