/** * DevExtreme (common/ai-integration.d.ts) * Version: 25.2.3 * Build date: Fri Dec 12 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ /** * A prompt for the AI model. */ export type Prompt = { /** * Direct instructions for the AI model. */ system?: string; /** * A user message to the AI model. */ user?: string; }; /** * An object that contains additional data to be sent to an AI model. */ export type RequestParamsData = Record; /** * An object that contains an AI response. */ export type AIResponse = string | Record; /** * An object with request parameters for AI service. */ export type RequestParams = { /** * The prompt sent to the AI model. */ prompt: Prompt; /** * Additional data sent to the AI model. */ data?: RequestParamsData; }; /** * An object returned by the sendRequest function. */ export type Response = { /** * A promise that resolves with the final AI-generated text. */ promise: Promise; /** * A function that cancels the request. */ abort: () => void; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ChangeStyleCommandParams = { text: string; writingStyle: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ChangeToneCommandParams = { text: string; tone: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ExecuteCommandParams = { text: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ExpandCommandParams = { text: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ProofreadCommandParams = { text: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ShortenCommandParams = { text: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type SummarizeCommandParams = { text: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type TranslateCommandParams = { text: string; lang: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type SmartPasteFieldType = | 'color' | 'boolean' | 'string' | 'stringArray' | 'number' | 'numberRange' | 'date' | 'dateRange'; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type FieldInfo = { name: string; format: string; type?: SmartPasteFieldType; instruction?: string; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type SmartPasteCommandParams = { text: string; fields: FieldInfo[]; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type GenerateGridColumnCommandParams = { text: string; data: Record; additionalInfo?: Record; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ChangeStyleCommandResult = string; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ChangeToneCommandResult = string; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ExecuteCommandResult = string; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ExpandCommandResult = string; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ProofreadCommandResult = string; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ShortenCommandResult = string; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type SummarizeCommandResult = string; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type TranslateCommandResult = string; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type SmartPasteResultFieldType = string | string[] | number | number[] | Date | Date[] | boolean; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type SmartPasteCommandResult = Array<{ name: string; value: SmartPasteResultFieldType; }>; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type GenerateGridColumnCommandResult = { data: Record; }; /** * */ export type GenerateGridColumnCommandResponse = string | { /** * */ data: string | Record; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type RequestCallbacks = { onChunk?: (chunk: string) => void; onComplete?: (finalResponse: T) => void; onError?: (error: Error) => void; }; /** * An object responsible for sending requests to an AI service. */ export type AIProvider = { /** * A function that sends a request to an AI service. */ sendRequest: (params: RequestParams) => Response; }; /** * A class that activates AI services in DevExpress UI components. */ export class AIIntegration { /** * @docid * @param provider */ constructor(provider: AIProvider); changeStyle(params: ChangeStyleCommandParams, callbacks: RequestCallbacks): () => void; changeTone(params: ChangeToneCommandParams, callbacks: RequestCallbacks): () => void; execute(params: ExecuteCommandParams, callbacks: RequestCallbacks): () => void; expand(params: ExpandCommandParams, callbacks: RequestCallbacks): () => void; proofread(params: ProofreadCommandParams, callbacks: RequestCallbacks): () => void; shorten(params: ShortenCommandParams, callbacks: RequestCallbacks): () => void; summarize(params: SummarizeCommandParams, callbacks: RequestCallbacks): () => void; translate(params: TranslateCommandParams, callbacks: RequestCallbacks): () => void; smartPaste(params: SmartPasteCommandParams, callbacks: RequestCallbacks): () => void; generateGridColumn(params: GenerateGridColumnCommandParams, callbacks: RequestCallbacks): () => void; }