TextFileView.writeData method
TextFileView › writeData
Unofficial
Write the data to the file once the adapter is ready. On failure it restores TextFileView.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:
| Parameter | Type | Description |
|---|---|---|
| file | TFile | The file to write. |
| data | string | The data to write. |
| previousData | string | null | The last saved data, restored if the write fails. |
Returns: Promise<void> — A promise that resolves when the data is written.