Phials plugin documentation
User guide
AI Disclosure: This page was generated by an LLM and may contain inaccuracies. Hand-crafted documentation will be implemented over time on the road to 1.0

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;
    history?: EditorHistoryHandle;
    saveLabel?: string;
    saveSavingLabel?: string;
    revertLabel?: string;
    revertTitle?: string;
    revertIcon?: string | null;
    revertRequiresDirty?: boolean;
    dirtyLabel?: string;
    showDirtyIndicator?: boolean;
}

Members

NameTypeRequiredDescription
isDirtybooleanyes-
autosavebooleannoHide explicit persistence chrome while retaining history controls.
savingbooleanno-
onSave() => void | Promise<void>yes-
onFinalize() => Promise<boolean>noAwait autosave finalization before replacing the current document.
onRevert() => voidno-
historyEditorHistoryHandleno-
saveLabelstringno-
saveSavingLabelstringno-
revertLabelstringno-
revertTitlestringno-
revertIconstring | nullno-
revertRequiresDirtybooleannoWhen false, Revert/Cancel stays enabled while clean (e.g. exit edit mode). Default true.
dirtyLabelstringno-
showDirtyIndicatorbooleanno-