charton API / @chart-on/core / index / AutosaveOptions
Interface: AutosaveOptions
Defined in: packages/core/src/storage/autosave.ts:8
Options for autosave: the debounce delay, which changes save, how the layout is serialized and stored, error handling, and the flush-on-leave target.
Properties
delayMs?
optionaldelayMs?:number
Defined in: packages/core/src/storage/autosave.ts:10
Wait this long after the last change before saving. Default 1000.
flushTarget?
optionalflushTarget?:EventTarget|null
Defined in: packages/core/src/storage/autosave.ts:23
Where to listen for pagehide, which saves a pending change at once so the last edit is not lost. Default globalThis; null turns it off.
include?
optionalinclude?: readonlyStateChangeReason[]
Defined in: packages/core/src/storage/autosave.ts:12
Changes that trigger a save. Default every reason but 'viewport'.
onError?
optionalonError?: (error) =>void
Defined in: packages/core/src/storage/autosave.ts:18
A save threw or rejected. Default logs it.
Parameters
error
unknown
Returns
void
save
save: (
layout,reasons) =>void|Promise<void>
Defined in: packages/core/src/storage/autosave.ts:16
Store the layout. reasons lists what changed since the last save.
Parameters
layout
reasons
Returns
void | Promise<void>
serialize?
optionalserialize?:LayoutSerializeOptions
Defined in: packages/core/src/storage/autosave.ts:14
Passed to serializeLayout, e.g. { drawings: false } when drawings are kept per symbol.