/** * Description cell → the Editor.js value that the services expect (§ 5.7). * * A description is stored as rows of columns of blocks. A cell becomes exactly * one row with one column; the blocks inside it come from the text. */ export interface EditorBlock { id: string; type: 'paragraph' | 'raw'; data: { text: string; } | { html: string; }; } export interface EditorRow { id: string; size: 1; className: 'md:grid-cols-1'; columns: [ { id: string; size: 1; data: { time: number; version: string; blocks: EditorBlock[]; }; } ]; } /** What the converter takes from the outside, so that it stays a pure function. */ export interface DescriptionDeps { /** The time to write in the editor value, in milliseconds (`Clock.now()`). */ now: number; /** SHA-256 of a text as 64 hexadecimal digits. */ sha256Hex: (text: string) => string; } /** The Editor.js version written into the value. */ export declare const EDITOR_VERSION = "2.31.0"; /** * Converts the text of a description cell (trimmed, not escaped by * `prepareText`: `description` is exempt). * * - HTML becomes one `raw` block as it is; the service sanitizes it. HTML is * not converted to headings or lists. * - Plain text is escaped (`&`, `<`, `>`) because the storefront renders the * text of a paragraph as HTML. Blank-line-separated paragraphs become one * block each. * * The ids come from the text (the first 8 digits of its SHA-256), so the same * text gives the same value. A blank text gives `null`: not provided. */ export declare function descriptionToRows(text: string, deps: DescriptionDeps): EditorRow[] | null;