PreviewToolbarEditorState
Since Plugin API: 1.0.0
Editor state exposed by a file viewing and editing capability.
Signature
interface PreviewToolbarEditorState { isDirty: boolean; autosave?: boolean; saving?: boolean; onSave: () => void | Promise<void>; onFinalize?: () => Promise<boolean>; onRevert?: () => void | Promise<void>; history?: EditorHistoryHandle; saveLabel?: string; saveSavingLabel?: string; revertLabel?: string; revertTitle?: string; revertIcon?: string | null; revertRequiresDirty?: boolean; dirtyLabel?: string; showDirtyIndicator?: boolean;}Members
| Name | Type | Required | Description |
|---|---|---|---|
isDirty |
boolean |
yes | - |
autosave |
boolean |
no | Hide explicit persistence chrome while retaining history controls. |
saving |
boolean |
no | - |
onSave |
() => void | Promise<void> |
yes | - |
onFinalize |
() => Promise<boolean> |
no | Await autosave finalization before replacing the current document. |
onRevert |
() => void | Promise<void> |
no | - |
history |
EditorHistoryHandle |
no | - |
saveLabel |
string |
no | - |
saveSavingLabel |
string |
no | - |
revertLabel |
string |
no | - |
revertTitle |
string |
no | - |
revertIcon |
string | null |
no | - |
revertRequiresDirty |
boolean |
no | When false, Revert/Cancel stays enabled while clean (e.g. exit edit mode). Default true. |
dirtyLabel |
string |
no | - |
showDirtyIndicator |
boolean |
no | - |