import { MentionFeed, MentionFeedObjectItem, EditorConfig, ClassicEditor } from 'ckeditor5'; export { MentionFeedObjectItem } from 'ckeditor5'; import * as _angular_core from '@angular/core'; import { OnDestroy } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; type SdMiniEditorOutputFormat = 'html' | 'markdown'; interface SdMiniEditorMentionConfig { /** Feed data cho mention - có thể là array hoặc function trả về Promise * CKEditor MentionFeed đã hỗ trợ: marker, minChars, dropdownLimit, itemRenderer */ feeds?: MentionFeed[]; /** Custom render function cho giá trị mention khi chèn vào editor * Trả về object với text và các attributes tùy chỉnh */ valueRender?: (item: MentionFeedObjectItem) => { text: string; attributes?: Record; }; } type SdMiniEditorMentionItem = MentionFeedObjectItem & { data?: T; }; interface SdMiniEditorOption { /** Output format: 'html' hoặc 'markdown' (mặc định: 'html') */ outputFormat?: SdMiniEditorOutputFormat; /** Placeholder text */ placeholder?: string; /** Chiều cao editor (mặc định: auto) */ height?: string; /** Chiều cao tối đa của editor (ví dụ: '300px') */ maxHeight?: string; /** Bật/tắt mention plugin */ enableMention?: boolean; /** Cấu hình mention */ mentionConfig?: SdMiniEditorMentionConfig; /** Callback khi nội dung thay đổi */ onChange?: (content: string) => void; /** Callback khi blur */ onBlur?: (event: FocusEvent) => void; /** Callback khi focus */ onFocus?: (event: FocusEvent) => void; /** Callback khi mention được chọn */ onMentionSelect?: (item: SdMiniEditorMentionItem) => void; } type SdMiniEditorConfig = EditorConfig & { getOption?: () => SdMiniEditorOption; }; /** * Component sd-mini-editor - Editor đơn giản cho comment input * Sử dụng CKEditor với chế độ đơn giản (bold, italic, link) * Hỗ trợ mention và output format (html/markdown) * * @example * ```html * * * ``` */ declare class SdMiniEditor implements ControlValueAccessor, OnDestroy { #private; /** Cấu hình option cho editor */ option: SdMiniEditorOption; get maxEditorHeight(): string | undefined; /** NgModel binding - nội dung HTML/Markdown */ value: string; readonly valueChange: _angular_core.OutputEmitterRef; /** Event emitter khi content thay đổi */ readonly contentChange: _angular_core.OutputEmitterRef; /** Event emitter khi blur */ readonly blur: _angular_core.OutputEmitterRef; /** Event emitter khi focus */ readonly focus: _angular_core.OutputEmitterRef; /** Disabled state */ readonly disabled: _angular_core.InputSignal; Editor: typeof ClassicEditor; get editorConfig(): SdMiniEditorConfig; constructor(); ngOnDestroy(): void; /** * Xử lý khi editor ready */ onReady(editor: ClassicEditor): void; /** * Set nội dung cho editor */ setContent(content: string): void; /** * Get nội dung từ editor */ getContent(): string; /** * Get nội dung HTML gốc (không convert) */ getHtmlContent(): string; /** * Focus vào editor */ focusEditor(): void; /** * Insert mention vào vị trí con trỏ hiện tại */ insertMention(item: { id: string; name: string; marker?: string; }): void; /** * Get danh sách mentions trong nội dung */ getMentions(): { id: string; name: string; marker: string; }[]; /** * ControlValueAccessor: Write value */ writeValue(value: string): void; /** * ControlValueAccessor: Register change callback */ registerOnChange(fn: (value: string) => void): void; /** * ControlValueAccessor: Register touched callback */ registerOnTouched(fn: () => void): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { SdMiniEditor }; export type { SdMiniEditorConfig, SdMiniEditorMentionConfig, SdMiniEditorMentionItem, SdMiniEditorOption, SdMiniEditorOutputFormat };