/** * The object form of a `markdown` beat: an optional frame (`header` / `sidebar-left`) around * exactly one main (`content` / `row-2` / `2x2`). * * Every slot is `string | string[]`, and the renderer joins an array with "\n", so the two * forms render identically — which is why editing a slot as text is safe as long as the form * it was authored in is written back. */ export type MarkdownSlot = string | string[]; /** The mains, in the order the editor offers them. Exactly one is present on a valid layout. */ export declare const MAIN_KINDS: readonly ["content", "row-2", "2x2"]; export type MainKind = (typeof MAIN_KINDS)[number]; /** How many slots each main carries. */ export declare const SLOT_COUNT: Record; /** What each slot is called, from the schema's own comments on the tuples. */ export declare const SLOT_LABELS: Record; export declare const FRAME_KEYS: readonly ["header", "sidebar-left"]; export type FrameKey = (typeof FRAME_KEYS)[number]; /** The layout form, as opposed to a plain string or array of lines. Carrying a main is what identifies it. */ export declare const isMarkdownLayout: (value: unknown) => value is Record; /** The main this layout carries. A malformed one with several resolves in MAIN_KINDS order. */ export declare const mainKindOf: (layout: Record) => MainKind; /** Every slot of the main, padded to the count the main declares. */ export declare const slotsOf: (layout: Record) => unknown[]; /** A slot as one block of text — the same join the renderer applies to an array. */ export declare const slotText: (slot: unknown) => string; /** Text written back in the form the slot already had, so an authored array stays an array. */ export declare const writeSlot: (current: unknown, text: string) => MarkdownSlot; export declare const setSlot: (layout: Record, index: number, text: string) => Record; /** An empty frame field is absent rather than empty: both are optional in the schema. */ export declare const setFrame: (layout: Record, key: FrameKey, text: string) => Record; /** * The same layout under a different main, carrying the text across. * * Widening pads with empty slots; narrowing to `content` joins what there was, since dropping * the text of a slot that no longer exists would lose the author's writing silently. */ export declare const switchMain: (layout: Record, kind: MainKind) => Record; /** The string form as a layout. Always safe: the text becomes the one slot `content` holds. */ export declare const toLayout: (markdown: unknown) => Record; /** * Whether going back to the string form would lose nothing. * * Only a bare `content` qualifies — a frame or a multi-slot main has nowhere to go in a * string, so the editor does not offer the conversion rather than performing it quietly. */ export declare const isLosslessToString: (layout: Record) => boolean;