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<ReviseEditorToolExecutionResult>
Options: { documentId?, directMode? }.
Promise<Blob>
number
number

toolbar

ReviseToolbarState
Live selection formatting, block type, undo/redo availability, and review counts.
void
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.

Convenience

Shorthands that route to the active document unless given an ID: