import { BlockNoteEditor } from '@blocknote/core'; /** * 檢查 Element 是否是 Legacy 版本的 HTML * 有兩種輸出 html 的方式 editor.blocksToHTMLLossy 和 editor.blocksToFullHTML * 目前用 blocksToHTMLLossy ,但要兼容舊版本的 editor.blocksToFullHTML * 檢查 class 是不是已 bn- 開頭 * @param element * @returns boolean */ export declare const isLegacy: (element: HTMLElement) => boolean; export declare const getEleClassName: (element: HTMLElement) => string; export declare const toFlexAlign: (align: 'center' | 'start' | 'left' | 'right' | '' | undefined | null) => "center" | "start" | "left" | "end"; /** * 將 editor 內容序列化為 HTML 字串 * * 重要:序列化過程若拋錯(例如 custom block 的 renderToDOMSpec 在 view 尚未掛載時 * 直接 throw),不再吞掉錯誤回傳空字串,而是往上拋交由呼叫端處理。過去「錯誤回 ''」 * 會讓任何序列化失敗都變成「成功存進空字串」,直接覆蓋掉原本的內容造成資料遺失。 */ export declare function getEditorHtml(editor: BlockNoteEditor, escape?: boolean): Promise;