IInk Interface
Packages > @fluidframework/ink > IInk
Shared data structure for representing ink.
Signature:
export interface IInk extends ISharedObject<IInkEvents>
Extends: ISharedObject<IInkEvents>
Methods
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
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
clear
Clear all strokes.
Signature:
clear(): void;
Returns:
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
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
getStrokes
Get the collection of strokes stored in this Ink object.
Signature:
getStrokes(): IInkStroke[];
Returns:
the array of strokes