Skip to main content

Interface: AutosaveCanvas

Defined in: src/lib/classes/LayerAutosave/index.ts:38

The canvas whose layers are saved (PaintCanvas)

Extends​

  • EventTarget

Properties​

background​

readonly background: default

Defined in: src/lib/classes/LayerAutosave/index.ts:42

Slow work that waits for pauses in drawing


documentInfo​

readonly documentInfo: Readonly<DocumentInfo>

Defined in: src/lib/classes/LayerAutosave/index.ts:44

The drawing's details (changes are followed by a change event)


layers​

readonly layers: default

Defined in: src/lib/classes/LayerAutosave/index.ts:40

The user's layers (replaced when the canvas size changes, followed by a change event)

Methods​

addEventListener()​

addEventListener(type, callback, options?): void

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14380

The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

MDN Reference

Parameters​

type​

string

callback​

EventListenerOrEventListenerObject | null

options?​

boolean | AddEventListenerOptions

Returns​

void

Inherited from​

EventTarget.addEventListener


dispatchEvent()​

dispatchEvent(event): boolean

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14386

The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().

MDN Reference

Parameters​

event​

Event

Returns​

boolean

Inherited from​

EventTarget.dispatchEvent


flushModified()​

flushModified(): void

Defined in: src/lib/classes/LayerAutosave/index.ts:46

Marks a change still waiting to be marked modified now, so its updatedAt is saved (PaintCanvas.flushModified)

Returns​

void


removeEventListener()​

removeEventListener(type, callback, options?): void

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14392

The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

MDN Reference

Parameters​

type​

string

callback​

EventListenerOrEventListenerObject | null

options?​

boolean | EventListenerOptions

Returns​

void

Inherited from​

EventTarget.removeEventListener


restoreDocumentInfo()​

restoreDocumentInfo(info): void

Defined in: src/lib/classes/LayerAutosave/index.ts:48

Use the details of the drawing being restored

Parameters​

info​

DocumentInfo

Returns​

void


restoreLayers()​

restoreLayers(width, height, layers, images, activeLayer): void

Defined in: src/lib/classes/LayerAutosave/index.ts:50

Replace the canvas size and layers with saved ones, drawing each layer's image, and select one

Parameters​

width​

number

height​

number

layers​

readonly Required<LayerConfig>[]

images​

readonly CanvasImageSource[]

activeLayer​

string

Returns​

void