import { Fragment, type Node as PMNode, Slice } from 'prosemirror-model'; import { type EditorMention } from './mention'; export interface EditorDocDetails { /** Round-trippable markup — `"check @[DataTable](component:data-table)"`. */ markup: string; /** Plain text with each label inlined behind its trigger. */ text: string; /** Document order; duplicates preserved. */ mentions: EditorMention[]; /** No mentions, and text that trims to `""`. */ empty: boolean; } /** Inline content for a plain string — newlines become hard breaks. */ export declare function inlineFragmentFromText(text: string): Fragment; /** * Parses the markup dialect into a document. Called only for `value` / * `defaultValue` — never for typed or pasted input, so ordinary prose that * happens to contain `@[…](…)` stays literal while it is being written. */ export declare function docFromMarkup(markup: string): PMNode; /** A document holding a plain string, with no markup interpretation at all. */ export declare function docFromText(text: string): PMNode; /** Everything the host needs from a document, in one walk. */ export declare function deriveDocDetails(doc: PMNode): EditorDocDetails; /** The `text/plain` clipboard flavour for a copied range. */ export declare function textFromFragment(fragment: Fragment): string; export declare function serializeMarkup(doc: PMNode): string; export declare function serializeText(doc: PMNode): string; /** * The length of the derived text, without building it. Read on every * transaction by the `maxLength` filter, which only ever wanted the number. */ export declare function textLength(doc: PMNode): number; /** * The emptiness predicate, without building the markup and the mention list * `deriveDocDetails` would. Read by the placeholder decoration on every state * change, so it walks only as far as the first piece of content. * * Equivalent to `deriveDocDetails(doc).empty`: the concatenated text trims to * `""` exactly when every text node does, and a hard break contributes only a * newline. */ export declare function isDocEmpty(doc: PMNode): boolean; /** * Collapses a pasted slice to the inline content this schema allows: block * boundaries become hard breaks, mentions survive with their ids, everything * else arrives as text because the schema has nowhere else to put it. */ export declare function flattenToInlineSlice(slice: Slice): Slice; //# sourceMappingURL=markup.d.ts.map