Editor

Editor

Editor

Constructor

new Editor(element, configurationopt, themeopt, penStyleopt, behaviorsopt)

Source:
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

Editor

Members

behavior

Get current behavior
Source:

behaviors

Get behaviors
Source:

canClear

True if can clear, false otherwise.
Source:

canConvert

True if can convert, false otherwise.
Source:

canExport

True if can export, false otherwise.
Source:

canRedo

True if can redo, false otherwise.
Source:

canUndo

True if can undo, false otherwise.
Source:

configuration

Set the recognition parameters WARNING : Need to fire a clear if user have already input some strokes.
Source:

configuration

Get the current recognition parameters
Source:

domElement :Element

Inner reference to the DOM Element
Source:
Type:
  • Element

eastereggs

Get access to some easter egg features link ink injection. Use at your own risk (less tested and may be removed without notice).
Source:

emit

Get current events
Source:

exports

Get current state exports
Source:

exportTimer :Number

Launch export timer
Source:
Type:
  • Number

grabber

Get current grabber
Source:

grabberContext :GrabberContext

Current grabber context
Source:
Type:

idle

True if idle state
Source:

initialized

True if initialized, false otherwise
Source:

isEmpty

True if empty, false otherwise
Source:

localTheme :string

Pen color used only for pending stroke
Source:
Type:
  • string

model :Model

Current model
Source:
Type:

notifyTimer :Number

Notify delay timer
Source:
Type:
  • Number

penStyle

Set the pen style
Source:

penStyle

Get the pen style
Source:

penStyleClasses

Set the pen style
Source:

penStyleClasses

Get the pen style
Source:

png

Get a PNG image data url from the data model
Source:

possibleUndoCount

Return the position of the cursor identifying the current state in the internal iink undo/redo stack.
Source:

recognizer

Get current recognizer
Source:

renderer

Get current renderer
Source:

rendererContext :Object

Current rendering context
Source:
Type:
  • Object

resizeTimer :Number

Launch resize timer
Source:
Type:
  • Number

stroker

Get current stroker
Source:

theme

Set the theme
Source:

theme

Get the theme
Source:

undoStackIndex

The number of operations that it is currently possible to undo.
Source:

Methods

(async) clear() → {Promise.<*>}

Clear the output and the recognition result.
Source:
Returns:
Type:
Promise.<*>

close() → {Promise.<*>}

Close websocket connection
Source:
Returns:
Type:
Promise.<*>

convert(conversionState) → {Promise.<*>}

Convert the current content
Source:
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.
Source:
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).
Source:

getSupportedImportMimeTypes() → {Promise.<(*|null)>}

Get supported import mime types
Source:
Returns:
Type:
Promise.<(*|null)>

import_(data, mimetypeopt)

Import content.
Source:
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
Source:
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
Source:
Parameters:
Name Type Description
events PointerEvents
Returns:
Type:
Promise.<(*|null)>

pointerMove(point)

Handle a pointer move
Source:
Parameters:
Name Type Description
point Object Captured point coordinates

pointerUp(point)

Handle a pointer up
Source:
Parameters:
Name Type Description
point Object Captured point coordinates

(async) redo() → {Promise.<*>}

Redo the last action.
Source:
Returns:
Type:
Promise.<*>

reDraw(rawStrokes, strokeGroups)

Deprecated:
  • Yes
Source:
Parameters:
Name Type Description
rawStrokes
strokeGroups

resize()

Function to call when the dom element link to the current ink paper has been resize.
Source:

setGuides(enableopt) → {Promise.<(*|null)>}

Set the guides for text
Source:
Parameters:
Name Type Attributes Default Description
enable Boolean <optional>
true
Returns:
Type:
Promise.<(*|null)>

(async) undo() → {Promise.<*>}

Undo the last action.
Source:
Returns:
Type:
Promise.<*>

unload()

Detach event listeners from the DOM element created at editor creation.
Source:

waitForIdle() → {Promise.<*>}

Wait for idle state.
Source:
Returns:
Type:
Promise.<*>