Home Manual Reference Source

Typedef

Static Public Summary
public

Analyzer v3 parameters

public

Parameters to be used for v3 recognition

public

Parameters to be used for v4 recognition

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

Editor configuration

public
public

Debug renderer v4 parameters

public
public

Diagram v4 parameters

public

Export v4 parameters

public
public

Grab pointerDown, pointerMove and pointerUp events

public

Grabber context

public

Grabber listener

public
public

jiix export v4 parameters

public

Math solver v4 parameters

public
public

Math v3 parameters

public

Math v4 parameters

public

Editor model

public

Music clef v3 parameters

public

Music staff v3 parameters

public

Music v3 parameters

public
public

Raw results

public

Recognition context

public

Parameters to be used for recognition

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

Renderer v4 parameters

public

Parameters to be used for rendering

public

Server configuration

public

Shape v3 parameters

public
public

Stroke symbol

public

Define how a stroke should be drawn

public

Stroker info

public

Text margin v4 parameters

public
public

Text v3 parameters

public

Text v3 properties

public

Text v4 parameters

public
public

Triggers to be used for recognition

public

Triggers

public

Undo/redo context

public

Undo/redo manager

public

WebSocket configuration

Static Public

public AnalyzerV3Parameters: Object source

Analyzer v3 parameters

Properties:

NameTypeAttributeDescription
textParameter TextV3Parameters
coordinateResolution Number
  • default: undefined

public ApiV3RecognitionParameters: Object source

Parameters to be used for v3 recognition

Properties:

NameTypeAttributeDescription
mathParameter MathV3Parameters

Parameters of the math recognition if in use.

textParameter TextV3Parameters

Parameters of the text recognition if in use.

shapeParameter ShapeV3Parameters

Parameters of the shape recognition if in use.

musicParameter MusicV3Parameters

Parameters of the music recognition if in use.

analyzerParameter AnalyzerV3Parameters

Parameters of the analyzer recognition if in use.

public ApiV4RecognitionParameters: Object source

Parameters to be used for v4 recognition

Properties:

NameTypeAttributeDescription
lang String
  • default: en_US

Language to be used

export ExportV4Parameters

Generic export parameters

renderer RendererV4Parameters

iink renderer parameters

math MathV4Parameters

Parameters of the math recognition if in use.

text TextV4Parameters

Parameters of the text recognition if in use.

diagram DiagramV4Parameters

Parameters of the diagram recognition if in use.

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 Configuration: Object source

Editor configuration

Properties:

NameTypeAttributeDescription
listenerOptions Object | Boolean
  • default: {capture:true,passive:true}

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

undoRedoMaxStackSize Number
  • default: 20

Max number of items kept in the undo/redo stack

xyFloatPrecision Number
  • default: 0

Precision of x and y from 0 to 10 (integer). More the value is high more precise will be the point capture but object in memory and send to the server will be heavier.

timestampFloatPrecision Number
  • default: 0

Precision of the timestamp

triggerDelay Number
  • default: 2000

Delay in millisecond to wait before doing an action if in QUIET_PERIOD. If an other action is perform during the quiet period, timer is reset.

processDelay Number
  • default: 2000

Quiet period duration in millisecond while editor wait for another event before triggering events

resizeTriggerDelay Number
  • default: 200

Delay in millisecond to wait before applying a resize action. If a other resize order is perform during the quiet period, resizeTimer is clear. Prevent resize storms.

triggers TriggerSettings

Editor actions trigger

renderingParams RenderingParameters

Rendering parameters.

recognitionParams RecognitionParameters

Recognition parameters.

public Constants: Object source

public DebugRendererV4Parameters: Object source

Debug renderer v4 parameters

Properties:

NameTypeAttributeDescription
draw-text-boxes Boolean
  • default: false

Draw the text bounding boxes

draw-image-boxes Boolean
  • default: false

Draw the images bounding boxes

public DestructuredPromise: Object source

Properties:

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

public DiagramV4Parameters: Object source

Diagram v4 parameters

Properties:

NameTypeAttributeDescription
mimeTypes Array<String>
  • default: []

Exports mimeTypes

public ExportV4Parameters: Object source

Export v4 parameters

Properties:

NameTypeAttributeDescription
image-resolution Number
  • default: 300
jiix JiixExportV4Parameters

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 JiixExportV4Parameters: Object source

jiix export v4 parameters

Properties:

NameTypeAttributeDescription
bounding-box Boolean
  • default: false
strokes Boolean
  • default: false

public MathSolverV4Parameters: Object source

Math solver v4 parameters

Properties:

NameTypeAttributeDescription
enable Boolean
  • default: true

Enable/disable embedded solver

fractional-part-digits Number
  • default: 3

Number of digits to be used on fraction solving

decimal-separator String
  • default: .

Decimal separator to be used (e.g. "." or ",")

rounding-mode String
  • default: half_up

Rounding mode for approximations

angle-unit String
  • default: deg

Unit to be used for angles

public MathTheme: Object source

Properties:

NameTypeAttributeDescription
font-family String
  • default: STIXGeneral

Font-family to be used

public MathV3Parameters: Object source

Math v3 parameters

Properties:

NameTypeAttributeDescription
resultTypes Array<String>
  • default: ['LATEX','MATHML']

Export types

columnarOperation Boolean
  • default: false

True to activate columnar recognition

userResources Array<String>
  • default: []

Custom user resources to use

scratchOutDetectionSensitivity Number
  • default: 1

Sensitivity of to scratch-out gesture

public MathV4Parameters: Object source

Math v4 parameters

Properties:

NameTypeAttributeDescription
mimeTypes Array<String>
  • default: ['application/x-latex','application/mathml+xml']

Exports mimeTypes

fonts Array<String>
  • default: ['STIXGeneral:n4,i4,n7,i7','STIXSizeThreeSym:n4,n7']

Fonts to be used for conversion (https://github.com/typekit/fvd)

solver MathSolverV4Parameters

Settings of the solver

public Model: Object source

Editor model

Properties:

NameTypeAttributeDescription
currentStroke Stroke
  • default: undefined

Stroke in building process.

rawStrokes Array<Stroke>
  • default: []

List of captured strokes.

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 MusicClefV3Parameters: Object source

Music clef v3 parameters

Properties:

NameTypeAttributeDescription
symbol Number
  • default: G
octave Number
  • default: 0
line Number
  • default: 2

public MusicStaffV3Parameters: Object source

Music staff v3 parameters

Properties:

NameTypeAttributeDescription
top Number
  • default: 100
count Number
  • default: 5
gap Number
  • default: 20

public MusicV3Parameters: Object source

Music v3 parameters

Properties:

NameTypeAttributeDescription
divisions Number
  • default: 480
resultTypes Array<String>
  • default: ['MUSICXML','SCORETREE']
userResources Array<String>
  • default: []
staff MusicStaffV3Parameters
clef MusicClefV3Parameters
scratchOutDetectionSensitivity Number
  • default: 1

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 RecognitionParameters: Object source

Parameters to be used for recognition

Properties:

NameTypeAttributeDescription
type String
  • default: TEXT

Recognition type (TEXT, MATH, SHAPE, MUSIC, ANALYZER).

protocol String
  • default: WEBSOCKET

REST or WEBSOCKET to choose the API to use.

apiVersion String
  • default: V4

Version of the api to use.

server ServerParameters

Server configuration

v3 ApiV3RecognitionParameters

Recognition parameters for v3 API

v4 ApiV4RecognitionParameters

Recognition parameters for v4 API

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, element: Element, callback: RecognizerCallback)
  • optional

Resize.

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

Import ink.

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

Add strokes.

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

Export content.

importContent function(recognizerContext: RecognizerContext, model: Model, point: {x: Number, y: Number}, data: Blob, callback: RecognizerCallback)
  • optional

Import content.

convert function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)
  • 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.

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
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): 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 RendererV4Parameters: Object source

Renderer v4 parameters

Properties:

NameTypeAttributeDescription
debug DebugRendererV4Parameters

public RenderingParameters: Object source

Parameters to be used for rendering

Properties:

NameTypeAttributeDescription
stroker String
  • default: quadratic

Type of stroker. Actually only quadratic is implemented.

public ServerParameters: Object source

Server configuration

Properties:

NameTypeAttributeDescription
scheme String
  • default: https

Server URL scheme (http/https)

host String
  • default: cloud.myscript.com

Server host

applicationKey String
  • default: undefined

MyScript Cloud applicationKey

hmacKey String
  • default: undefined

MyScript Cloud hmacKey

websocket WebSocketConf

WebSocket configuration.

public ShapeV3Parameters: Object source

Shape v3 parameters

Properties:

NameTypeAttributeDescription
userResources Array<String>
  • default: undefined
rejectDetectionSensitivity Boolean
  • default: 1
doBeautification Boolean
  • default: true

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 TextMarginV4Parameters: Object source

Text margin v4 parameters

Properties:

NameTypeAttributeDescription
top Number
  • default: 10

Margin from the top of the part to the top of the text bounding box (will be used for reflow operations)

left Number
  • default: 15

Margin from the left of the part to the left of the text bounding box (will be used for reflow operations)

right Number
  • default: 15

Margin from the right of the part to the right of the text bounding box (will be used for reflow operations)

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 TextV3Parameters: Object source

Text v3 parameters

Properties:

NameTypeAttributeDescription
language String
  • default: en_US

Language to be used

textInputMode String
  • default: CURSIVE
resultDetail String
  • default: TEXT
contentTypes Array<String>
  • default: []
subsetKnowledges Array<String>
  • default: []
userLkWords Array<String>
  • default: []
userResources Array<String>
  • default: []
textProperties TextV3Properties

public TextV3Properties: Object source

Text v3 properties

Properties:

NameTypeAttributeDescription
textCandidateListSize Number
  • default: 1
wordCandidateListSize Number
  • default: undefined

Can't set a wordCandidateListSize > 0 if ResultDetail is not set to WORD or CHARACTER

wordPredictionListSize Number
  • default: 0
wordCompletionListSize Number
  • default: 0
characterCandidateListSize Number
  • default: undefined

Can't set a characterCandidateListSize > 0 if ResultDetail is not set to CHARACTER

enableOutOfLexicon Boolean
  • default: false
discardCaseVariations Boolean
  • default: false
discardAccentuationVariations Boolean
  • default: false
glyphDistortion Boolean
  • default: undefined

Only valid with ISOLATED mode

enableTagger Boolean
  • default: false
spellingDistortion Number
  • default: undefined

Only valid with ISOLATED mode

public TextV4Parameters: Object source

Text v4 parameters

Properties:

NameTypeAttributeDescription
mimeTypes Array<String>
  • default: ['text/plain']

Exports mimeTypes

fonts Array<String>
  • default: ['OpenSans']

Fonts to be used for conversion (https://github.com/typekit/fvd)

margin TextMarginV4Parameters

Margin of the text bounding box (will be used for reflow operations)

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 TriggerSettings: Object source

Triggers to be used for recognition

Properties:

NameTypeAttributeDescription
exportContent String
  • default: POINTER_UP

Trigger for export action

addStrokes String
  • default: POINTER_UP

Trigger for addStrokes action

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 WebSocketConf: Object source

WebSocket configuration

Properties:

NameTypeAttributeDescription
pingEnabled Boolean
  • default: true

Enable/disable ping feature.

pingDelay Number
  • default: 30000

Delay in millisecond to wait before sending a ping.

maxPingLostCount Number
  • default: 10

Failed ping count before closing the socket

autoReconnect Boolean
  • default: true

Will try to reconnect when websocket is close or when a timeout is detected. Do not handle the case when user change network on his device.

maxRetryCount Number
  • default: 2

Number of retries when auto reconnect is enabled

fileChunkSize Number
  • default: 300000

File chunk size in bytes