UNPKG

@progress/kendo-angular-conversational-ui

Version:

Kendo UI for Angular Conversational UI components

204 lines (203 loc) 8.19 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { AfterContentChecked, AfterViewInit, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, QueryList, Renderer2, SimpleChanges, TemplateRef } from "@angular/core"; import { SVGIcon } from "@progress/kendo-svg-icons"; import { LocalizationService } from '@progress/kendo-angular-l10n'; import { FabAlign, FabPositionMode, FloatingActionButtonComponent, SpeechToTextButtonSettings } from "@progress/kendo-angular-buttons"; import { BaseView } from "./views/base-view"; import { AIPromptService } from "./common/aiprompt.service"; import { PromptCommand, PromptOutput, CommandExecuteEvent, PromptRequestEvent, OutputRatingChangeEvent } from "./models"; import { AIPromptToolbarActionsDirective } from "./templates/toolbar-actions.template"; import { ToolbarNavigationService } from "./common/toolbar-navigation.service"; import { AIPromptOutputTemplateDirective } from "./templates/aiprompt-output-template.directive"; import { AIPromptOutputBodyTemplateDirective } from "./templates/aiprompt-output-body-template.directive"; import { TextAreaSettings } from "@progress/kendo-angular-inputs"; import * as i0 from "@angular/core"; /** * Represents the [Kendo UI AIPrompt component for Angular](slug:overview_aiprompt). * * @example * ```html * <kendo-aiprompt * [promptCommands]="commands" * [promptSuggestions]="suggestions" * [promptOutputs]="outputs" * [showOutputRating]="true" * (promptRequest)="onPromptRequest($event)"> * </kendo-aiprompt> * ``` * * @remarks * Supported children components are: {@link AIPromptCustomMessagesComponent}, {@link CustomViewComponent}, {@link CommandViewComponent}, {@link PromptViewComponent}, {@link OutputViewComponent}. */ export declare class AIPromptComponent implements OnInit, OnChanges, AfterContentChecked, AfterViewInit, OnDestroy { private localization; private service; private navigationService; private ngZone; private element; private renderer; hostClasses: boolean; get dirAttr(): string; constructor(localization: LocalizationService, service: AIPromptService, navigationService: ToolbarNavigationService, ngZone: NgZone, element: ElementRef, renderer: Renderer2); /** * @hidden */ fabButton: FloatingActionButtonComponent; /** * @hidden */ views: QueryList<BaseView>; /** * @hidden */ toolbarActionsTemplate: AIPromptToolbarActionsDirective; /** * @hidden */ outputTemplate: AIPromptOutputTemplateDirective; /** * @hidden */ outputBodyTemplate: AIPromptOutputBodyTemplateDirective; /** * The active view index of the AIPrompt component. */ set activeView(idx: number); get activeView(): number; /** * Sets the collection of commands to render in the Command view. */ set promptCommands(value: Array<PromptCommand>); /** * Sets the collection of suggestions to render in the Prompt view. */ set promptSuggestions(value: Array<string>); /** * Sets the collection of generated prompt outputs to render in the Output view. */ set promptOutputs(value: Array<PromptOutput>); /** * Specifies whether the rating buttons appear in each Output view card. * The rating buttons do not appear by default. * @default false */ set showOutputRating(value: boolean); /** * Specifies whether the Stop generation button appears in the Output view. * The Stop generation button does not appear by default. * @default false */ streaming: boolean; /** * Sets the settings for the Speech to Text button in the Prompt view * ([see example](slug:configuration_aiprompt#enabling-speech-to-text)). */ set speechToTextButton(settings: boolean | SpeechToTextButtonSettings); /** * Sets the settings for the TextArea in the Prompt view * ([see example](slug:configuration_aiprompt#configuring-the-prompt-text-area)). */ set textAreaSettings(settings: TextAreaSettings); /** * Sets the SVG icon for the Generate button in the Prompt view. */ generateButtonSVGIcon: SVGIcon; /** * Sets the icon for the Generate button in the Prompt view. * @default 'sparkles' */ generateButtonIcon: string; /** * Sets the disabled state for the Generate button in the Prompt view. * @default false */ disabledGenerateButton: boolean; /** * Fires when the `activeView` property is updated. * Use this event for two-way binding of the `activeView` property. */ activeViewChange: EventEmitter<number>; /** * Fires when you click the Generate button in the Prompt view or the Retry button in the Output view. * Use the event's `isRetry` field to determine the source element. */ promptRequest: EventEmitter<PromptRequestEvent>; /** * Fires when you click a Command view command. * The event data contains the selected command. */ commandExecute: EventEmitter<CommandExecuteEvent>; /** * Fires when you click a Copy button in any Output view card. */ outputCopy: EventEmitter<PromptOutput>; /** * Fires when you click a rating button in any Output view card. */ outputRatingChange: EventEmitter<OutputRatingChangeEvent>; /** * Fires when you click the Stop Generation button in the Output view. */ promptRequestCancel: EventEmitter<void>; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngAfterContentChecked(): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** * Focuses the first focusable element in the AIPrompt component. */ focus(): void; private subs; /** * @hidden */ get selectedView(): BaseView; /** * @hidden */ sparklesIcon: SVGIcon; /** * @hidden */ outputIcon: SVGIcon; /** * @hidden */ fabStopGenerationSVGIcon: SVGIcon; /** * @hidden */ get viewsArray(): Array<BaseView>; /** * @hidden */ fabPositionMode: FabPositionMode; /** * @hidden */ fabAlignment: FabAlign; private direction; private _activeView; /** * @hidden */ viewChange(idx: number): void; /** * @hidden */ messageFor(text: string): string; /** * @hidden */ get viewTemplate(): TemplateRef<any>; /** * @hidden */ handleGenerateOutput(): void; static ɵfac: i0.ɵɵFactoryDeclaration<AIPromptComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<AIPromptComponent, "kendo-aiprompt", ["kendoAIPrompt"], { "activeView": { "alias": "activeView"; "required": false; }; "promptCommands": { "alias": "promptCommands"; "required": false; }; "promptSuggestions": { "alias": "promptSuggestions"; "required": false; }; "promptOutputs": { "alias": "promptOutputs"; "required": false; }; "showOutputRating": { "alias": "showOutputRating"; "required": false; }; "streaming": { "alias": "streaming"; "required": false; }; "speechToTextButton": { "alias": "speechToTextButton"; "required": false; }; "textAreaSettings": { "alias": "textAreaSettings"; "required": false; }; "generateButtonSVGIcon": { "alias": "generateButtonSVGIcon"; "required": false; }; "generateButtonIcon": { "alias": "generateButtonIcon"; "required": false; }; "disabledGenerateButton": { "alias": "disabledGenerateButton"; "required": false; }; }, { "activeViewChange": "activeViewChange"; "promptRequest": "promptRequest"; "commandExecute": "commandExecute"; "outputCopy": "outputCopy"; "outputRatingChange": "outputRatingChange"; "promptRequestCancel": "promptRequestCancel"; }, ["toolbarActionsTemplate", "outputTemplate", "outputBodyTemplate", "views"], never, true, never>; }