Skip to main content
Version: v1

IInk Interface

Shared data structure for representing ink.

Signature

export interface IInk extends ISharedObject<IInkEvents>

Extends: ISharedObject<IInkEvents

Methods

Method Return Type Description
appendPointToStroke(point, id) IInkStroke Append the given point to the indicated stroke.
clear() void Clear all strokes.
createStroke(pen) IInkStroke Create a stroke with the given pen information.
getStroke(key) IInkStroke Get a specific stroke with the given key.
getStrokes() IInkStroke[] Get the collection of strokes stored in this Ink object.

Method Details

appendPointToStroke

Append the given point to the indicated stroke.

Signature
appendPointToStroke(point: IInkPoint, id: string): IInkStroke;

Parameters

Parameter Type Description
point IInkPoint The point to append
id string The ID for the stroke to append to

Returns

The stroke that was updated

Return type: IInkStroke

clear

Clear all strokes.

Signature
clear(): void;

createStroke

Create a stroke with the given pen information.

Signature
createStroke(pen: IPen): IInkStroke;

Parameters

Parameter Type Description
pen IPen The pen information for this stroke

Returns

The stroke that was created

Return type: IInkStroke

getStroke

Get a specific stroke with the given key.

Signature
getStroke(key: string): IInkStroke;

Parameters

Parameter Type Description
key string ID for the stroke

Returns

the requested stroke, or undefined if it does not exist

Return type: IInkStroke

getStrokes

Get the collection of strokes stored in this Ink object.

Signature
getStrokes(): IInkStroke[];

Returns

the array of strokes

Return type: IInkStroke[]