Skip to main content
onReady hands you a ReviseEditorHandle. Keep it in a ref; every controller on it is stable for the life of the component.

Routing

Every document-local controller resolves against the active document, and every one can be bound to a specific document instead:
Scoped controllers: tools, toolbar, review, view, zoom, selection, agent, comments.

documents

Promise<ReviseDocumentHandle>
Opens and parses a document. { activate: false } loads it in the background.
boolean
boolean
ReviseDocumentHandle | null
ReviseDocumentHandle
As get, but throws instead of returning null.
string | null
ReviseOpenDocument[]
ReviseDocumentCollectionState
() => void

tools

ReviseEditorToolDefinition[]
Native document-local tool schemas, excluding the delegation tool.
Promise<ReviseToolResult<Name>>
Typed inputs from the shared tool contract; expected failures come back as { ok: false }. Options: { documentId?, directMode? }.
Promise<ReviseToolResult<string>>
Untrusted model-provided calls, browser-only tools (get_selection, view_image, revise_run_agent), and model-facing document_id routing.
Promise<ReviseToolResponse<Name>>
Returns only the successful response; throws ReviseToolError otherwise.
Promise<Blob>
ReviseSuggestionDecision
ReviseSuggestionDecision

toolbar

ReviseToolbarState
Live selection formatting, block type, undo/redo availability, and review counts.
ReviseDocumentStatistics
Live word and character counts — { wordCount, characterCount } — computed as text statistics with no layout pass, safe to call per keystroke behind a debounce. Counts follow the markup view, as Word’s do: pending insertions count and pending deletions don’t (the as-if-accepted text); in the "original" suggestion view mode, counts flip to the as-if-rejected text.
void
setActiveTab is how a host reaches the ribbon’s other rows — the SDK ships no tab strip, so wire your own controls to toolbar.setActiveTab("layout" | "insert" | "review" | "edit"). Layout carries page and section breaks. There is no Tools row in the SDK — word and character counts come from getStatistics().
Commands return false when they cannot apply. Grouped by area:

view

Title and the chrome the SDK no longer renders buttons for.
ReviseViewState
{ ready, title, documentMode, readOnly, commentsOpen, commentCount, reviewOpen, reviewTargetCount }
void
void
void
void

review

ReviseReviewState
Open state, target counts, suggestion IDs, active comment, display mode, and every comment thread.

selection

ReviseSelectionSnapshot
() => void
ReviseSelectionCapture | null
Survives focus moving into your UI. null when there is nothing addressable.
ReviseSelectionRestoreResult
Typed failure when the document changed underneath it.
void

zoom

{ zoom, scale }
void
() => void

agent

Promise<ReviseAgentRunResult>
boolean
Guidance for a run already in flight.
void
() => void

comments

Agent runs scoped to a single comment thread.
Promise<CommentAgentRunResult>
boolean
void
CommentAgentRunState | undefined
() => void
Publishes a map of every in-flight run.
ReviseTrackedChange[]
Every pending change with kind, author, authorType, createdAt, blockIds, insertedText/deletedText, and description. A pull, not part of the subscribed state; one call walks the document once. See building your own review panel.
ReviseTrackedChange | null
One change, or null once it is resolved.

collaboration

Presence and sync state for a shared document. See collaboration.
ReviseCollaborationState
{ enabled, synced, peers }. peers lists everyone in the room, including the local participant (isLocal: true), each with the color their caret is drawn in. Empty when no awareness was supplied.
() => void
Fires on join, leave, caret movement, and sync-state changes.

Convenience

Shorthands that route to the active document unless given an ID:
onReady hands you this editor before any document exists. Subscriptions are safe to place immediately — they attach when a document arrives — but anything that acts on a document throws until one is open. Wait for onDocumentReady, or await editor.whenReady().