Перейти к содержимому
FastOffice

События между приложением и редактором

Полный перечень: семь событий от приложения к редактору и одиннадцать обратно, с сигнатурой и именем канала.

onDocumentSessionSnapshot(callback: (snapshot: ShellDocumentSessionSnapshot) => void): () => void

Канал: fastdoc-shell:document-session-snapshot

onMenuCommand(callback: (command: MenuCommand) => void): () => void

Канал: fastdoc-shell:menu-command

onSaveBeforeClose(callback: () => void): () => void

Канал: fastdoc-shell:save-before-close

onSaveBeforeCloseFailed(callback: (payload: { message: string }) => void): () => void

Канал: fastdoc-shell:save-before-close-failed

onSaveBeforeDocumentSwitch(callback: (request: { requestId: number }) => void): () => void

Канал: fastdoc-shell:save-before-document-switch

onStateChanged(callback: (state: ShellBridgeState) => void): () => void

Канал: fastdoc-shell:state-changed

onSystemPaste(callback: (payload: SystemPastePayload) => void): () => void

Канал: fastdoc-shell:system-paste

completeSaveBeforeClose(payload: { saved: boolean; message?: string | null }): void

Канал: fastdoc-shell:save-before-close-result

completeSaveBeforeDocumentSwitch(result: { requestId: number; saved: boolean; savedPath: string | null; errorMessage: string | null; }): void

Канал: fastdoc-shell:document-switch-save-result

notifyCanonicalEditDropped(payload: { code: string; requestId: string; commandType: string; }): void

Канал: fastdoc-shell:canonical-edit-dropped

notifyCurrentDocumentTruthViewerReady(payload: { availability: string; fixtureId: string | null; blockedStatesVisible: boolean; forbiddenClaimsVisible: boolean; unavailableStateVisible: boolean; genericFixtureListVisible: boolean; }): void

Канал: fastdoc-shell:current-document-truth-viewer-ready

notifyDocumentRendered(renderedPath: string | null): void

Канал: fastdoc-shell:document-rendered

notifyEditKeyDropped(payload: { code: string; inputType: string; selectionShape: string; inputRoute: string; contextRefusal: string; pressIndex: number; }): void

Канал: fastdoc-shell:edit-key-dropped

notifyPageHydrationDropped(payload: { code: string; stage: string }): void

Канал: fastdoc-shell:page-hydration-dropped

notifyPersistentSaveRefused(payload: { code: string; requestId: string; saveAs: boolean; }): void

Канал: fastdoc-shell:persistent-save-refused

notifyRendererReady(): void

Канал: fastdoc-shell:renderer-ready

notifySmokeCheckpoint(checkpoint: string, payload?: { screenshotDataUrl?: string | null; screenshots?: Array<{ name?: string | null; dataUrl?: string | null }>; telemetry?: unknown; reserveCyclesCompleted?: number; reserveElapsedMs?: number; reserveRichPayloadBytes?: number; }): void

Канал: fastdoc-shell:smoke-checkpoint

notifyUnsavedState(hasUnsavedChanges: boolean): void

Канал: fastdoc-shell:unsaved-state

Жизненный цикл подписки. Каждый метод on* возвращает функцию отписки — вызывайте её, когда убираете компонент или закрываете окно, иначе обработчики останутся висеть.

Ассистент документации

Ответ собран из документации и может быть неточным — сверяйтесь с источниками.