Reference
High-signal exports from markloom. Types are in the package .d.ts.
mdToDoc(md: string): Doc
docToMd(doc: Doc): string
apply(doc: Doc, step: Step | Step[]): Doc
invert(step: Step): Step
// constructors — insertText, deleteText, replaceNode, spliceChildren, …
See Steps.
nodeAt(doc, path)
pathOfId(doc, id)
buildIdIndex(doc)
resolve(doc, path)
appendText(doc, id, text): Step
rewriteNode(doc, id, node): Step
insertAfter(doc, id, nodes): Step
diffById(before, after): BlockDiff[]
createHistory(doc)
commit(history, steps)
amend(history, steps) // grow last commit (AI stream)
undo(history)
redo(history)
mapPosition(step, pos)
// rebase batch helpers used by collab client
rebaseStepsThrough / rebaseBatchOver / …
docStats(doc) // { chars, words, blocks }
outline(doc) // TOC entries from headings
Schema meta-bounds (depth, type budget) and invariants gate commits.
Invalid structures fail closed rather than silently corrupting the tree.