packages/document-api/src/contract/*.
Document API is currently alpha and subject to breaking changes.
Browse by namespace
Available operations
The tables below are grouped by namespace.Core
| Operation | API member path | Description |
|---|---|---|
find | editor.doc.find(…) | Search the document for nodes matching type, text, or attribute criteria. |
getNode | editor.doc.getNode(…) | Retrieve a single node by target position. |
getNodeById | editor.doc.getNodeById(…) | Retrieve a single node by its unique ID. |
getText | editor.doc.getText(…) | Extract the plain-text content of the document. |
info | editor.doc.info(…) | Return document metadata including revision, node count, and capabilities. |
insert | editor.doc.insert(…) | Insert text or inline content at a target position. |
replace | editor.doc.replace(…) | Replace content at a target position with new text or inline content. |
delete | editor.doc.delete(…) | Delete content at a target position. |
Capabilities
| Operation | API member path | Description |
|---|---|---|
capabilities.get | editor.doc.capabilities() | Query runtime capabilities supported by the current document engine. |
Create
| Operation | API member path | Description |
|---|---|---|
create.paragraph | editor.doc.create.paragraph(…) | Create a new paragraph at the target position. |
create.heading | editor.doc.create.heading(…) | Create a new heading at the target position. |
Format
| Operation | API member path | Description |
|---|---|---|
format.apply | editor.doc.format.apply(…) | Apply explicit inline style changes (bold, italic, underline, strike) to the target range using boolean patch semantics. |
format.fontSize | editor.doc.format.fontSize(…) | Set or unset the font size on the target text range. Pass null to remove. |
format.fontFamily | editor.doc.format.fontFamily(…) | Set or unset the font family on the target text range. Pass null to remove. |
format.color | editor.doc.format.color(…) | Set or unset the text color on the target text range. Pass null to remove. |
format.align | editor.doc.format.align(…) | Set or unset paragraph alignment on the block containing the target. Pass null to reset to default. |
format.bold | editor.doc.format.bold(…) | Convenience alias for format.apply with inline.bold: true. |
format.italic | editor.doc.format.italic(…) | Convenience alias for format.apply with inline.italic: true. |
format.underline | editor.doc.format.underline(…) | Convenience alias for format.apply with inline.underline: true. |
format.strikethrough | editor.doc.format.strikethrough(…) | Convenience alias for format.apply with inline.strike: true. |
Lists
| Operation | API member path | Description |
|---|---|---|
lists.list | editor.doc.lists.list(…) | List all list nodes in the document, optionally filtered by scope. |
lists.get | editor.doc.lists.get(…) | Retrieve a specific list node by target. |
lists.insert | editor.doc.lists.insert(…) | Insert a new list at the target position. |
lists.setType | editor.doc.lists.setType(…) | Change the list type (ordered, unordered) of a target list. |
lists.indent | editor.doc.lists.indent(…) | Increase the indentation level of a list item. |
lists.outdent | editor.doc.lists.outdent(…) | Decrease the indentation level of a list item. |
lists.restart | editor.doc.lists.restart(…) | Restart numbering of an ordered list at the target item. |
lists.exit | editor.doc.lists.exit(…) | Exit a list context, converting the target item to a paragraph. |
Comments
| Operation | API member path | Description |
|---|---|---|
comments.create | editor.doc.comments.create(…) | Create a new comment thread (or reply when parentCommentId is given). |
comments.patch | editor.doc.comments.patch(…) | Patch fields on an existing comment (text, target, status, or isInternal). |
comments.delete | editor.doc.comments.delete(…) | Remove a comment or reply by ID. |
comments.get | editor.doc.comments.get(…) | Retrieve a single comment thread by ID. |
comments.list | editor.doc.comments.list(…) | List all comment threads in the document. |
Track Changes
| Operation | API member path | Description |
|---|---|---|
trackChanges.list | editor.doc.trackChanges.list(…) | List all tracked changes in the document. |
trackChanges.get | editor.doc.trackChanges.get(…) | Retrieve a single tracked change by ID. |
trackChanges.decide | editor.doc.trackChanges.decide(…) | Accept or reject a tracked change (by ID or scope: all). |
Query
| Operation | API member path | Description |
|---|---|---|
query.match | editor.doc.query.match(…) | Deterministic selector-based search with cardinality contracts for mutation targeting. |
Mutations
| Operation | API member path | Description |
|---|---|---|
mutations.preview | editor.doc.mutations.preview(…) | Dry-run a mutation plan, returning resolved targets without applying changes. |
mutations.apply | editor.doc.mutations.apply(…) | Execute a mutation plan atomically against the document. |

