Constructor
new Editor(element, configurationopt, themeopt, penStyleopt, behaviorsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
element |
Element
|
DOM element to attach this editor | |
configuration |
Configuration
|
<optional> |
Configuration to apply |
theme |
Theme
|
<optional> |
Custom theme to apply |
penStyle |
PenStyle
|
<optional> |
Custom style to apply |
behaviors |
Behaviors
|
<optional> |
Custom behaviors to apply |
Classes
Members
configuration
Set the recognition parameters
WARNING : Need to fire a clear if user have already input some strokes.
eastereggs
Get access to some easter egg features link ink injection. Use at your own risk (less tested and may be removed without notice).
possibleUndoCount
Return the position of the cursor identifying the current state in the internal iink undo/redo stack.
undoStackIndex
The number of operations that it is currently possible to undo.
Methods
(async) clear() → {Promise.<*>}
Clear the output and the recognition result.
Returns:
- Type:
-
Promise.<*>
close() → {Promise.<*>}
Close websocket connection
Returns:
- Type:
-
Promise.<*>
convert(conversionState) → {Promise.<*>}
Convert the current content
Parameters:
Name | Type | Default | Description |
---|---|---|---|
conversionState |
string
|
DIGITAL_EDIT |
Returns:
- Type:
-
Promise.<*>
export_(requestedMimeTypes)
Explicitly ask to perform an export. You have to listen to events to get the content as this function is non blocking and does not have a return type.
Parameters:
Name | Type | Description |
---|---|---|
requestedMimeTypes |
Array.<String>
|
Requested mime-types. Be sure to ask all the types required by the listeners of exported event. |
forceChange()
Trigger the change callbacks (and by default send a change event).
getSupportedImportMimeTypes() → {Promise.<(*|null)>}
Get supported import mime types
Returns:
- Type:
-
Promise.<(*|null)>
import_(data, mimetypeopt)
Import content.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Blob
|
*
|
Data to import | |
mimetype |
String
|
<optional> |
Mimetype of the data, needed if data is not a Blob |
pointerDown(point, pointerTypeopt, pointerIdopt)
Handle a pointer down
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
point |
Object
|
Captured point coordinates | ||
pointerType |
String
|
<optional> |
mouse | Current pointer type |
pointerId |
String
|
<optional> |
Current pointer id |
pointerEvents(events) → {Promise.<(*|null)>}
pointer events
Parameters:
Name | Type | Description |
---|---|---|
events |
PointerEvents
|
Returns:
- Type:
-
Promise.<(*|null)>
pointerMove(point)
Handle a pointer move
Parameters:
Name | Type | Description |
---|---|---|
point |
Object
|
Captured point coordinates |
pointerUp(point)
Handle a pointer up
Parameters:
Name | Type | Description |
---|---|---|
point |
Object
|
Captured point coordinates |
(async) redo() → {Promise.<*>}
Redo the last action.
Returns:
- Type:
-
Promise.<*>
reDraw(rawStrokes, strokeGroups)
Parameters:
Name | Type | Description |
---|---|---|
rawStrokes |
||
strokeGroups |
resize()
Function to call when the dom element link to the current ink paper has been resize.
setGuides(enableopt) → {Promise.<(*|null)>}
Set the guides for text
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enable |
Boolean
|
<optional> |
true |
Returns:
- Type:
-
Promise.<(*|null)>
(async) undo() → {Promise.<*>}
Undo the last action.
Returns:
- Type:
-
Promise.<*>
unload()
Detach event listeners from the DOM element created at editor creation.