UNPKG

@progress/kendo-angular-grid

Version:

Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.

132 lines (131 loc) 4.27 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { HttpHeaders, HttpResponse, HttpErrorResponse } from "@angular/common/http"; import { PreventableEvent } from "@progress/kendo-angular-common"; import { AIPromptComponent, AIPromptSettings } from "@progress/kendo-angular-conversational-ui"; import { WindowComponent, WindowSettings } from "@progress/kendo-angular-dialog"; import { CompositeFilterDescriptor, FilterDescriptor, GroupDescriptor, SortDescriptor } from "@progress/kendo-data-query"; /** * Interface representing all configuration options of the AI Assistant Window. */ export interface GridToolbarAIWindowSettings extends Omit<WindowSettings, 'content'> { } /** * Interface representing all configuration options of the AI Assistant Prompt. */ export interface GridToolbarAIPromptSettings extends Omit<AIPromptSettings, 'promptCommands'> { } /** * Represents the data sent in the AI request from the Grid Toolbar AI Assistant. */ export interface GridToolbarAIRequestData { columns: Array<{ field: string; title: string; }>; promptMessage: string; url?: string; requestOptions: { role?: string; headers?: HttpHeaders; method?: string; withCredentials?: boolean; body?: any; responseType?: 'json' | 'arraybuffer' | 'blob' | 'text'; [key: string]: any; }; } /** * Represents the response from the AI request in the Grid Toolbar AI Assistant. */ export interface GridToolbarAIRequestResponse { messages: string[]; sort?: SortDescriptor[]; filter?: CompositeFilterDescriptor; group?: GroupDescriptor[]; } /** * Configuration options for the HTTP request. */ export interface GridToolbarAIRequestOptions { /** * HTTP headers to include with the request. */ headers?: HttpHeaders; /** * The role of the user making the request, e.g., 'user', 'assistant'. * @default 'user' */ role?: string; /** * HTTP method to use for the request. * @default 'POST' */ method?: string; /** * Whether to include credentials (cookies, authorization headers) with the request. * @default false */ withCredentials?: boolean; /** * The expected response type. * @default 'json' */ responseType?: 'json' | 'arraybuffer' | 'blob' | 'text'; /** * The body of the request. */ body?: any; /** * Additional custom options that will be spread into the request configuration. */ [key: string]: any; } /** * @hidden */ export declare const DEFAULT_AI_REQUEST_OPTIONS: GridToolbarAIRequestOptions; /** * @hidden */ export declare const convertDateStringsInFilter: (filter: CompositeFilterDescriptor | FilterDescriptor, columns: any[]) => any; /** * @hidden */ export declare const isDateField: (fieldName: string, columns: any[]) => boolean; /** * Represents the event data when the AI Assistant request completes successfully. */ export declare class GridToolbarAIResponseSuccessEvent extends PreventableEvent { /** * The HTTP response from the AI service. */ response: HttpResponse<GridToolbarAIRequestResponse>; constructor(response: HttpResponse<GridToolbarAIRequestResponse>); } /** * Represents the event data when the AI Assistant request completes with an error. */ export declare class GridToolbarAIResponseErrorEvent extends PreventableEvent { /** * The HTTP error response from the AI service. */ error: HttpErrorResponse; constructor(error: HttpErrorResponse); } /** * Represents the event data when the AI Assistant request is initiated. */ export interface GridToolbarAIPromptRequestEvent { requestData: GridToolbarAIRequestData; isRetry: boolean; } /** * Represents the event data when the AI Assistant window is opened. */ export interface GridToolbarAIOpenEvent { aiWindow: WindowComponent; aiPrompt: AIPromptComponent; }