Interface: AutosaveOptions
Defined in: src/lib/classes/LayerAutosave/index.ts:60
Options for LayerAutosave
Properties
decode?
optionaldecode?: (image) =>Promise<CanvasImageSource>
Defined in: src/lib/classes/LayerAutosave/index.ts:71
Turns a saved PNG into an image to draw (replaceable for tests)
Parameters
image
Blob
Returns
Promise<CanvasImageSource>
delayMs?
optionaldelayMs?:number
Defined in: src/lib/classes/LayerAutosave/index.ts:73
How long to wait after the layers change before saving (default SAVE_DELAY_MS)
document?
optionaldocument?:Pick<Document,"addEventListener"|"removeEventListener"|"visibilityState"> |null
Defined in: src/lib/classes/LayerAutosave/index.ts:64
Tells when the page is hidden or shown again (the page's document by default)
encode?
optionalencode?: (canvas) =>Promise<Blob>
Defined in: src/lib/classes/LayerAutosave/index.ts:69
Turns a layer's canvas into a PNG (in a background worker by default; replaceable for tests)
Parameters
canvas
OffscreenCanvas
Returns
Promise<Blob>
locks?
optionallocks?:LockManager|null
Defined in: src/lib/classes/LayerAutosave/index.ts:62
Makes sure only one window draws on a drawing (the browser's Web Locks by default; none to skip)