UNPKG

jodit-pro

Version:

PRO Version of Jodit Editor

148 lines (147 loc) 3.43 kB
import type { IJodit } from "jodit/esm/types/index"; import type { AIAssistantView, IAIAssistantProState, IConversation, IConversationMeta, IGlobalSettings, ISelectionContext, IToolCall } from "../interface/index"; /** * State Manager - reactive state management */ export declare class StateManager { private jodit; state: IAIAssistantProState; constructor(jodit: IJodit); /** * Create initial state */ private createInitialState; /** * Open panel */ open(): void; /** * Close panel */ close(): void; /** * Check if panel is open */ isOpen(): boolean; /** * Set current view */ setView(view: AIAssistantView): void; /** * Get current view */ getView(): AIAssistantView; /** * Set conversations list */ setConversations(conversations: IConversationMeta[]): void; setSavedState(savedSettings: IGlobalSettings): void; /** * Get conversations list */ getConversations(): IConversationMeta[]; /** * Set current conversation */ setCurrentConversation(conversation: IConversation | null): void; /** * Get current conversation */ getCurrentConversation(): IConversation | null; /** * Remove conversation from list */ removeConversation(conversationId: string): void; /** * Set loading state */ setLoading(isLoading: boolean): void; /** * Check if loading */ isLoading(): boolean; /** * Set error */ setError(error: string | null): void; /** * Get error */ getError(): string | null; /** * Clear error */ clearError(): void; /** * Set pending tool calls */ setPendingToolCalls(toolCalls: IToolCall[]): void; /** * Get pending tool calls */ getPendingToolCalls(): IToolCall[]; /** * Add pending tool call */ addPendingToolCall(toolCall: IToolCall): void; /** * Remove pending tool call */ removePendingToolCall(toolCallId: string): void; /** * Update tool call status */ updateToolCallStatus(toolCallId: string, status: IToolCall['status']): void; /** * Set selection contexts */ setSelectionContexts(contexts: ISelectionContext[]): void; /** * Get selection contexts */ getSelectionContexts(): ISelectionContext[]; /** * Add selection context */ addSelectionContext(context: ISelectionContext): void; /** * Remove selection context by index */ removeSelectionContext(index: number): void; /** * Clear all selection contexts */ clearSelectionContexts(): void; /** * Set abort controller */ setAbortController(controller: AbortController | null): void; /** * Get abort controller */ getAbortController(): AbortController | null; /** * Set message being edited */ setEditingMessageId(messageId: string | null): void; /** * Get message being edited */ getEditingMessageId(): string | null; /** * Check if editing a message */ isEditingMessage(): boolean; /** * Clear editing state */ clearEditingMessage(): void; /** * Reset state to initial */ reset(): void; /** * Destroy state manager */ destruct(): void; }