UNPKG

jodit-pro

Version:

PRO Version of Jodit Editor

72 lines (71 loc) 2.3 kB
import type { IConversation, IConversationMeta } from "./conversations"; import type { AIAssistantDisplayMode, AIAssistantTheme } from "./types"; /** * Global settings that apply across all conversations */ export interface IGlobalSettings { /** Display mode (dialog, left, right, top, bottom) */ displayMode?: AIAssistantDisplayMode; /** Panel size in pixels */ panelWidth?: number; panelHeight?: number; defaultModel?: string; defaultTemperature?: number; /** Whether the assistant is currently open (persisted state) */ isOpen?: boolean; /** Theme mode */ theme?: AIAssistantTheme; /** * Currently active conversation ID */ currentConversationId?: string; } /** * Storage interface for conversation persistence */ export interface IAIAssistantStorage { /** * List all conversations * @param query - Optional search query to filter conversations * @returns Promise resolving to array of conversation metadata */ list(query?: string): Promise<IConversationMeta[]>; /** * Get a specific conversation by ID * @param id - Conversation ID * @returns Promise resolving to conversation or null if not found */ get(id: string): Promise<IConversation | null>; /** * Save or update a conversation * @param conversation - Conversation to save * @returns Promise resolving when save is complete */ save(conversation: IConversation): Promise<void>; /** * Delete a conversation * @param id - Conversation ID to delete * @returns Promise resolving when delete is complete */ delete(id: string): Promise<void>; /** * Clear all conversations * @returns Promise resolving when clear is complete */ clear?(): Promise<void>; /** * Get global settings * @returns Promise resolving to global settings or null if not set */ getGlobalSettings(): Promise<IGlobalSettings | null>; /** * Save global settings * @param settings - Global settings to save * @returns Promise resolving when save is complete */ saveGlobalSettings(settings: Partial<IGlobalSettings>): Promise<void>; /** * Close the storage (for cleanup, if needed) */ close?(): Promise<void>; }