Internal objects of the SumDoc application window
What's available inside the desktop SumDoc window, why you'd need it, and why the window's internal contract is not a public interface.
| Object | Purpose | Example methods |
|---|---|---|
window.fastdocShell |
Document, editor commands, state, save, menu | getState(), getCurrentDocumentTruth(), openDocxPath(), onStateChanged() |
window.a4Update |
Application updates | status(), check(), start(), dismiss(), reveal(), openNotes(), onState() |
window.a4Help |
Version and support | version(), reportProblem(), supportBundle(), checkUpdates(), reportBadge(), onReportBadge() |
window.a4Vizor |
Notes on the window’s built-in log: it lives in the tab’s memory for about a minute and only leaves together with the problem report | onNote() |
Examples inside the application’s own window
Section titled “Examples inside the application’s own window”const state = await window.fastdocShell.getState();const truth = await window.fastdocShell.getCurrentDocumentTruth();const version = await window.a4Help.version();
const stopState = window.fastdocShell.onStateChanged((next) => { console.log("document state", next);});
const stopUpdate = window.a4Update.onState((next) => { console.log("update state", next);});await window.a4Update.check();
// Be sure to unsubscribe when the component unmounts.stopState();stopUpdate();How to choose the right API
Section titled “How to choose the right API”- Writing your own desktop app or a server-side wrapper — use
fastdoc-cli servewith JSON-line exchange. - A shell built on web technologies that needs asynchronous exchange — use
serve --ws 0. - Need to demonstrate embedding on the user’s machine — use the
surfacecommand with a WebView window oriframe; editing in this surface is limited to the first paragraph. - Your product lives in the browser and the core must run on the server — see editor in the browser.
- Modifying the SumDoc application itself — the window’s internal contract, by separate agreement.