import type { RayEditorOptions } from './types/options'; import type { RayPlugin, RayEditorInstance, ButtonConfig, SlashCommandConfig, CommandHandler, EventHandler } from './types/plugin'; export declare class RayEditor implements RayEditorInstance { private container; readonly editorElement: HTMLElement; readonly toolbarElement: HTMLElement; private wrapper; private options; private eventBus; private selectionManager; private commandManager; private contentManager; private historyManager; private toolbarManager; private formattingFeature; private codeBlockFeature; private linkFeature; private tableFeature; private youtubeFeature; private imageFeature?; private fileFeature?; private mentionsFeature?; private slashCommandFeature?; private findReplaceFeature?; private wordCountFeature?; private fullscreenFeature?; private markdownShortcutsFeature?; private emojiFeature?; private markdownFeature; private taskListFeature; private calloutFeature; private specialCharsFeature; private fontSizeFeature; private pluginManager; private isSourceMode; private _autoSaveTimer; private sourceTextarea; private isReadOnly; private destroyed; private toolbarIndex; /** * Create a new RayEditor instance. * @param containerId - ID of the container element, or ID of content element when contentId is used * @param options - Editor options * @param contentId - (Optional) ID of existing content element to convert */ constructor(containerId: string, options?: RayEditorOptions, contentId?: string | null); /** Get cleaned HTML content (works in both rich text and markdown mode) */ getContent(): string; /** Set HTML content */ setContent(html: string): void; getRayEditorContent(): string; setRayEditorContent(html: string): void; /** Register a custom command */ registerCommand(name: string, handler: CommandHandler): void; /** Execute a command by name */ execCommand(name: string, value?: string): void; /** Add a toolbar button (from plugin) */ addButton(config: ButtonConfig): void; /** Remove a toolbar button */ removeButton(name: string): void; /** Register a slash command */ registerSlashCommand(cmd: SlashCommandConfig): void; /** Subscribe to an event */ on(event: string, handler: EventHandler): void; /** Unsubscribe from an event */ off(event: string, handler: EventHandler): void; /** Emit an event */ emit(event: string, data?: unknown): void; /** Also expose as addEventListener for backward compat */ addEventListener(event: string, callback: EventListener): void; /** Install a plugin */ use(plugin: RayPlugin): this; /** Set read-only mode */ setReadOnly(readOnly: boolean): void; /** Set theme */ setTheme(theme: 'light' | 'dark'): void; /** Get word count */ getWordCount(): { words: number; chars: number; }; /** Download the editor content as an HTML file */ exportHtml(filename?: string): void; /** Download the editor content as a plain-text file */ exportText(filename?: string): void; private _downloadBlob; /** Destroy the editor and clean up all resources */ destroy(): void; private dispatchCommand; private bindEditorEvents; private insertHr; private insertDateTime; private toggleSourceMode; /** * BUG FIX #4 & #5: Custom modal to replace native confirm()/alert() */ private showConfirmModal; private addWatermark; private injectCSS; private applyToolbarType; private buildEditorArea; /** * Normalize legacy v1 flat options into v2 format. * Preserves full backward compatibility. */ private normalizeOptions; private resolveImageUploadOpts; private resolveFileUploadOpts; private resolveMentionOpts; } //# sourceMappingURL=RayEditor.d.ts.map