Skip to main content

ISketch

@auvious/sketch / Exports / ISketch

Interface: ISketch

Implemented by

Table of contents

Properties

Methods

Properties

arrow

arrow: IArrowTool


eraser

eraser: IEraserTool


events

events: IEvents<IEventMap>


marker

marker: IPathTool

Methods

clear

clear(): void

Returns

void


connect

connect(options): Promise<string>

Make the sketch collaborative

Parameters

NameType
optionsIJoinArguments

Returns

Promise<string>

sketchId


deserialize

deserialize(sketch): any

Parameters

NameType
sketchstring

Returns

any


lockRatio

lockRatio(state, width?): any

if set, when resizing, the view will be scaled to equal the ratio of an virtual sketch of width value for all participants

Parameters

NameType
stateboolean
width?number

Returns

any


mirror

mirror(): void

flips the sketch horizontally at center

Returns

void


resize

resize(x, y): any

resize the view, scaling the sketch if setSync true

Parameters

NameType
xnumber
ynumber

Returns

any


scale

scale(scale, center?): any

scaling using absolute values

Parameters

NameType
scalenumber
center?Object
center.xnumber
center.ynumber

Returns

any


scrollTo

scrollTo(top, left): void

scrolling using absolute values

Parameters

NameType
topnumber
leftnumber

Returns

void


serialize

serialize(): any

serialize own drawings

Returns

any


snapshot

snapshot(): HTMLCanvasElement

optional background image should have the same aspect ratio as the sketch

Returns

HTMLCanvasElement