@progress/kendo-angular-buttons
Version:
Buttons Package for Angular
115 lines (114 loc) • 3.48 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { HttpHeaders, HttpResponse } from "@angular/common/http";
import { PreventableEvent } from "@progress/kendo-angular-common";
import { SmartPasteFormField } from "./form-field";
/**
* Defines the data structure for the HTTP request body sent by Smart Paste.
*/
export interface SmartPasteAIRequestData {
/**
* Sets the form fields to send to the AI service.
*/
formFields: Array<SmartPasteFormField>;
/**
* Sets the content to be sent to the AI service.
*/
content: string;
/**
* Sets the URL of the AI service endpoint.
*/
url?: string;
/**
* Sets the request options for the AI service.
* Includes headers, HTTP method, and other configurations.
*/
requestOptions: {
role?: string;
headers?: HttpHeaders;
method?: string;
withCredentials?: boolean;
body?: any;
responseType?: 'json' | 'arraybuffer' | 'blob' | 'text';
[key: string]: any;
};
}
/**
* @hidden
*
* Represents the response from the AI request in the Smart Paste Button.
*/
export interface SmartPasteAIResponse {
/**
* A record mapping form field names to their parsed values. The id of each field corresponds to the `field` property in `SmartPasteFormField`.
*/
fieldValues: Record<string, unknown>;
}
/**
* Defines configuration options for the HTTP request sent to the AI service.
*/
export interface SmartPasteAIRequestOptions {
/**
* Sets the HTTP headers to include with the request.
*/
headers?: HttpHeaders;
/**
* Sets the role of the user making the request.
*
* @default 'user'
*/
role?: string;
/**
* Sets the HTTP method for the request.
*
* @default 'POST'
*/
method?: string;
/**
* Includes credentials such as cookies and authorization headers with the request.
*
* @default false
*/
withCredentials?: boolean;
/**
* Sets the expected response type from the AI service.
*
* @default 'json'
*/
responseType?: 'json' | 'arraybuffer' | 'blob' | 'text';
/**
* Sets the body of the request.
*/
body?: any;
/**
* Sets additional custom options to spread into the request configuration.
*/
[key: string]: any;
}
/**
* @hidden
*/
export declare const DEFAULT_AI_REQUEST_OPTIONS: SmartPasteAIRequestOptions;
/**
* Represents the event arguments for the `requestStart` event of the SmartPasteButton.
*/
export declare class SmartPasteRequestStartEvent extends PreventableEvent {
/**
* Gets the request data to send to the AI service.
*/
requestData: SmartPasteAIRequestData;
constructor(requestData: SmartPasteAIRequestData);
}
/**
* Represents the event arguments for the `requestEnd` event of the SmartPasteButton.
*/
export declare class SmartPasteRequestEndEvent extends PreventableEvent {
/**
* Gets the HTTP response from the AI service.
* Contains an error object when the request fails.
*/
response: HttpResponse<any>;
constructor(response: HttpResponse<any>);
}