Skip to content 

IInk Interface

Packages > @fluidframework/ink > IInk

Shared data structure for representing ink.

Signature:

export interface IInk extends ISharedObject<IInkEvents> 

Extends: ISharedObject<IInkEvents>

Methods

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

Methods

appendPointToStroke

Append the given point to the indicated stroke.

Signature:

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

Parameters

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

Returns:

IInkStroke

The stroke that was updated

clear

Clear all strokes.

Signature:

clear(): void;

Returns:

void

createStroke

Create a stroke with the given pen information.

Signature:

createStroke(pen: IPen): IInkStroke;

Parameters

List of parameters
Parameter Type Description
pen IPen The pen information for this stroke

Returns:

IInkStroke

The stroke that was created

getStroke

Get a specific stroke with the given key.

Signature:

getStroke(key: string): IInkStroke;

Parameters

List of parameters
Parameter Type Description
key string ID for the stroke

Returns:

IInkStroke

the requested stroke, or undefined if it does not exist

getStrokes

Get the collection of strokes stored in this Ink object.

Signature:

getStrokes(): IInkStroke[];

Returns:

IInkStroke[]

the array of strokes