import type { Editor, JSONContent } from '@tiptap/core'; /** * Language option for code blocks */ export interface ILanguageOption { value: string; label: string; } /** * Selection information */ export interface ISelectionInfo { selectedText: string; markdownSyntax: string; nodeType: string; marks: string[]; from?: number; to?: number; } /** * Toolbar display mode * - 'fixed': Fixed toolbar at the top of the editor (default) * - 'hidden': No toolbar displayed * - 'floating': Floating toolbar appears near cursor/selection */ export type ToolbarMode = 'fixed' | 'hidden' | 'floating'; /** * Main editor props */ export interface IMarkdownEditorProps { value?: string; onChange?: (value: string) => void; initialContent?: string; onMarkdownChange?: (markdown: string) => void; editable?: boolean; enableMermaid?: boolean; enableImage?: boolean; enableTable?: boolean; enableCodeBlock?: boolean; enableLink?: boolean; publicImagePathPrefix?: string; mermaidLib?: unknown; className?: string; style?: React.CSSProperties; onBlur?: () => void; onFocus?: () => void; onContentChange?: (content: JSONContent) => void; onSelectionChange?: (selectionInfo: ISelectionInfo | null) => void; onEditorReady?: (editor: Editor) => void; /** * Callback to handle image file selection or drop/paste. * Returns a URL (persistent or blob:) to be used in the markdown image node. */ onImageSourceSelect?: (file: File) => string | Promise; extensions?: unknown[]; supportedLanguages?: ILanguageOption[]; showSyntaxStatus?: boolean; /** @deprecated Use toolbarMode instead */ showToolbar?: boolean; /** * Toolbar display mode (default: 'fixed') * - 'fixed': Fixed toolbar at the top * - 'hidden': No toolbar * - 'floating': Floating toolbar near selection */ toolbarMode?: ToolbarMode; enableVerticalScroll?: boolean; autoHeight?: boolean; showDownloadButton?: boolean; downloadFilename?: string; showPasteDebug?: boolean; debug?: boolean; } /** * Interface for exposing internal editor functionality to the host application */ export interface IMarkdownEditorRef { /** * Returns the current markdown content of the editor. */ getMarkdown: () => string; /** * Returns a map of blob: URLs and their associated File objects that have not been uploaded yet. */ getPendingFiles: () => Map; /** * Uploads all pending images using the provided function and replaces blob: URLs with the returned URLs. * Returns the updated markdown content. */ finalizeImages: (uploadFn: (file: File) => Promise) => Promise; } /** * i18n translation keys (for external i18n systems) * Use these keys with your i18n library (e.g., react-i18next, next-i18n) */ export declare const I18N_KEYS: { readonly placeholder: "markdown_editor.placeholder"; readonly deleteButton: "markdown_editor.delete_button"; readonly renderButton: "markdown_editor.render_button"; readonly cancelButton: "markdown_editor.cancel_button"; readonly editSource: "markdown_editor.edit_source"; readonly downloadImage: "markdown_editor.download_image"; readonly fullscreen: "markdown_editor.fullscreen"; readonly closeFullscreen: "markdown_editor.close_fullscreen"; readonly insertTable: "markdown_editor.insert_table"; readonly insertCodeBlock: "markdown_editor.insert_code_block"; readonly insertImage: "markdown_editor.insert_image"; readonly insertLink: "markdown_editor.insert_link"; readonly bold: "markdown_editor.bold"; readonly italic: "markdown_editor.italic"; readonly strikethrough: "markdown_editor.strikethrough"; readonly code: "markdown_editor.code"; readonly heading: "markdown_editor.heading"; readonly bulletList: "markdown_editor.bullet_list"; readonly orderedList: "markdown_editor.ordered_list"; readonly blockquote: "markdown_editor.blockquote"; readonly horizontalRule: "markdown_editor.horizontal_rule"; readonly download: "markdown_editor.download"; readonly loadingEditor: "markdown_editor.loading_editor"; readonly convertingMarkdown: "markdown_editor.converting_markdown"; readonly linesCompleted: "markdown_editor.lines_completed"; readonly pasteDebugPanel: "markdown_editor.paste_debug_panel"; readonly clear: "markdown_editor.clear"; readonly type: "markdown_editor.type"; readonly content: "markdown_editor.content"; readonly result: "markdown_editor.result"; readonly openHeadingMenu: "markdown_editor.open_heading_menu"; readonly closeHeadingMenu: "markdown_editor.close_heading_menu"; readonly openDownloadMenu: "markdown_editor.open_download_menu"; readonly closeDownloadMenu: "markdown_editor.close_download_menu"; readonly exportMenuTitle: "markdown_editor.export_menu_title"; readonly exportMenuDescription: "markdown_editor.export_menu_description"; readonly markdownFile: "markdown_editor.markdown_file"; readonly saveAsMarkdownFile: "markdown_editor.save_as_markdown_file"; readonly sampleText: "markdown_editor.sample_text"; readonly insert: "markdown_editor.insert"; readonly close: "markdown_editor.close"; readonly update: "markdown_editor.update"; readonly link: { readonly open: "markdown_editor.link.open"; readonly edit: "markdown_editor.link.edit"; readonly linkText: "markdown_editor.link.text"; readonly url: "markdown_editor.link.url"; readonly enterLinkText: "markdown_editor.link.enter_text"; readonly urlPlaceholder: "markdown_editor.link.url_placeholder"; }; readonly syntaxStatus: { readonly help: "markdown_editor.syntax_status.help"; readonly selectedText: "markdown_editor.syntax_status.selected_text"; readonly markdownSyntax: "markdown_editor.syntax_status.markdown_syntax"; readonly styles: "markdown_editor.syntax_status.styles"; readonly nodeType: "markdown_editor.syntax_status.node_type"; }; readonly tableToolbar: { readonly confirmDeleteTable: "markdown_editor.table_toolbar.confirm_delete_table"; readonly insertRowAbove: "markdown_editor.table_toolbar.insert_row_above"; readonly insertRowBelow: "markdown_editor.table_toolbar.insert_row_below"; readonly deleteRow: "markdown_editor.table_toolbar.delete_row"; readonly insertColumnLeft: "markdown_editor.table_toolbar.insert_column_left"; readonly insertColumnRight: "markdown_editor.table_toolbar.insert_column_right"; readonly deleteColumn: "markdown_editor.table_toolbar.delete_column"; readonly mergeCells: "markdown_editor.table_toolbar.merge_cells"; readonly splitCell: "markdown_editor.table_toolbar.split_cell"; readonly toggleHeaderRow: "markdown_editor.table_toolbar.toggle_header_row"; readonly toggleHeaderColumn: "markdown_editor.table_toolbar.toggle_header_column"; readonly deleteTable: "markdown_editor.table_toolbar.delete_table"; readonly headerRow: "markdown_editor.table_toolbar.header_row"; readonly headerColumn: "markdown_editor.table_toolbar.header_column"; }; readonly tableEdgeControls: { readonly addRowAbove: "markdown_editor.table_edge_controls.add_row_above"; readonly addRowBelow: "markdown_editor.table_edge_controls.add_row_below"; readonly addColumnLeft: "markdown_editor.table_edge_controls.add_column_left"; readonly addColumnRight: "markdown_editor.table_edge_controls.add_column_right"; }; readonly table: { readonly rowOperations: "markdown_editor.table.row_operations"; readonly addRowAbove: "markdown_editor.table.add_row_above"; readonly addRowBelow: "markdown_editor.table.add_row_below"; readonly deleteRow: "markdown_editor.table.delete_row"; readonly columnOperations: "markdown_editor.table.column_operations"; readonly addColumnLeft: "markdown_editor.table.add_column_left"; readonly addColumnRight: "markdown_editor.table.add_column_right"; readonly deleteColumn: "markdown_editor.table.delete_column"; readonly deleteTable: "markdown_editor.table.delete_table"; readonly cancel: "markdown_editor.table.cancel"; }; readonly emoji: { readonly button: "markdown_editor.emoji.button"; readonly pickerTitle: "markdown_editor.emoji.picker_title"; readonly searchPlaceholder: "markdown_editor.emoji.search_placeholder"; readonly recentlyUsed: "markdown_editor.emoji.recently_used"; readonly clearRecent: "markdown_editor.emoji.clear_recent"; readonly noResults: "markdown_editor.emoji.no_results"; readonly categories: { readonly smileys: "markdown_editor.emoji.categories.smileys"; readonly people: "markdown_editor.emoji.categories.people"; readonly animals: "markdown_editor.emoji.categories.animals"; readonly food: "markdown_editor.emoji.categories.food"; readonly activities: "markdown_editor.emoji.categories.activities"; readonly travel: "markdown_editor.emoji.categories.travel"; readonly objects: "markdown_editor.emoji.categories.objects"; readonly symbols: "markdown_editor.emoji.categories.symbols"; readonly flags: "markdown_editor.emoji.categories.flags"; }; }; readonly imageToolbar: { readonly alignLeft: "markdown_editor.image_toolbar.align_left"; readonly alignCenter: "markdown_editor.image_toolbar.align_center"; readonly alignRight: "markdown_editor.image_toolbar.align_right"; readonly floatLeft: "markdown_editor.image_toolbar.float_left"; readonly floatRight: "markdown_editor.image_toolbar.float_right"; readonly sizeSmall: "markdown_editor.image_toolbar.size_small"; readonly sizeMedium: "markdown_editor.image_toolbar.size_medium"; readonly sizeLarge: "markdown_editor.image_toolbar.size_large"; readonly delete: "markdown_editor.image_toolbar.delete"; }; readonly image: { readonly button: "markdown_editor.image.button"; readonly pickerTitle: "markdown_editor.image.picker_title"; readonly urlLabel: "markdown_editor.image.url_label"; readonly urlPlaceholder: "markdown_editor.image.url_placeholder"; readonly altLabel: "markdown_editor.image.alt_label"; readonly altPlaceholder: "markdown_editor.image.alt_placeholder"; readonly insert: "markdown_editor.image.insert"; readonly chooseFile: "markdown_editor.image.choose_file"; }; }; type NestedValues = T extends string ? T : T extends Record ? { [K in keyof T]: NestedValues; }[keyof T] : never; export type I18nKey = NestedValues; /** * Emoji data structure */ export interface IEmoji { /** Emoji character (e.g., "😀") */ char: string; /** English name for search and accessibility (e.g., "grinning face") */ name: string; /** Search keywords (e.g., ["happy", "smile"]) */ keywords: string[]; /** Category ID */ category: EmojiCategory; } export type EmojiCategory = 'smileys' | 'people' | 'animals' | 'food' | 'activities' | 'travel' | 'objects' | 'symbols' | 'flags'; /** * Category metadata for display */ export interface IEmojiCategoryMeta { id: EmojiCategory; icon: string; i18nKey: string; } export {}; //# sourceMappingURL=index.d.ts.map