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

MethodReturn TypeDescription
appendPointToStroke(point, id)IInkStrokeAppend the given point to the indicated stroke.
clear()voidClear all strokes.
createStroke(pen)IInkStrokeCreate a stroke with the given pen information.
getStroke(key)IInkStrokeGet 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

ParameterTypeDescription
pointIInkPointThe point to append
idstringThe 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

ParameterTypeDescription
penIPenThe 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

ParameterTypeDescription
keystringID 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[]