API member directory
Find every public editing API class, member group, enum, support type, and host extension.
Use this directory to find task examples and runtime limits for the public API. The generated API reference provides exact declarations, overloads, and enum values. The repository also publishes generated declarations for the root entry, the browser entry, and the agent entry.
A declaration or enum value does not guarantee runtime support for every document or argument. Read the linked guide before choosing an operation. Members marked @internal, including factories and hydration helpers, are not supported application APIs. Obtain model objects from context.document; do not construct them.
Runtime and common members
| Public symbol | Members or values | Guide |
|---|---|---|
DocxEditor, DocxEditorNamespace | createServer, createCollaborative; browser entry adds createBrowser | Runtime and setup |
DocxEditorRuntime, DocxEditorServerRuntime | capabilities, the three run overloads (callback, objects and callback, options and callback), preview (browser runtime only), dispose; server adds save | Runtime and setup |
DocumentPreview, DocumentPreviewStatus, PreviewCallback, CommitPreviewOptions | status (active, stale, ended), result, commit with optional rebase, discard, reveal, onStatusChanged | Preview other wording before you write it |
RunOptions, HistoryGroup, HistoryGroupOutcome | historyGroup (browser runtime only), previousObjects; the editor history group handle's state, lastOutcome, and end | Join an editor history group |
CreateServerOptions, CreateCollaborativeOptions, CreateBrowserOptions | Author, revision view, host-specific parsing, modules, and pagination | Runtime and setup |
DocumentCapabilities | document, save, events, selection, scrolling, layout, preview | Runtime and setup |
DocumentLimits, DocumentZipLimits, DocumentXmlLimits, EditorModule, RuntimeDiagnostic | Input budgets, DOM-free module contributions, and the anonymous diagnostics a module with onDiagnostic receives | Runtime and setup |
ServerPaginationOptions | measurer, optional producer | Fields and pagination |
RequestContext, RunCallback | document, capabilities, trackedObjects, sync and async callback result | Batching, loading, and errors |
ClientObject | Inherited context, isNullObject, and load | Batching, loading, and errors |
ClientResult | value, isLoaded; returned by RevisionCollection.resolve() and setAuthor() | Batching, loading, and errors |
TrackedObjects | add, remove, each accepting one object or an array | Batching, loading, and errors |
LoadOption, LoadQueryOptions | Explicit property names and items/<property> paths on collections; select, top, skip; reserved expand | Batching, loading, and errors |
DocxEditorError, DocxEditorErrorInit, DocxEditorErrorCode, DocxEditorDebugInfo, DocxEditorInnerError, isDocxEditorError | Stable error codes, target, resource limit, revision metadata, and debugInfo with the engine reason as innerError | Batching, loading, and errors |
Agent helpers
The @docx-editor.dev/editor-api/agent entry holds helpers next to the object model. They are not Office.js members. They use only the Office.js-shaped calls of the object model on the context and paragraph that you pass in.
| Public symbol | Members or values | Guide |
|---|---|---|
prepareRewrite | Read a paragraph for your model; PrepareRewriteOptions takes keepPlaceholders | Propose an AI rewrite as tracked changes |
RewriteDraft, RewriteResult, RewritePlaceholder, RewritePlaceholderKind | Plain data: paragraphId, original, text, placeholders, and legend on a draft, with check() and apply() for the model text; original, proposed, changes, and paragraphId on a result | Propose an AI rewrite as tracked changes |
RewriteError, RewriteErrorCode | code, isModelError, cause, suppressed | Handle errors |
Document and text objects
Every model object inherits the common ClientObject members. Each collection also exposes loaded, read-only items.
| Object | Public members beyond inherited members | Guide |
|---|---|---|
Document | removeDocumentInformation, properties, body, paragraphs, sections, contentControls, comments, revisions, footnotes, endnotes, changeTrackingMode, deleteBookmark, getBookmarkRange, getBookmarkRangeOrNullObject | Text and ranges, Page layout and stories, Tracked changes, Search and navigation |
RemoveDocInfoType | All standard enum values; only documentProperties removal is supported | Remove document properties |
DocumentProperties | author, title, subject, keywords, comments, category, read-only lastAuthor | Document properties |
Body | text, footnotes, endnotes, paragraphs, getRange, search, clear, insertText, insertParagraph; font, style, lists, bookmarks, contentControls, getComments, revisions, tables, inlinePictures, shapes, fields | Text and ranges, Page layout and stories |
Paragraph | text, uniqueLocalId, getRange, getTextRanges, getReviewedText, contentControls, search, insertText, insertParagraph, split, clear, delete; font, style, paragraph formatting; list, listItem, startNewList, attachToList, detachFromList; shapes | Text and ranges, Formatting and styles, Lists and numbering |
Range | text, paragraphs, getRange, getTextRanges, expandTo, getReviewedText, contentControls, search, insertText, insertParagraph, clear, delete, select; font, style, hyperlink, bookmarks, getBookmarks, revisions, tables, inlinePictures, fields; insertTable, insertInlinePictureFromBase64, insertField, insertOoxml (one equation), insertBreak, insertContentControl, insertComment, insertBookmark | Text and ranges and the dedicated insertion guides |
ParagraphCollection | getFirst, getLast, getFirstOrNullObject, getLastOrNullObject | Search and navigation |
RangeCollection | getFirst, getLast, getFirstOrNullObject | Search and navigation |
Bookmark, BookmarkCollection | Bookmark name, range, select, delete; collection items | Search and navigation |
SearchOptions, SelectionMode | Plain-text search flags and browser selection locations | Search and navigation |
InsertLocation, BesideLocation, BodyInsertParagraphLocation, BodyInsertTextLocation, ParagraphInsertTextLocation, RangeInsertTextLocation | Insertion location enums and aliases | Text and ranges |
RangeLocation | getRange location values | Text and ranges |
Formatting, lists, tables, and pictures
Font writes honor inherited complex-script properties. Font reads return authored values or null; they do not resolve inherited formatting.
| Object or type | Public members beyond inherited members | Guide |
|---|---|---|
Font | bold, italic, color, name, size, underline, strikeThrough, highlightColor, subscript, superscript | Formatting and styles |
Paragraph formatting | alignment, firstLineIndent, leftIndent, rightIndent, lineSpacing, spaceBefore, spaceAfter, readingOrder (DocxEditor addition) | Formatting and styles, including right-to-left paragraphs |
UnderlineType, Alignment, ParagraphAlignment, ParagraphReadingOrder | Font underline, paragraph alignment, and paragraph direction values | Formatting and styles |
List | id, paragraphs, getLevelParagraphs, insertParagraph, setLevelBullet, setLevelNumbering, setLevelStartingNumber, setLevelIndents | Lists and numbering |
ListCollection, ListItem | Collection getFirst, getById; item level | Lists and numbering |
ListBullet, ListNumbering | Bullet and number marker values | Lists and numbering |
Table | values, style, headerRowCount, rowCount, columnCount, rows, getCell, addRows, addColumns, deleteRows, deleteColumns, mergeCells, delete | Tables and cells |
TableRow, TableCell | Row cells, insertRows; cell body, value, columnWidth, shadingColor, verticalAlignment, split | Tables and cells |
TableCollection, TableRowCollection, TableCellCollection | getFirst, getFirstOrNullObject | Tables and cells |
VerticalAlignment | Cell alignment values | Tables and cells |
InlinePicture | width, height, lockAspectRatio, altTextDescription, delete | Inline pictures |
InlinePictureCollection | getFirst, getLast, getFirstOrNullObject, getLastOrNullObject | Inline pictures |
Shape, ShapeCollection, ShapeType | Shape id, name, type, body; collection getFirst, getFirstOrNullObject, getByTypes; shape type values | Page layout and stories |
Fields, stories, and controls
Range.insertContentControl() creates RichText, PlainText, and DatePicker controls.
Range.insertBreak() supports Line, Page, and SectionNext. Only Line supports tracked insertion and text edits in the same sync. Text reads use \v for manual line breaks and U+000E for column breaks. For migration instructions, see Upgrade text processing.
| Object or type | Public members beyond inherited members | Guide |
|---|---|---|
Field, FieldCollection | Field code, result (a Range that reads text and takes insertText(text, 'Replace')), updateResult, delete; collection getFirst, getLast, getFirstOrNullObject, getLastOrNullObject | Fields and pagination |
FieldType, FieldTypeLiteral | Office.js-compatible field vocabulary; authoring supports Page, NumPages, Ref, PageRef, NoteRef, Seq, StyleRef, Date, Time, and the documented inert TOC subset, untracked or as tracked insertions | Fields and pagination |
Section, SectionCollection | Section body, pageSetup, getHeader, getFooter, getNext; collection getFirst | Page layout and stories |
PageSetup | pageWidth, pageHeight, orientation, topMargin, bottomMargin, leftMargin, rightMargin | Page layout and stories |
HeaderFooterType, PageOrientation, BreakType | Story variants, orientation, and break vocabulary | Page layout and stories |
NoteItem, NoteItemCollection, NoteItemType | Note type, text, body, delete, getNext; collection getFirst; note kind values | Page layout and stories |
ContentControl | id, tag, title, subtype, isBound, cannotDelete, cannotEdit, placeholderShown, temporary, text, paragraphs, contentControls, getRange, setValue, insertText, delete | Content controls |
ContentControlCollection | getFirst, getFirstOrNullObject, getById, getByTag, getByTitle | Content controls |
ContentControlType, ContentControlSubtype, ContentControlValue, ContentControlLockState | Creation vocabulary, DOCX subtype terms, typed values, and lock vocabulary | Content controls |
Comments and revisions
Comment.delete() and CommentReply.delete() use scan budgets that scale with the loaded document. Deletions in one batch share marker scans and rebuild each affected part once. See Delete threads or replies for deletion guarantees and limits.
Document.changeTrackingMode = 'TrackMineOnly' tracks supported text, font, paragraph, list, table, and content control edits. Column changes require an eligible complete proposed table. Page setup refuses while tracking. For supported operations and collaboration limits, see Tracked changes.
| Object or type | Public members beyond inherited members | Guide |
|---|---|---|
Comment | authorName, creationDate, id, text, delete, resolved, replies, getRange, reply | Comments |
CommentReply | authorName, creationDate, id, text, delete | Comments |
CommentCollection, CommentReplyCollection | getFirst | Comments |
Revision | author, date, type, range, accept, reject | Tracked changes |
RevisionCollection | resolve, setAuthor, acceptAll, rejectAll | Tracked changes |
getReviewItemRevisions, getReviewItemRange, getReviewItemRangeOrNullObject | DocxEditor functions that return the changes a review item key names, or the range it covers | Work with review items |
ChangeTrackingMode, ChangeTrackingVersion, RevisionTextView, RevisionType | Runtime tracking modes, getReviewedText versions, read views, and published revision types | Tracked changes |
Distinguish host extensions from Office.js compatibility
Host factories, runtime capabilities, previews, input budgets, and collaboration setup are DocxEditor infrastructure. They do not represent Microsoft Office add-in APIs. Review item ranges, body-scoped bookmarks and revisions, document notes, typed control values, and nullable review dates include documented differences.
External document refresh
The refresh controller belongs to the browser host, outside the Office.js document model. RefreshHighlightOptions controls change selection and decoration. NavigateToChangeOptions controls scroll alignment, motion, padding, and focus. For more information, see Document refresh API.
RefreshChangeInput.description supplies a processor review summary. RefreshChange.diagnostic reports unavailable locations with stable codes and the requested anchor. Refresh resets selection and undo history. It refuses collaborative sessions.
Document properties
Document.properties returns a DocumentProperties proxy. It exposes the string properties author, title, subject, keywords, comments, and category. Load each property before reading it. Assignments commit at context.sync(). Missing properties read as empty strings. An empty assignment clears that value.
Writes preserve unrelated document properties. Values must contain XML-safe text with at most 4096 UTF-16 code units. TrackMineOnly refuses these writes with NotSupported. Individual dates and custom properties are unsupported. lastAuthor reads cp:lastModifiedBy and has no setter.
await runtime.run(async (context) => {
const properties = context.document.properties;
properties.author = 'Public Records Office';
properties.title = 'Release packet';
properties.subject = 'Public information';
properties.keywords = '';
properties.comments = '';
await context.sync();
});Collaborative writes require an existing core-properties part. If the input omits this part, set properties before joining collaboration. Concurrent creation of this package part cannot merge safely.
Remove document properties
Call document.removeDocumentInformation('DocumentProperties') to remove standard core, extended, and custom property parts. Keep this command as the only write in its sync. This also removes last-author information and property relationships. It preserves document content, comments, revisions, and media.
Ambiguous parts, incorrect roots or types, and unknown dependencies refuse with NotSupported. The method refuses all other RemoveDocInfoType modes, tracked writes, and collaboration. This subset does not anonymize text, cached field results, images, or review authors.
await runtime.run(async (context) => {
context.document.removeDocumentInformation('DocumentProperties');
await context.sync();
});Next steps
See Office.js compatibility before migrating Office.js code. The generated reference remains the declaration authority; runtime notes and tests establish supported behavior.
For integration patterns, see Connect an agent to a document.