@progress/kendo-angular-conversational-ui
Version:
Kendo UI for Angular Conversational UI components
134 lines (133 loc) • 5.13 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { AfterViewInit, EventEmitter, NgZone, OnDestroy, QueryList, TemplateRef } from "@angular/core";
import { SVGIcon } from "@progress/kendo-svg-icons";
import { LocalizationService } from '@progress/kendo-angular-l10n';
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 * 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>
* ```
*/
export declare class AIPromptComponent implements AfterViewInit, OnDestroy {
private localization;
private service;
private navigationService;
private ngZone;
hostClasses: boolean;
get dirAttr(): string;
constructor(localization: LocalizationService, service: AIPromptService, navigationService: ToolbarNavigationService, ngZone: NgZone);
/**
* @hidden
*/
views: QueryList<BaseView>;
/**
* @hidden
*/
toolbarActionsTemplate: AIPromptToolbarActionsDirective;
/**
* 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 if the rating buttons appear in each **Output** view card.
* By default, the rating buttons do not appear.
* @default false
*/
set showOutputRating(value: boolean);
/**
* Fires when the `activeView` property is updated.
* Use this event for two-way binding of the `activeView` property.
*/
activeViewChange: EventEmitter<number>;
/**
* Fires when the user clicks 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 the user clicks a **Command** view command.
* The event data contains the selected command.
*/
commandExecute: EventEmitter<CommandExecuteEvent>;
/**
* Fires when the user clicks a **Copy** button in any **Output** view card.
*/
outputCopy: EventEmitter<PromptOutput>;
/**
* Fires when the user clicks a rating button in any **Output** view card.
*/
outputRatingChange: EventEmitter<OutputRatingChangeEvent>;
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
*/
get viewsArray(): Array<BaseView>;
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; }; }, { "activeViewChange": "activeViewChange"; "promptRequest": "promptRequest"; "commandExecute": "commandExecute"; "outputCopy": "outputCopy"; "outputRatingChange": "outputRatingChange"; }, ["toolbarActionsTemplate", "views"], never, true, never>;
}