Home Manual Reference Source

Typedef

Static Public Summary
public

Current behavior

public

Set of behaviors to be used by the Editor

public

Bounding box

public

BuildWebSocketFunction(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): Callback: function

Build websocket function

public

Simple callback

public
public
public
public

Grab pointerDown, pointerMove and pointerUp events

public

Grabber context

public

Grabber listener

public
public
public

Editor model

public
public

Raw results

public

Recognition context

public

Recognition positions

public

Recognition service entry point

public

RecognizerCallback(err: Object, model: Model, types: ...String): function

Recognizer callback

public

Recognizer context

public

Recognizer info

public

Default renderer

public

Renderer info

public

Smart guide

public
public

Stroke symbol

public

Define how a stroke should be drawn

public

Stroker info

public
public
public

Triggers

public

Undo/redo context

public

Undo/redo manager

public

pointerEvents symbol

Static Public

public Behavior: Object source

Current behavior

Properties:

NameTypeAttributeDescription
grabber Grabber

Grabber to capture strokes

stroker Stroker

Stroker to draw stroke

renderer Renderer

Renderer to draw on the editor

recognizer Recognizer

Recognizer to call the recognition service

callbacks Array

Functions to handle model changes

public Behaviors: Object source

Set of behaviors to be used by the Editor

Properties:

NameTypeAttributeDescription
grabber Grabber

Grabber to capture strokes

strokerList Array<Stroker>

List of stroker to draw stroke

rendererList Array<Renderer>

List of renderer to draw on the editor

recognizerList Array<Recognizer>

Recognizers to call the recognition service

getBehaviorFromConfiguration function(behaviors: Behaviors, configuration: Configuration): Behavior

Get the current behavior to use regarding the current configuration

callbacks Array

Functions to handle model changes

public Bounds: Object source

Bounding box

Properties:

NameTypeAttributeDescription
minX Number

Minimal x coordinate

maxX Number

Maximal x coordinate

minY Number

Minimal y coordinate

maxY Number

Maximal y coordinate

public BuildWebSocketFunction(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): Callback: function source

Build websocket function

Params:

NameTypeAttributeDescription
destructuredPromise DestructuredPromise
recognizerContext RecognizerContext

Return:

Callback

public Callback(err: Object, res: Object): function source

Simple callback

Params:

NameTypeAttributeDescription
err Object
  • optional

Error

res Object
  • optional

Result

public Constants: Object source

public DestructuredPromise: Object source

Properties:

NameTypeAttributeDescription
promise Promise
resolve function(value: Object)
reject function(reason: Object)

public GeneratedTheme: Object source

Properties:

NameTypeAttributeDescription
font-family String
  • default: STIXGeneral

Font-family to be used

color String
  • default: #A8A8A8FF

Color to be used

public Grabber: Object source

Grab pointerDown, pointerMove and pointerUp events

Properties:

NameTypeAttributeDescription
attach function(element: Element, editor: Editor): GrabberContext

Attach events and decide when to call editor pointerDown/Move/Up methods

detach function(element: Element, context: GrabberContext)

Detach the grabber

public GrabberContext: Object source

Grabber context

Properties:

NameTypeAttributeDescription
options Boolean | Object

Options object that specifies characteristics about the event listener. (@see addEventListener.options for detail)

listeners Array<GrabberListener>

Registered listeners

public GrabberListener: Object source

Grabber listener

Properties:

NameTypeAttributeDescription
types Array<String>

Event types to listen

listener function(event: Event)

Event listener for these events

public InkTheme: PenStyle source

public MathTheme: Object source

Properties:

NameTypeAttributeDescription
font-family String
  • default: STIXGeneral

Font-family to be used

public Model: Object source

Editor model

Properties:

NameTypeAttributeDescription
currentStroke Stroke
  • default: undefined

Stroke in building process.

rawStrokes Array<Stroke>
  • default: []

List of captured strokes.

strokeGroups Array
  • default: []

Group of strokes with same pen style.

lastPositions RecognitionPositions

Last recognition sent/received stroke indexes.

defaultSymbols Array<Object>
  • default: []

Default symbols, relative to the current recognition type.

recognizedSymbols Array<Object>
  • default: undefined

Symbols to render (e.g. stroke, shape primitives, string, characters...).

exports Object
  • default: undefined

Result of the export (e.g. mathml, latex, text...).

rawResults RawResults

The recognition output as return by the recognition service.

creationTime Number

Date of creation timestamp.

modificationTime Number
  • default: undefined

Date of lastModification.

public PenStyle: Object source

Properties:

NameTypeAttributeDescription
color String
  • default: #000000

Color (supported formats rgb() rgba() hsl() hsla() #rgb #rgba #rrggbb #rrggbbaa)

-myscript-pen-width String
  • default: 1

Width of strokes and primitives in mm (no other unit is supported yet)

-myscript-pen-fill-style String
  • default: none
-myscript-pen-fill-color String
  • default: #FFFFFF00

Color filled inside the area delimited by strokes and primitives

public RawResults: Object source

Raw results

Properties:

NameTypeAttributeDescription
convert Object
  • default: undefined

The convert result

exports Object
  • default: undefined

The exports output as return by the recognition service.

public RecognitionContext: Object source

Recognition context

Properties:

NameTypeAttributeDescription
model Model
callback Callback

public RecognitionPositions: Object source

Recognition positions

Properties:

NameTypeAttributeDescription
lastSentPosition Number
  • optional
  • default: -1

Index of the last sent stroke.

lastReceivedPosition Number
  • optional
  • default: -1

Index of the last received stroke.

lastRenderedPosition Number
  • optional
  • default: -1

Last rendered recognized symbol position

public Recognizer: Object source

Recognition service entry point

Properties:

NameTypeAttributeDescription
getInfo function(): RecognizerInfo

Get information about the supported configuration (protocol, type, apiVersion, ...).

init function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Initialize recognition.

clear function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Clear server context. Currently nothing to do there.

close function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Close and free all resources that will no longer be used by the recognizer.

undo function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)
  • optional

Undo Undo the last done action.

redo function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)
  • optional

Redo Redo the previously undone action.

resize function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, element: Element)
  • optional

Resize.

pointerEvents function(recognizerContext: RecognizerContext, model: Model, strokes: Array<Stroke>, callback: RecognizerCallback)
  • optional

Pointer Events.

addStrokes function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)
  • optional

Add strokes.

export_ function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)
  • optional

Export content.

import_ function(recognizerContext: RecognizerContext, model: Model, data: Blob, callback: RecognizerCallback)
  • optional

Import content.

convert function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, conversionState: String)
  • optional

Convert.

waitForIdle function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)
  • optional

Wait for idle.

setPenStyle function(recognizerContext: RecognizerContext, model: Model, penStyle: PenStyle, callback: RecognizerCallback)
  • optional

Set pen style.

setPenStyleClasses function(recognizerContext: RecognizerContext, model: Model, penStyleClasses: String, callback: RecognizerCallback)
  • optional

Set pen style classes.

setTheme function(recognizerContext: RecognizerContext, model: Model, theme: Theme, callback: RecognizerCallback)
  • optional

Set theme.

public RecognizerCallback(err: Object, model: Model, types: ...String): function source

Recognizer callback

Params:

NameTypeAttributeDescription
err Object
  • optional

Error

model Model
  • optional

Result

types ...String
  • optional

Result types

public RecognizerContext: Object source

Recognizer context

Properties:

NameTypeAttributeDescription
editor Editor

Get a reference to the current editor

recognitionContexts Array<RecognitionContext>
  • default: []
initPromise Promise
  • default: undefined
lastPositions RecognitionPositions

Last recognition sent/received stroke indexes.

url String
  • default: undefined
websocket WebSocket
  • default: undefined
websocketCallback function
  • default: undefined
reconnect function
  • default: undefined
currentReconnectionCount Number
  • default: 0
sessionId String
  • default: undefined
contentPartCount Number
  • default: 0
currentPartId String
  • default: undefined
instanceId String
  • default: undefined
canUndo Boolean
  • default: false
canRedo Boolean
  • default: false
isEmpty Boolean
  • default: false
supportedImportMimeTypes Array
  • default: []
undoStackIndex Number
  • default: 0
possibleUndoCount Number
  • default: 0
idle Boolean
  • default: true
initialized Boolean
  • default: false

public RecognizerInfo: Object source

Recognizer info

Properties:

NameTypeAttributeDescription
types Array<String>

Supported recognition types (TEXT, MATH, SHAPE, MUSIC, ANALYZER).

protocol String

Supported protocol (REST, WEBSOCKET).

apiVersion String

Supported API version.

availableTriggers Triggers

Supported triggers for this recognizer.

public Renderer: Object source

Default renderer

Properties:

NameTypeAttributeDescription
getInfo function(): RendererInfo

Get some information about this renderer

attach function(element: Element, minHeight: Number, minWidth: Number): Object

Populate the DOM element to create rendering area.

detach function(element: Element, context: Object)

Remove rendering area from the DOM element.

resize function(context: Object, model: Model, stroker: Stroker)

Explicitly resize the rendering area.

drawCurrentStroke function(context: Object, model: Model, stroker: Stroker): Model

Draw the model currentStroke.

drawModel function(context: Object, model: Model, stroker: Stroker): Model

Draw the model defaultSymbols and recognizedSymbols.

public RendererInfo: Object source

Renderer info

Properties:

NameTypeAttributeDescription
type String

Renderer type.

apiVersion String

Supported api version.

public SmartGuide: Object source

Smart guide

Properties:

NameTypeAttributeDescription
editor Editor

A reference to the current editor.

wordToChange String

Word to change following a click on a word.

lastWord String

Keep the last word of the previous export to compare with the new and scroll if it's different.

previousLabelExport String

Keep the previous label export to know if we should repopulate the prompter text.

perfectScrollbar PerfectScrollbar

Perfect Scrollbar used to get gestures from smart guide using touch-action none anyway and get scrolling too.

elements Object

All the HTML elements of the smart guide.

smartGuideTimeOutId Number

Id of the setTimeOut from fade out animation to clear.

randomString String

Random string used in case of multiple smart guide.

public Stats: Object source

Properties:

NameTypeAttributeDescription
strokesCount Number
  • default: 0
pointsCount Number
  • default: 0
byteSize Number
  • default: 0
humanSize Number
  • default: 0
humanUnit String
  • default: BYTE

public Stroke: Object source

Stroke symbol

Properties:

NameTypeAttributeDescription
type String
  • default: stroke

Symbol type, 'stroke' for stroke

pointerType String
  • default: undefined

Pointer type

pointerId Number
  • default: undefined

Pointer id

x Array<Number>
  • default: []

X coordinates

y Array<Number>
  • default: []

Y coordinates

t Array<Number>
  • default: []

Timestamps matching x,y coordinates

p Array<Number>
  • default: []

Pressure

l Array<Number>
  • default: []

Length from origin

width Number
  • default: 0

(for rendering) Pen/brush width

color String
  • default: undefined

(for rendering) Pen/brush color

public Stroker: Object source

Define how a stroke should be drawn

Properties:

NameTypeAttributeDescription
getInfo function(): StrokerInfo

Get some information about this stroker

drawStroke function(context: Object, stroke: Stroke)

Render a stroke on the current context.

public StrokerInfo: Object source

Stroker info

Properties:

NameTypeAttributeDescription
type String

Renderer type.

name String

Stroker name.

apiVersion String

Supported api version.

public TextTheme: Object source

Properties:

NameTypeAttributeDescription
font-family String
  • default: OpenSans

Font-family to be used

font-size Number
  • default: 10

Font-size to be used

public Theme: Object source

Properties:

NameTypeAttributeDescription
ink InkTheme

General settings

.math MathTheme

Math theme

.math-solver GeneratedTheme

Theme to be used for generated items

.text TextTheme

Text theme

public Triggers: Object source

Triggers

Properties:

NameTypeAttributeDescription
exportContent Array<String>

Supported triggers for exporting content.

addStrokes Array<String>
  • optional

Supported triggers for adding strokes.

public UndoRedoContext: Object source

Undo/redo context

Properties:

NameTypeAttributeDescription
stack Array<Model>
  • default: []

List of processed models.

currentPosition Number
  • default: -1

Current model index into the stack.

maxSize Number

Max size of the stack.

canUndo Boolean
  • default: false
canRedo Boolean
  • default: false

public UndoRedoManager: Object source

Undo/redo manager

Properties:

NameTypeAttributeDescription
updateModel function(undoRedoContext: UndoRedoContext, model: Model, callback: RecognizerCallback)

Push the current model into the undo/redo context.

undo function(undoRedoContext: UndoRedoContext, model: Model, callback: RecognizerCallback)

Undo.

redo function(undoRedoContext: UndoRedoContext, model: Model, callback: RecognizerCallback)

Redo.

clear function(undoRedoContext: UndoRedoContext, model: Model, callback: RecognizerCallback)

Clear.

public pointerEvents: Object source

pointerEvents symbol

Properties:

NameTypeAttributeDescription
type String
  • default: pointerEvents

Symbol type, 'pointerEvents' for pointerEvents

processGestures Boolean
  • default: False

indicates if the gestures have to be processed

events Array<Stroke>
  • default: []

the events to process