UNPKG

@progress/kendo-angular-conversational-ui

Version:

Kendo UI for Angular Conversational UI components

102 lines (101 loc) 4.33 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, NgZone } from '@angular/core'; import { AttachmentTemplateDirective } from './attachment-template.directive'; import { LocalizationService } from '@progress/kendo-angular-l10n'; import { MessageTemplateDirective } from './message-template.directive'; import { ExecuteActionEvent, Message, SendMessageEvent, User } from './api'; import { MessageBoxType } from './common/models/message-box-options'; import { ChatMessageBoxTemplateDirective } from './message-box.directive'; import { MessageBoxComponent } from './message-box.component'; import * as i0 from "@angular/core"; /** * Represents the [Kendo UI Chat component for Angular](slug:overview_convui). * * Provides a conversational UI for chat-based applications. * Supports message templates, attachments, localization, and user actions. * * @example * ```html * <kendo-chat * [messages]="messages" * [user]="user" * (sendMessage)="onSendMessage($event)" * (executeAction)="onExecuteAction($event)"> * </kendo-chat> * ``` * * @remarks * Supported children components are: {@link CustomMessagesComponent}, {@link HeroCardComponent}. */ export declare class ChatComponent implements AfterViewInit, OnDestroy { private localization; private zone; /** * Defines the array of messages displayed in the Chat. * Each message can include a timestamp for unique identification. * For more information, refer to [ngFor - Change Tracking](link:site.data.urls.angular['ngforof']#change-propagation). */ messages: Message[]; /** * Specifies the [`User`](slug:api_conversational-ui_user) instance representing the local user. * The User ID is used to distinguish messages authored by the local user. */ user: User; /** * Determines the type of input used in the message box. * Can be set to `textbox` for a single-line input or `textarea` for multi-line input * ([see example](slug:message_box#message-box-types)). * @default 'textbox' */ messageBoxType: MessageBoxType; /** * Emits when the user sends a message by clicking the **Send** button or pressing **Enter**. * * > The message is not automatically added to the `messages` array. */ sendMessage: EventEmitter<SendMessageEvent>; /** * Emits when the user clicks a quick action button. * The Chat internally handles [known actions](slug:api_conversational-ui_actiontype) such as `reply`, `openUrl`, and `call`. * * The event is preventable&mdash;calling `preventDefault` suppresses the built-in action. */ executeAction: EventEmitter<ExecuteActionEvent>; get className(): string; get dirAttr(): string; attachmentTemplate: AttachmentTemplateDirective; messageTemplate: MessageTemplateDirective; messageBoxTemplate: ChatMessageBoxTemplateDirective; messageBox: MessageBoxComponent; /** * @hidden */ messageList: ElementRef; /** * @hidden */ get localizationText(): LocalizationService; /** * @hidden */ autoScroll: boolean; private direction; private localizationChangeSubscription; constructor(localization: LocalizationService, zone: NgZone); ngOnChanges(): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** * @hidden */ dispatchAction(e: ExecuteActionEvent): void; /** * @hidden */ textFor(key: string): string; static ɵfac: i0.ɵɵFactoryDeclaration<ChatComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ChatComponent, "kendo-chat", never, { "messages": { "alias": "messages"; "required": false; }; "user": { "alias": "user"; "required": false; }; "messageBoxType": { "alias": "messageBoxType"; "required": false; }; }, { "sendMessage": "sendMessage"; "executeAction": "executeAction"; }, ["attachmentTemplate", "messageTemplate", "messageBoxTemplate"], never, true, never>; }