Skip to content

@graphty/graphty-element / index / AutosaveOptions

Interface: AutosaveOptions ​

Defined in: graphty-element/src/autosave/types.ts:263

How <graphty-element> autosaves, set through its autosaveOptions property. Every field is optional.

Properties ​

dataMaxWaitMs ​

readonly dataMaxWaitMs: number

Defined in: graphty-element/src/autosave/types.ts:273

The most a change to the graph's data waits for its write (written when the page is idle), in milliseconds; 10000.


delayMs ​

readonly delayMs: number

Defined in: graphty-element/src/autosave/types.ts:269

The trailing debounce of a write while the page is visible, in milliseconds; 500.


keep ​

readonly keep: number

Defined in: graphty-element/src/autosave/types.ts:275

Entries kept per key beyond which clean ones are deleted, oldest first; 10. An entry holding unsaved work is never deleted.


key ​

readonly key: string

Defined in: graphty-element/src/autosave/types.ts:265

The autosave key; overrides the autosave attribute's value. Entries of one key never mix with another's.


maxWaitMs ​

readonly maxWaitMs: number

Defined in: graphty-element/src/autosave/types.ts:271

The most a change waits for its write, in milliseconds; 2000.


persist ​

readonly persist: boolean

Defined in: graphty-element/src/autosave/types.ts:280

Ask the browser for persistent storage (navigator.storage.persist()) once per page load, after the first write that follows a user gesture; false. Firefox shows its own prompt.


restore ​

readonly restore: "auto" | "manual"

Defined in: graphty-element/src/autosave/types.ts:267

"auto" (the default) restores this tab's work on load; "manual" only reports it (graphty-autosave-available).


store ​

readonly store: AutosaveStore

Defined in: graphty-element/src/autosave/types.ts:288

Where entries are kept; the browser's IndexedDB (database graphty-autosave) by default.


unloadGuard ​

readonly unloadGuard: "pending" | "off" | "unexported"

Defined in: graphty-element/src/autosave/types.ts:286

When the element asks the reader before the page closes: "pending" (the default) only while a write is outstanding or failing; "unexported" while the work was never saved to a file; "off" never. Browsers on iOS never ask.