window.fastdocShell · document
Working with the current document: opening, image export, comparison, printing. Methods: 35.
Working with the current document: opening, image export, comparison, printing. Methods on this page: 35.
Contract methods missing from the source document
Section titled “Contract methods missing from the source document”These five methods are declared in the shell contract but didn’t make it into the document the reference was compiled from. Their signatures are taken directly from the contract.
openDocxDialog(): Promise<{ canceled: boolean; path: string | null }>reloadCurrentDocx(): Promise<{ reloaded: boolean; canceled: boolean }>createA4DefaultNewDocument(): Promise<{ opened: boolean; canceled: boolean; path: string | null }>openFixture(fixtureKey: string): Promise<{ opened: boolean; canceled: boolean; path: string | null }>openCompareFixture(fixtureKey: string): Promise<{ opened: boolean }>The first three are ordinary document operations: the open dialog, re-reading the current file, and creating a new default one. The last two open samples for internal build checks and aren’t needed for embedding.
Ten more methods appeared in the contract after the document — for collaborative editing, the delta frame, and the exact page count. The signatures are also from the contract:
getPersistentDispatchIdentity(): Promise<PersistentDispatchIdentity>savePersistentRecoverySnapshot(request: { snapshotPath: string; requestId?: string }): Promise<{ sessionId: string; documentId: string; requestId: string; acceptedRevision: number; publishedRevision: number; snapshotPath: string; snapshotHash: string; dirty: boolean }>countDocumentPagesExactly(request: { path: string }): Promise<ShellExactPageCountStatus>exactPageCountStatus(request: { path: string }): Promise<ShellExactPageCountStatus>onCanonicalSceneRefreshed(callback: (event: ShellCanonicalSceneRefreshed) => void): () => voidonDocumentPatch(callback: (patch: ShellDocumentPatch) => void): () => voiddeclareRendererCapabilities(capabilities: ShellRendererCapabilities): voidnotifyDocumentPatchOutcome(outcome: ShellDocumentPatchOutcome): voidonProbeUnsavedState(callback: (request: { requestId: number }) => void): () => voidcompleteUnsavedStateProbe(result: { requestId: number; unsaved: boolean }): voidgetPersistentDispatchIdentity— five fields about whose edit is first in the queue, instead of a whole state frame; an old shell responds with a refusal, and then the page takesgetState().savePersistentRecoverySnapshot— a recovery snapshot at the given path; the response contains the accepted and published revisions and the snapshot hash.countDocumentPagesExactlyandexactPageCountStatus— count the pages exactly on a person’s request and find out how the count ended.counted: falsewith a named reason is a valid answer: the number remains an estimate.onCanonicalSceneRefreshed— the scene changed not because of this person’s action: a neighbor’s edit or a deferred read of projections after your own typing.onDocumentPatch,declareRendererCapabilities,notifyDocumentPatchOutcome— a delta frame for a neighbor’s edit instead of the whole state: the page declares that it can accept one, receives the frame, and reports whether it applied it.onProbeUnsavedStateandcompleteUnsavedStateProbe— the shell asks the page whether there is anything unsaved and gets the answer byrequestId.
Methods on this page — 20
clearCompareDocxcopyCurrentImageWorkflowImagecopyShareTextexportCurrentDocumentImagesexportCurrentImageWorkflowImagesgetCurrentDocumentTruthgetCurrentDrawingMlWorkflowgetCurrentImageWorkflowgetCurrentImageWorkflowExportPlannotifyDocumentRenderedopenCompareDocxPathopenDocxPathopenEditorV0UserCopyDialogpathExistsprepareEditorV0QuickPrintPlanreopenEditorV0TextContinueCopyselectCurrentImageWorkflowReplacementImageselectEditorV0InsertImageObjectImageselectEditorV0InsertObjectTextFileSourcewriteJsonFile
clearCompareDocx
Section titled “clearCompareDocx”clearCompareDocx(): Promise<{ cleared: boolean }>web_to_host_request_response · invoke · fastdoc-shell:clear-compare-docx · capability=document
copyCurrentImageWorkflowImage
Section titled “copyCurrentImageWorkflowImage”copyCurrentImageWorkflowImage(request?: ShellExportCurrentImageWorkflowImagesRequest): Promise<ShellCopyCurrentImageWorkflowImageResult>web_to_host_request_response · invoke · fastdoc-shell:copy-current-image-workflow-image · capability=document
copyShareText
Section titled “copyShareText”copyShareText(text: string): Promise<ShellShareClipboardResult>web_to_host_request_response · invoke · fastdoc-shell:copy-share-text · capability=document
exportCurrentDocumentImages
Section titled “exportCurrentDocumentImages”exportCurrentDocumentImages(request: ShellExportCurrentDocumentImagesRequest & { renderedCanvas: ShellSaveRenderedCanvasImagesRequest; }): Promise<ShellSaveRenderedCanvasImagesResult>exportCurrentDocumentImages(request?: ShellExportCurrentDocumentImagesRequest): Promise<ShellExportCurrentDocumentImagesResult>web_to_host_request_response · invoke · fastdoc-shell:export-current-document-images · capability=document
exportCurrentImageWorkflowImages
Section titled “exportCurrentImageWorkflowImages”exportCurrentImageWorkflowImages(request?: ShellExportCurrentImageWorkflowImagesRequest): Promise<ShellExportCurrentDocumentImagesResult>web_to_host_request_response · invoke · fastdoc-shell:export-current-image-workflow-images · capability=document
getCurrentDocumentTruth
Section titled “getCurrentDocumentTruth”getCurrentDocumentTruth(): Promise<CurrentDocumentTruthViewerData>web_to_host_request_response · invoke · fastdoc-shell:get-current-document-truth · capability=document
getCurrentDrawingMlWorkflow
Section titled “getCurrentDrawingMlWorkflow”getCurrentDrawingMlWorkflow(): Promise<Record<string, unknown>>web_to_host_request_response · invoke · fastdoc-shell:get-current-drawingml-workflow · capability=document
getCurrentImageWorkflow
Section titled “getCurrentImageWorkflow”getCurrentImageWorkflow(): Promise<Record<string, unknown>>web_to_host_request_response · invoke · fastdoc-shell:get-current-image-workflow · capability=document
getCurrentImageWorkflowExportPlan
Section titled “getCurrentImageWorkflowExportPlan”getCurrentImageWorkflowExportPlan(request?: ShellCurrentImageWorkflowExportPlanRequest): Promise<ShellCurrentImageWorkflowExportPlan>web_to_host_request_response · invoke · fastdoc-shell:get-current-image-workflow-export-plan · capability=document
notifyDocumentRendered
Section titled “notifyDocumentRendered”notifyDocumentRendered(renderedPath: string | null): voidweb_to_host_event · send · fastdoc-shell:document-rendered · capability=document
openCompareDocxPath
Section titled “openCompareDocxPath”openCompareDocxPath(path: string): Promise<{ opened: boolean; path: string }>web_to_host_request_response · invoke · fastdoc-shell:open-compare-docx-path · capability=document
openDocxPath
Section titled “openDocxPath”openDocxPath(path: string, source?: "file-menu" | "drop" | "recent" | "outline-history"): Promise<{ opened: boolean; canceled: boolean; path: string | null; reentryReceipt?: FileSessionReentryReceipt;}>web_to_host_request_response · invoke · fastdoc-shell:open-docx-path · capability=document
openEditorV0UserCopyDialog
Section titled “openEditorV0UserCopyDialog”openEditorV0UserCopyDialog(request?: { path?: string | null; }): Promise<{ canceled: boolean; path: string | null;text: string | null }>web_to_host_request_response · invoke · fastdoc-shell:open-editor-v0-user-copy-dialog · capability=document
pathExists
Section titled “pathExists”pathExists(path: string): Promise<{ path: string; exists: boolean }>web_to_host_request_response · invoke · fastdoc-shell:path-exists · capability=document
prepareEditorV0QuickPrintPlan
Section titled “prepareEditorV0QuickPrintPlan”prepareEditorV0QuickPrintPlan(request?: EditorV0QuickPrintPlanRequest): Promise<EditorV0QuickPrintPlanResult>web_to_host_request_response · invoke · fastdoc-shell:prepare-editor-v0-quick-print-plan · capability=document
reopenEditorV0TextContinueCopy
Section titled “reopenEditorV0TextContinueCopy”reopenEditorV0TextContinueCopy(request?: { outputKind?: | | "editor-v0-text-continue-commands" | "editor-v0-undo" | "editor-v0-redo" | "editor-v0-save-as-dialog" | "editor-v0-save-state" | "editor-v0-nonblocking-typing" | "editor-v0-double-space-period-autocorrect" | "editor-v0-selection-replace" | "editor-v0-selection-edit-2" | "editor-v0-selection-edit-3" | "editor-v0-selection-edit-4" | "editor-v0-save-open-loop" | "editor-v0-autosave-toggle-action" | "editor-v0-open-saved-copy-ui" | "editor-v0-multistep-undo" | "editor-v0-save-copy-shortcuts" | "editor-v0-save-copy-destination-polish" | "editor-v0-save-copy-as-user-path" | "editor-v0-quick-save-copy-action" | "editor-v0-quick-open-copy-action" | "editor-v0-quick-open-docx-action" | "editor-v0-open-user-copy-dialog" | "editor-v0-save-open-recent-copy" | "editor-v0-formatted-run-edit" | "editor-v0-formatted-selection-edit" | "editor-v0-formatted-text-tranche" | "editor-v0-formatted-selection-ui" | "editor-v0-formatted-selection-controls" | "editor-v0-run-boundary-edit" | "editor-v0-run-boundary-edit-controls" | "editor-v0-run-boundary-insert-controls" | "editor-v0-run-boundary-text-input-controls" | "editor-v0-cross-run-selection-input" | "editor-v0-paragraph-split-merge" | "editor-v0-paragraph-text-flow" | "editor-v0-paragraph-text-flow-commands" | "editor-v0-styled-paragraph-flow" | "editor-v0-styled-paragraph-merge-controls" | "editor-v0-styled-paragraph-text-after-merge" | "editor-v0-paragraph-boundary-insert" | "editor-v0-paragraph-boundary-delete-controls" | "editor-v0-user-paragraph-boundary-edit" | "editor-v0-user-paragraph-multiline-flow" | "editor-v0-styled-multiline-boundary-edit" | "editor-v0-toolbar-format-commands-bounded" | "editor-v0-toolbar-format-commands-italic-blue" | "editor-v0-home-chr-tranche2-market" | "editor-v0-font-family-size-commands" | "editor-v0-text-case-toolbar-command" | "editor-v0-format-toolbar-multi-command-chain" | "editor-v0-format-clear-command" | "editor-v0-format-clear-partial-selection" | "editor-v0-format-apply-partial-selection" | "editor-v0-mixed-format-selection-workflow" | "editor-v0-mixed-format-clear-or-paste-rules" | "editor-v0-mixed-format-paste-rules" | "editor-v0-clipboard-copy-cut-paste"; path?: string | null; transientTableEdit?: boolean; canonicalHistoryTransitionKind?: | "table-cell-semantic-undo" | "table-cell-semantic-redo"; expectedClipboardFingerprint?: string | null; expectedDocumentPath?: string | null; canonicalOwnerReceipt?: { schema: "fastdoc.persistent-save-checkpoint-receipt.v1"; sessionId: string; documentId: string; acceptedRevision: number; publishedModelHash: string; targetHash: string; targetIdentity: PublishedTargetIdentity; } | null; }): Promise<{ opened: boolean; path: string; text?: string | null }>web_to_host_request_response · invoke · fastdoc-shell:reopen-editor-v0-text-continue-copy · capability=document
selectCurrentImageWorkflowReplacementImage
Section titled “selectCurrentImageWorkflowReplacementImage”selectCurrentImageWorkflowReplacementImage(): Promise<{ canceled: boolean; path: string | null; }>web_to_host_request_response · invoke · fastdoc-shell:select-current-image-workflow-replacement-image · capability=document
selectEditorV0InsertImageObjectImage
Section titled “selectEditorV0InsertImageObjectImage”selectEditorV0InsertImageObjectImage(): Promise<{ canceled: boolean; path: string | null; }>web_to_host_request_response · invoke · fastdoc-shell:select-editor-v0-insert-image-object-image · capability=document
selectEditorV0InsertObjectTextFileSource
Section titled “selectEditorV0InsertObjectTextFileSource”selectEditorV0InsertObjectTextFileSource(): Promise<EditorV0InsertObjectTextFileSourceResult>web_to_host_request_response · invoke · fastdoc-shell:select-editor-v0-insert-object-text-file-source · capability=document
writeJsonFile
Section titled “writeJsonFile”writeJsonFile(path: string, data: unknown): Promise<{ path: string; written: boolean; bytes: number }>web_to_host_request_response · invoke · fastdoc-shell:write-json-file · capability=document