Skip to content

WidgetEditorView.writeData method

WidgetEditorView › writeData

Unofficial

Write the full file contents once the adapter is ready. On failure it restores WidgetEditorView.lastSavedData, shows a notice and stores a backup of the unsaved text before rethrowing.

Signature:

writeData(file: TFile, data: string, previousData: string | null): Promise<void>

Parameters:

ParameterTypeDescription
fileTFileThe file to write.
datastringThe full file contents to write.
previousDatastring | nullThe last saved data, restored if the write fails.

Returns: Promise<void> — A promise that resolves when the data is written.