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
Name | Type |
---|---|
options | IJoinArguments |
Returns
Promise
<string
>
sketchId
deserialize
▸ deserialize(sketch
): any
Parameters
Name | Type |
---|---|
sketch | string |
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
Name | Type |
---|---|
state | boolean |
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
Name | Type |
---|---|
x | number |
y | number |
Returns
any
scale
▸ scale(scale
, center?
): any
scaling using absolute values
Parameters
Name | Type |
---|---|
scale | number |
center? | Object |
center.x | number |
center.y | number |
Returns
any
scrollTo
▸ scrollTo(top
, left
): void
scrolling using absolute values
Parameters
Name | Type |
---|---|
top | number |
left | number |
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