Home Manual Reference Source

Function

Static Public Summary
public

addPoint(stroke: Stroke, point: {x: Number, y: Number, t: Number}): Stroke

Mutate a stroke by adding a point to it.

public

addStroke(model: Model, stroke: Stroke): Model

Mutate the model given in parameter by adding the new strokeToAdd.

public

addStrokeToGroup(model: Model, stroke: Stroke, strokePenStyle: PenStyle): Model

Mutate the model given in parameter by adding the new strokeToAdd and the penstyle.

public

addStrokes(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Add strokes to the model

public

appendToPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}): Model

Mutate the model by adding a point to the current pending stroke.

public

attach(element: Element, editor: Editor, offsetTop: Number, offsetLeft: Number): GrabberContext

Listen for the desired events

public

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

Attach the renderer to the DOM element

public

attach(element: Element): Object

Populate the dom element

public

buildConfiguration(configuration: *): *

public

buildInput(recognizerContext: RecognizerContext, model: Model): Object

Internal function to build the payload to ask for a recognition.

public

buildNewContentPackageInput(configuration: *, element: *): {"type": string, "applicationKey": *, "xDpi": *, "yDpi": *, "viewSizeHeight": *, "viewSizeWidth": *}

public

buildNewContentPart(configuration: *): {"type": string, "contentType": *, "mimeTypes": *}

public

buildOpenContentPart(configuration: *, partId: *): {"type": string, "id": *, "mimeTypes": *}

public

buildRestoreIInkSessionInput(configuration: *, element: *, sessionId: *): {"type": string, "iinkSessionId": *, "applicationKey": *, "xDpi": *, "yDpi": *, "viewSizeHeight": *, "viewSizeWidth": *}

public

buildSetPenStyle(penStyle: *): {"type": string, "style": *}

public

buildSetPenStyleClasses(penStyleClasses: *): {"type": string, "styleClasses": *}

public

buildSetTheme(theme: *): {"type": string, "theme": *}

public

buildWebSocketCallback(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): function

This function bind the right behaviour when a message is receive by the websocket.

public

buildWebSocketCallback(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): function

This function bind the right behaviour when a message is receive by the websocket.

public

canReconnect(recognizerContext: RecognizerContext): Boolean

Test if it is possible to reconnect

public

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

Clear server context.

public

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

Do what is needed to clean the server context.

public

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

Do what is needed to clean the server context.

public

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

Clear server context.

public

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

Clear server context.

public

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

Clear action

public

Clear the model.

public

Clone model

public

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

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

public

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

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

public

close(recognizerContext: RecognizerContext, code: Number, reason: String)

Close the websocket

public

computeAxeAngle(begin: {x: Number, y: Number}, end: {x: Number, y: Number}): Number

public

computeHmac(input: Object, applicationKey: String, hmacKey: String): String

Compute HMAC signature for server authentication

public

computeLinksPoints(point: {x: Number, y: Number, p: Number}, angle: *, width: *): [{x: Number, y: Number},{x: Number, y: Number}]

public

computeMiddlePoint(point1: {x: Number, y: Number, p: Number}, point2: {x: Number, y: Number, p: Number}): {x: Number, y: Number, p: Number}

public
public

convert(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Ask for conversion using DIGITAL_EDIT

public

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

Convert action

public

Create a new recognizer context

public

createModel(configuration: Configuration): Model

Create a new model

public

Create a new smart guide

public

Create a new stroke

public

createUndoRedoContext(configuration: Configuration): UndoRedoContext

Create a new undo/redo context

public
public

detach(element: *, context: *)

public

detach(element: Element, context: Object)

Detach the renderer from the DOM element

public

detach(element: Element, context: Object)

Detach the renderer from the DOM element

public

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

Draw the current stroke from the model

public

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

Draw the current stroke from the model

public

drawLine(context: Object, p1: {x: Number, y: Number}, p2: {x: Number, y: Number})

Draw a line

public

drawMathSymbol(context: Object, symbol: Object, model: Model, stroker: Stroker)

Draw a math symbol

public

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

Draw all symbols contained into the model

public

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

Draw all symbols contained into the model

public

drawMusicSymbol(context: Object, symbol: Object)

Draw a music symbol

public

drawShapeSymbol(context: Object, symbol: Object)

Draw a shape symbol

public

drawStroke(context: Object, stroke: Stroke)

Draw a stroke on a canvas, using quadratics

public

drawStroke(context: Object, stroke: Stroke, stroker: Stroker)

Draw a stroke symbol

public

drawStroke(context: Object, stroke: Stroke)

Draw a stroke on a svg tag, using quadratics

public

drawStroke(context: Object, stroke: Stroke, stroker: Stroker)

Draw a stroke symbol

public

drawTextSymbol(context: Object, symbol: Object)

Draw a text symbol

public

endPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}, penStyle: PenStyle): Model

Mutate the model by adding the new point on a initPendingStroke.

public

eventCallback(type: String, data: Object)

Emits an event when the editor state change

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback): *

Export content

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback): *

Export content

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, requestedMimeTypes: Array[String])

Export content

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, requestedMimeTypes: Array[String])

Export action

public

Extract the exports

public

Extract the exports

public

Extract the exports

public

Get the symbols that needs to be rendered

public

Get the strokes that needs to be recognized

public

Extract the recognized symbols

public

Extract the recognized symbols

public

Extract recognized symbols from recognition output

public

extractStrokesFromInkRange(model: Model, firstStroke: Number, lastStroke: Number, firstPoint: Number, lastPoint: Number): Array<Stroke>

Extract strokes from an ink range

public

get(recognizerContext: RecognizerContext, url: String, params: Object): Promise

Get request

public

getAvailableLanguageList(configuration: Configuration): JSON

Return the list of available recognition languages

public

Get the bounds of the current model.

public

getDefaultSymbols(configuration: Configuration): Array

Get the default symbols for the current recognition type

public

getImage(model: Model, stroker: Stroker, margin: Number): String

Generate a PNG image data url from the model

public

Get the configuration supported by this recognizer

public

Get the configuration supported by this recognizer

public

Get the configuration supported by this recognizer

public

Get the configuration supported by this recognizer

public

Get the configuration supported by this recognizer

public

Get the configuration supported by this recognizer

public

Get the configuration supported by this recognizer

public

Get the configuration supported by this recognizer

public

Get the configuration supported by this recognizer

public

Get info

public

Get info

public

Get info

public

Get info

public

getModel(undoRedoContext: UndoRedoContext, callback: function(err: Object, res: Model, types: ...String), clone: Boolean, types: ...String)

Get current model in stack

public

Retrieve music symbols elements

public

getPointByIndex(stroke: Stroke, index: Number): {x: Number, y: Number, t: Number, p: Number, l: Number}

Extract point by index

public

getStyleFromInkRanges(model: Model, inkRanges: Array<Object>): {color: String, width: Number}

Get style for the strokes matching the ink ranges

public

getSupportedImportMimeTypes(recognizerContext: *, model: *, callback: *)

public

getSymbolsBounds(symbols: Array, bounds: Bounds): Bounds

Get the box enclosing the given symbols

public

importStrokeGroups(editorParam: *, strokeGroups: *)

public

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

Import action

public

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

Initialize recognition

public

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

Initialize recognition

public

init(suffixUrl: String, recognizerContext: RecognizerContext, buildWebSocketCallback: BuildWebSocketFunction, reconnect: function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)): Promise

Init the websocket recognizer.

public

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

Initialize recognition

public

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

Initialize recognition

public

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

Initialize recognition

public

initPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}, properties: Object, dpi: Number): Model

Mutate the model by adding a point and close the current stroke.

public

inkImporter(editorParam: *, strokes: *, delayBetweenStrokes: *, lastOneDelay: *)

Function to copy past to inject ink during tutorial.

public

Insert the smart guide HTML elements in the DOM.

public

isResetRequired(recognizerContext: RecognizerContext, model: Model): Boolean

Return true if a reset is required, false otherwise

public

launchSmartGuide(smartGuide: SmartGuide, exports: Object): *

Launch the smartguide.

public

mergeModels(models: ...Model): Model

Merge models

public

Check if the model needs to be redrawn.

public

newContentPart(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Create a new content part

public

openContentPart(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Open the recognizer context content part

public

openWebSocket(recognizerContext: RecognizerContext): WebSocket

public

Generate behaviors

public

overrideDefaultConfiguration(configuration: Configuration): Configuration

Generate parameters

public

Generate style

public

Generate theme

public

pointerEvents(recognizerContext: RecognizerContext, model: Model, events: PointerEvents, callback: RecognizerCallback)

Pointer Events

public

post(recognizerContext: RecognizerContext, url: String, data: Object, apiVersion: String, mimeType: String): Promise

Post request

public

postMessage(suffixUrl: String, recognizerContext: RecognizerContext, model: Model, buildMessage: function(recognizerContext: RecognizerContext, model: Model): Object): Promise<Model>

public

postMessage(suffixUrl: String, recognizerContext: RecognizerContext, model: Model, buildMessage: function(recognizerContext: RecognizerContext, model: Model, conversionState: String): Object, conversionState: String, mimeType: String): Promise<Model>

public

redo(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String))

Redo

public

redo(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Redo last action

public

register(element: Element, configuration: Configuration, penStyle: PenStyle, theme: Theme, behaviors: Behaviors): Editor

Attach an Editor to a DOMElement

public

reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Reset server context.

public

reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Reset server context.

public

reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Reset the recognition context

public

reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Reset the recognition context

public

Reset model lastReceivedPosition and lastSentPosition

public

Reset model lastRenderedPosition

public

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

Resize

public

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

Update the rendering context size

public

resize(context: Object, model: Model, stroker: Stroker, minHeight: Number, minWidth: Number): Model

Update the rendering context size

public

resize(smartGuide: *)

public

retry(func: *, recognizerContext: *, model: *, callback: *, params: ...*)

public

send(recognizerContext: RecognizerContext, message: Object)

Send data message

public

sendConfiguration(recognizerContext: *, model: *, callback: *)

public

sendMessage(recognizerContext: RecognizerContext, buildMessage: function(params: ...Object): Object, params: ...Object): Promise

public

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

SetPenStyle action

public

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

setPenStyleClasses action

public

Set the recognition context

public

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

SetTheme action

public

Test if it should attempt immediate reconnect

public

slice(stroke: Stroke, start: Number, end: Number): Stroke

Slice a stroke and return the sliced part of it

public

toCSS(penStyle: *): *

public

toCSS(theme: *): *

public

toJSON(penStyle: *): *

public

toJSON(theme: *): *

public

toJSON(stroke: Stroke): {type: String, x: Array<Number>, y: Array<Number>, t: Array<Number>}

Get a JSON copy of a stroke by filtering its properties

public

toJSONV4(stroke: Stroke): {x: Array<Number>, y: Array<Number>, t: Array<Number>}

Get a JSON copy of a stroke by filtering its properties

public

undo(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String))

Undo

public

undo(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Undo last action

public

updateModel(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String))

Mutate the undoRedo stack by adding a new model to it.

public

Update model lastReceivedPosition regarding to lastSentPosition

public

Update model lastRenderedPosition

public

Update model lastSentPosition

public

Update the recognition context positions

public

Update the undo/redo state

public

waitForIdle(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

WaitForIdle action

public

zoom(recognizerContext: RecognizerContext, model: Model, value: Number, callback: RecognizerCallback)

Zoom action

Static Public

public addPoint(stroke: Stroke, point: {x: Number, y: Number, t: Number}): Stroke source

import {addPoint} from 'myscript/src/model/StrokeComponent.js'

Mutate a stroke by adding a point to it.

Params:

NameTypeAttributeDescription
stroke Stroke

Current stroke

point {x: Number, y: Number, t: Number}

Point to add

Return:

Stroke

Updated stroke

public addStroke(model: Model, stroke: Stroke): Model source

import {addStroke} from 'myscript/src/model/InkModel.js'

Mutate the model given in parameter by adding the new strokeToAdd.

Params:

NameTypeAttributeDescription
model Model

Current model

stroke Stroke

Stroke to be added to pending ones

Return:

Model

Updated model

public addStrokeToGroup(model: Model, stroke: Stroke, strokePenStyle: PenStyle): Model source

import {addStrokeToGroup} from 'myscript/src/model/InkModel.js'

Mutate the model given in parameter by adding the new strokeToAdd and the penstyle. Used for iink REST.

Params:

NameTypeAttributeDescription
model Model

Current model

stroke Stroke

Stroke to be added to pending ones

strokePenStyle PenStyle

Return:

Model

Updated model

public addStrokes(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Add strokes to the model

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback

public appendToPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}): Model source

import {appendToPendingStroke} from 'myscript/src/model/InkModel.js'

Mutate the model by adding a point to the current pending stroke.

Params:

NameTypeAttributeDescription
model Model

Current model

point {x: Number, y: Number, t: Number}

Captured point to be append to the current stroke

Return:

Model

Updated model

public attach(element: Element, editor: Editor, offsetTop: Number, offsetLeft: Number): GrabberContext source

Listen for the desired events

Params:

NameTypeAttributeDescription
element Element

DOM element to attach events listeners

editor Editor

Editor to received down/move/up events

offsetTop Number
  • optional
  • default: 0
offsetLeft Number
  • optional
  • default: 0

Return:

GrabberContext

Grabber context

Listen:

Event

pointermove: a pointer moves, similar to touchmove or mousemove.

Event

pointerdown: a pointer is activated, or a device button held.

Event

pointerup: a pointer is deactivated, or a device button released.

Event

pointerover: a pointer has moved onto an element.

Event

pointerout: a pointer is no longer on an element it once was.

Event

pointerenter: a pointer enters the bounding box of an element.

Event

pointerleave: a pointer leaves the bounding box of an element.

Event

pointercancel: a pointer will no longer generate events.

public attach(element: Element, minHeight: Number, minWidth: Number): Object source

Attach the renderer to the DOM element

Params:

NameTypeAttributeDescription
element Element

DOM element to attach the rendering elements

minHeight Number
  • optional
  • default: 0

Minimal height of the editor

minWidth Number
  • optional
  • default: 0

Minimal width of the editor

Return:

Object

The renderer context to give as parameter when a draw model will be call

public attach(element: Element): Object source

Populate the dom element

Params:

NameTypeAttributeDescription
element Element

DOM element to attach the rendering elements

Return:

Object

The renderer context to give as parameter when a draw model will be call

public buildConfiguration(configuration: *): * source

Params:

NameTypeAttributeDescription
configuration *

Return:

*

public buildInput(recognizerContext: RecognizerContext, model: Model): Object source

Internal function to build the payload to ask for a recognition.

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext
model Model

Return:

Object

public buildNewContentPackageInput(configuration: *, element: *): {"type": string, "applicationKey": *, "xDpi": *, "yDpi": *, "viewSizeHeight": *, "viewSizeWidth": *} source

import {buildNewContentPackageInput} from 'myscript/src/recognizer/websocket/v4/Cdkv4WSIInkRecognizer.js'

Params:

NameTypeAttributeDescription
configuration *
element *

Return:

{"type": string, "applicationKey": *, "xDpi": *, "yDpi": *, "viewSizeHeight": *, "viewSizeWidth": *}

public buildNewContentPart(configuration: *): {"type": string, "contentType": *, "mimeTypes": *} source

Params:

NameTypeAttributeDescription
configuration *

Return:

{"type": string, "contentType": *, "mimeTypes": *}

public buildOpenContentPart(configuration: *, partId: *): {"type": string, "id": *, "mimeTypes": *} source

Params:

NameTypeAttributeDescription
configuration *
partId *

Return:

{"type": string, "id": *, "mimeTypes": *}

public buildRestoreIInkSessionInput(configuration: *, element: *, sessionId: *): {"type": string, "iinkSessionId": *, "applicationKey": *, "xDpi": *, "yDpi": *, "viewSizeHeight": *, "viewSizeWidth": *} source

import {buildRestoreIInkSessionInput} from 'myscript/src/recognizer/websocket/v4/Cdkv4WSIInkRecognizer.js'

Params:

NameTypeAttributeDescription
configuration *
element *
sessionId *

Return:

{"type": string, "iinkSessionId": *, "applicationKey": *, "xDpi": *, "yDpi": *, "viewSizeHeight": *, "viewSizeWidth": *}

public buildSetPenStyle(penStyle: *): {"type": string, "style": *} source

Params:

NameTypeAttributeDescription
penStyle *

Return:

{"type": string, "style": *}

public buildSetPenStyleClasses(penStyleClasses: *): {"type": string, "styleClasses": *} source

Params:

NameTypeAttributeDescription
penStyleClasses *

Return:

{"type": string, "styleClasses": *}

public buildSetTheme(theme: *): {"type": string, "theme": *} source

Params:

NameTypeAttributeDescription
theme *

Return:

{"type": string, "theme": *}

public buildWebSocketCallback(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): function source

import {buildWebSocketCallback} from 'myscript/src/recognizer/websocket/v3/Cdkv3WSBuilder.js'

This function bind the right behaviour when a message is receive by the websocket.

Params:

NameTypeAttributeDescription
destructuredPromise DestructuredPromise
recognizerContext RecognizerContext

Current recognizer context

Return:

function

Callback to handle WebSocket results

public buildWebSocketCallback(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): function source

import {buildWebSocketCallback} from 'myscript/src/recognizer/websocket/v4/Cdkv4WSBuilder.js'

This function bind the right behaviour when a message is receive by the websocket.

Params:

NameTypeAttributeDescription
destructuredPromise DestructuredPromise
recognizerContext RecognizerContext

Current recognizer context

Return:

function

Callback to handle WebSocket results

public canReconnect(recognizerContext: RecognizerContext): Boolean source

import {canReconnect} from 'myscript/src/model/RecognizerContext.js'

Test if it is possible to reconnect

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Return:

Boolean

True if possible, false otherwise

public clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Clear server context. Currently nothing to do there.

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Do what is needed to clean the server context.

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Do what is needed to clean the server context.

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Clear server context. Currently nothing to do there.

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Clear server context. Currently nothing to do there.

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Clear action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback

public clearModel(model: Model): Model source

import {clearModel} from 'myscript/src/model/InkModel.js'

Clear the model.

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Model

Cleared model

public cloneModel(model: Model): Model source

import {cloneModel} from 'myscript/src/model/InkModel.js'

Clone model

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Model

Clone of the current model

public close(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

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

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public close(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

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

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext
model Model
callback RecognizerCallback

public close(recognizerContext: RecognizerContext, code: Number, reason: String) source

Close the websocket

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

code Number

Exit code

reason String

Exit reason

public computeAxeAngle(begin: {x: Number, y: Number}, end: {x: Number, y: Number}): Number source

import {computeAxeAngle} from 'myscript/src/renderer/QuadraticUtils.js'

Params:

NameTypeAttributeDescription
begin {x: Number, y: Number}
end {x: Number, y: Number}

Return:

Number

public computeHmac(input: Object, applicationKey: String, hmacKey: String): String source

import {computeHmac} from 'myscript/src/recognizer/CryptoHelper.js'

Compute HMAC signature for server authentication

Params:

NameTypeAttributeDescription
input Object

Input data to compute HMAC

applicationKey String

Current applicationKey

hmacKey String

Current hmacKey

Return:

String

Signature

public computeLinksPoints(point: {x: Number, y: Number, p: Number}, angle: *, width: *): [{x: Number, y: Number},{x: Number, y: Number}] source

import {computeLinksPoints} from 'myscript/src/renderer/QuadraticUtils.js'

Params:

NameTypeAttributeDescription
point {x: Number, y: Number, p: Number}
angle *
width *

Return:

[{x: Number, y: Number},{x: Number, y: Number}]

public computeMiddlePoint(point1: {x: Number, y: Number, p: Number}, point2: {x: Number, y: Number, p: Number}): {x: Number, y: Number, p: Number} source

import {computeMiddlePoint} from 'myscript/src/renderer/QuadraticUtils.js'

Params:

NameTypeAttributeDescription
point1 {x: Number, y: Number, p: Number}
point2 {x: Number, y: Number, p: Number}

Return:

{x: Number, y: Number, p: Number}

public computeStats(model: Model): Stats source

import {computeStats} from 'myscript/src/util/ModelStats.js'

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Stats

Statistics about recognition

public convert(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Ask for conversion using DIGITAL_EDIT

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public convert(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, conversionState: String) source

Convert action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback
conversionState String

Conversion State, by default DigitalEdit

public createEmptyRecognizerContext(editor: Editor): RecognizerContext source

import {createEmptyRecognizerContext} from 'myscript/src/model/RecognizerContext.js'

Create a new recognizer context

Params:

NameTypeAttributeDescription
editor Editor

Return:

RecognizerContext

An object that contains all recognizer context

public createModel(configuration: Configuration): Model source

import {createModel} from 'myscript/src/model/InkModel.js'

Create a new model

Params:

NameTypeAttributeDescription
configuration Configuration
  • optional

Parameters to use to populate default recognition symbols

Return:

Model

New model

public createSmartGuide(editor: Editor): SmartGuide source

import {createSmartGuide} from 'myscript/src/smartguide/SmartGuide.js'

Create a new smart guide

Params:

NameTypeAttributeDescription
editor Editor

A reference to the editor.

Return:

SmartGuide

New smart guide

public createStrokeComponent(properties: Object): Stroke source

import {createStrokeComponent} from 'myscript/src/model/StrokeComponent.js'

Create a new stroke

Params:

NameTypeAttributeDescription
properties Object

Properties to be applied to the stroke.

Return:

Stroke

New stroke with properties for quadratics draw

public createUndoRedoContext(configuration: Configuration): UndoRedoContext source

import {createUndoRedoContext} from 'myscript/src/model/UndoRedoContext.js'

Create a new undo/redo context

Params:

NameTypeAttributeDescription
configuration Configuration

Current configuration

Return:

UndoRedoContext

New undo/redo context

public destructurePromise(): DestructuredPromise source

import {destructurePromise} from 'myscript/src/util/PromiseHelper.js'

public detach(element: *, context: *) source

Params:

NameTypeAttributeDescription
element *
context *

public detach(element: Element, context: Object) source

Detach the renderer from the DOM element

Params:

NameTypeAttributeDescription
element Element

DOM element to attach the rendering elements

context Object

Current rendering context

public detach(element: Element, context: Object) source

Detach the renderer from the DOM element

Params:

NameTypeAttributeDescription
element Element

DOM element to attach the rendering elements

context Object

Current rendering context

public drawCurrentStroke(context: Object, model: Model, stroker: Stroker): Model source

import {drawCurrentStroke} from 'myscript/src/renderer/canvas/CanvasRenderer.js'

Draw the current stroke from the model

Params:

NameTypeAttributeDescription
context Object

Current rendering context

model Model

Current model

stroker Stroker

Current stroker

Return:

Model

public drawCurrentStroke(context: Object, model: Model, stroker: Stroker): Model source

import {drawCurrentStroke} from 'myscript/src/renderer/svg/SVGRenderer.js'

Draw the current stroke from the model

Params:

NameTypeAttributeDescription
context Object

Current rendering context

model Model

Current model

stroker Stroker

Current stroker

Return:

Model

public drawLine(context: Object, p1: {x: Number, y: Number}, p2: {x: Number, y: Number}) source

Draw a line

Params:

NameTypeAttributeDescription
context Object

Current rendering context

p1 {x: Number, y: Number}

Origin point

p2 {x: Number, y: Number}

Destination point

public drawMathSymbol(context: Object, symbol: Object, model: Model, stroker: Stroker) source

Draw a math symbol

Params:

NameTypeAttributeDescription
context Object

Current rendering context

symbol Object

Symbol to draw

model Model

Current model

stroker Stroker

Stroker to use to render a stroke

public drawModel(context: Object, model: Model, stroker: Stroker): Model source

Draw all symbols contained into the model

Params:

NameTypeAttributeDescription
context Object

Current rendering context

model Model

Current model

stroker Stroker

Current stroker

Return:

Model

public drawModel(context: Object, model: Model, stroker: Stroker): Model source

Draw all symbols contained into the model

Params:

NameTypeAttributeDescription
context Object

Current rendering context

model Model

Current model

stroker Stroker

Current stroker

Return:

Model

public drawMusicSymbol(context: Object, symbol: Object) source

Draw a music symbol

Params:

NameTypeAttributeDescription
context Object

Current rendering context

symbol Object

Symbol to draw

public drawShapeSymbol(context: Object, symbol: Object) source

Draw a shape symbol

Params:

NameTypeAttributeDescription
context Object

Current rendering context

symbol Object

Symbol to draw

public drawStroke(context: Object, stroke: Stroke) source

Draw a stroke on a canvas, using quadratics

Params:

NameTypeAttributeDescription
context Object

Current rendering context

stroke Stroke

Current stroke to be drawn

public drawStroke(context: Object, stroke: Stroke, stroker: Stroker) source

Draw a stroke symbol

Params:

NameTypeAttributeDescription
context Object

Current rendering context

stroke Stroke

Stroke to be drawn

stroker Stroker

Stroker to use to render a stroke

public drawStroke(context: Object, stroke: Stroke) source

Draw a stroke on a svg tag, using quadratics

Params:

NameTypeAttributeDescription
context Object

Current rendering context

stroke Stroke

Current stroke to be drawn

public drawStroke(context: Object, stroke: Stroke, stroker: Stroker) source

Draw a stroke symbol

Params:

NameTypeAttributeDescription
context Object

Current rendering context

stroke Stroke

Stroke to be drawn

stroker Stroker

Stroker to use to render a stroke

public drawTextSymbol(context: Object, symbol: Object) source

Draw a text symbol

Params:

NameTypeAttributeDescription
context Object

Current rendering context

symbol Object

Symbol to draw

public endPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}, penStyle: PenStyle): Model source

import {endPendingStroke} from 'myscript/src/model/InkModel.js'

Mutate the model by adding the new point on a initPendingStroke.

Params:

NameTypeAttributeDescription
model Model

Current model

point {x: Number, y: Number, t: Number}

Captured point to be append to the current stroke

penStyle PenStyle

Return:

Model

Updated model

public eventCallback(type: String, data: Object) source

import eventCallback from 'myscript/src/callback/EventCallback.js'

Emits an event when the editor state change

Params:

NameTypeAttributeDescription
type String
data Object

Emit:

Event

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback): * source

Export content

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

Return:

*

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback): * source

Export content

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

Return:

*

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Export content

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Export content

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Export content

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, requestedMimeTypes: Array[String]) source

Export content

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback
requestedMimeTypes Array[String]

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Export content

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Export content

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, requestedMimeTypes: Array[String]) source

Export action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback
requestedMimeTypes Array[String]

public extractExports(model: Model): Object source

Extract the exports

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Object

Recognition result

public extractExports(model: Model): Object source

Extract the exports

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Object

exports

public extractExports(model: Model): Object source

Extract the exports

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Object

exports

public extractPendingRecognizedSymbols(model: Model, position: Number): Array<Object> source

import {extractPendingRecognizedSymbols} from 'myscript/src/model/InkModel.js'

Get the symbols that needs to be rendered

Params:

NameTypeAttributeDescription
model Model

Current model

position Number
  • optional
  • default: lastRendered

Index from where to extract symbols

Return:

Array<Object>

public extractPendingStrokes(model: Model, position: Number): Array<Stroke> source

import {extractPendingStrokes} from 'myscript/src/model/InkModel.js'

Get the strokes that needs to be recognized

Params:

NameTypeAttributeDescription
model Model

Current model

position Number
  • optional
  • default: lastReceived

Index from where to extract strokes

Return:

Array<Stroke>

Pending strokes

public extractRecognizedSymbols(model: Model): Array<Object> source

Extract the recognized symbols

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Array<Object>

Recognized symbols

public extractRecognizedSymbols(model: Model): Array<Object> source

Extract the recognized symbols

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Array<Object>

Recognized symbols

public extractShapeSymbols(model: Model, segment: Object): Array<Object> source

Extract recognized symbols from recognition output

Params:

NameTypeAttributeDescription
model Model

Current model

segment Object

Shape recognition output

Return:

Array<Object>

Recognized symbols

public extractStrokesFromInkRange(model: Model, firstStroke: Number, lastStroke: Number, firstPoint: Number, lastPoint: Number): Array<Stroke> source

import {extractStrokesFromInkRange} from 'myscript/src/model/InkModel.js'

Extract strokes from an ink range

Params:

NameTypeAttributeDescription
model Model

Current model

firstStroke Number

First stroke index to extract

lastStroke Number

Last stroke index to extract

firstPoint Number

First point index to extract

lastPoint Number

Last point index to extract

Return:

Array<Stroke>

The extracted strokes

public get(recognizerContext: RecognizerContext, url: String, params: Object): Promise source

Get request

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Recognizer context

url String

URL

params Object

Query properties

Return:

Promise

public getAvailableLanguageList(configuration: Configuration): JSON source

import {getAvailableLanguageList} from 'myscript/src/EditorFacade.js'

Return the list of available recognition languages

Params:

NameTypeAttributeDescription
configuration Configuration
  • optional

Configuration to get the languages

Return:

JSON

A list of available languages

public getBorderCoordinates(model: Model): Bounds source

import {getBorderCoordinates} from 'myscript/src/model/InkModel.js'

Get the bounds of the current model.

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Bounds

Bounding box enclosing the current drawn model

public getDefaultSymbols(configuration: Configuration): Array source

import {getDefaultSymbols} from 'myscript/src/model/Symbol.js'

Get the default symbols for the current recognition type

Params:

NameTypeAttributeDescription
configuration Configuration

Current recognition parameters from which extract default symbols

Return:

Array

Symbols matching configuration

public getImage(model: Model, stroker: Stroker, margin: Number): String source

Generate a PNG image data url from the model

Params:

NameTypeAttributeDescription
model Model

Current model

stroker Stroker

Current stroker

margin Number
  • optional
  • default: 10

Margins to apply around the image

Return:

String

Image data string result

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RecognizerInfo source

Get the configuration supported by this recognizer

Return:

RecognizerInfo

public getInfo(): RendererInfo source

Get info

Return:

RendererInfo

Information about this renderer

public getInfo(): StrokerInfo source

Get info

Return:

StrokerInfo

Information about this stroker

public getInfo(): RendererInfo source

Get info

Return:

RendererInfo

Information about this renderer

public getInfo(): StrokerInfo source

Get info

Return:

StrokerInfo

Information about this stroker

public getModel(undoRedoContext: UndoRedoContext, callback: function(err: Object, res: Model, types: ...String), clone: Boolean, types: ...String) source

import {getModel} from 'myscript/src/model/UndoRedoManager.js'

Get current model in stack

Params:

NameTypeAttributeDescription
undoRedoContext UndoRedoContext

Current undo/redo context

callback function(err: Object, res: Model, types: ...String)
clone Boolean
  • optional
  • default: true

Whether or not to clone the model

types ...String

public getMusicClefElements(): Array<Element> source

Retrieve music symbols elements

Return:

Array<Element>

music symbols elements to attach

public getPointByIndex(stroke: Stroke, index: Number): {x: Number, y: Number, t: Number, p: Number, l: Number} source

import {getPointByIndex} from 'myscript/src/model/StrokeComponent.js'

Extract point by index

Params:

NameTypeAttributeDescription
stroke Stroke

Current stroke

index Number

Zero-based index

Return:

{x: Number, y: Number, t: Number, p: Number, l: Number}

Point with properties for quadratics draw

public getStyleFromInkRanges(model: Model, inkRanges: Array<Object>): {color: String, width: Number} source

Get style for the strokes matching the ink ranges

Params:

NameTypeAttributeDescription
model Model
inkRanges Array<Object>

Return:

{color: String, width: Number}

Style to apply

public getSupportedImportMimeTypes(recognizerContext: *, model: *, callback: *) source

import {getSupportedImportMimeTypes} from 'myscript/src/recognizer/websocket/v4/Cdkv4WSIInkRecognizer.js'

Params:

NameTypeAttributeDescription
recognizerContext *
model *
callback *

public getSymbolsBounds(symbols: Array, bounds: Bounds): Bounds source

import {getSymbolsBounds} from 'myscript/src/model/Symbol.js'

Get the box enclosing the given symbols

Params:

NameTypeAttributeDescription
symbols Array

Symbols to extract bounds from

bounds Bounds
  • optional

Starting bounds for recursion

Return:

Bounds

Bounding box enclosing symbols

public importStrokeGroups(editorParam: *, strokeGroups: *) source

import {importStrokeGroups} from 'myscript/src/eastereggs/InkImporter.js'

Params:

NameTypeAttributeDescription
editorParam *
strokeGroups *

public import_(recognizerContext: RecognizerContext, model: Model, data: Blob, callback: RecognizerCallback) source

Import action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

data Blob

Import data

callback RecognizerCallback

public init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Initialize recognition

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Initialize recognition

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public init(suffixUrl: String, recognizerContext: RecognizerContext, buildWebSocketCallback: BuildWebSocketFunction, reconnect: function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)): Promise source

Init the websocket recognizer. Open the connexion and proceed to the hmac challenge.

Params:

NameTypeAttributeDescription
suffixUrl String
recognizerContext RecognizerContext
buildWebSocketCallback BuildWebSocketFunction
reconnect function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Return:

Promise

Fulfilled when the init phase is over.

public init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Initialize recognition

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Initialize recognition

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Initialize recognition

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public initPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}, properties: Object, dpi: Number): Model source

import {initPendingStroke} from 'myscript/src/model/InkModel.js'

Mutate the model by adding a point and close the current stroke.

Params:

NameTypeAttributeDescription
model Model

Current model

point {x: Number, y: Number, t: Number}

Captured point to create current stroke

properties Object

Properties to be applied to the current stroke

dpi Number
  • optional
  • default: 96

The screen dpi resolution

Return:

Model

Updated model

public inkImporter(editorParam: *, strokes: *, delayBetweenStrokes: *, lastOneDelay: *) source

import {inkImporter} from 'myscript/src/eastereggs/InkImporter.js'

Function to copy past to inject ink during tutorial.

Params:

NameTypeAttributeDescription
editorParam *
strokes *
delayBetweenStrokes *
lastOneDelay *

public insertSmartGuide(smartGuide: SmartGuide) source

import {insertSmartGuide} from 'myscript/src/smartguide/SmartGuide.js'

Insert the smart guide HTML elements in the DOM.

Params:

NameTypeAttributeDescription
smartGuide SmartGuide

A reference to the smart guide.

public isResetRequired(recognizerContext: RecognizerContext, model: Model): Boolean source

import {isResetRequired} from 'myscript/src/model/RecognizerContext.js'

Return true if a reset is required, false otherwise

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext
model Model

Return:

Boolean

public launchSmartGuide(smartGuide: SmartGuide, exports: Object): * source

import {launchSmartGuide} from 'myscript/src/smartguide/SmartGuide.js'

Launch the smartguide.

Params:

NameTypeAttributeDescription
smartGuide SmartGuide

A reference to the smart guide.

exports Object

The export from the editor.

Return:

*

public mergeModels(models: ...Model): Model source

import {mergeModels} from 'myscript/src/model/InkModel.js'

Merge models

Params:

NameTypeAttributeDescription
models ...Model

Models to merge (ordered)

Return:

Model

Updated model

public needRedraw(model: Model): Boolean source

import {needRedraw} from 'myscript/src/model/InkModel.js'

Check if the model needs to be redrawn.

Params:

NameTypeAttributeDescription
model Model

Current model

Return:

Boolean

True if the model needs to be redrawn, false otherwise

public newContentPart(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Create a new content part

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback

public openContentPart(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Open the recognizer context content part

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback

public openWebSocket(recognizerContext: RecognizerContext): WebSocket source

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Recognizer context

Return:

WebSocket

Opened WebSocket

public overrideDefaultBehaviors(behaviors: Behaviors): Behaviors source

import {overrideDefaultBehaviors} from 'myscript/src/configuration/DefaultBehaviors.js'

Generate behaviors

Params:

NameTypeAttributeDescription
behaviors Behaviors

Behaviors to be used

Return:

Behaviors

Overridden behaviors

public overrideDefaultConfiguration(configuration: Configuration): Configuration source

import {overrideDefaultConfiguration} from 'myscript/src/configuration/DefaultConfiguration.js'

Generate parameters

Params:

NameTypeAttributeDescription
configuration Configuration

Configuration to be used

Return:

Configuration

Overridden configuration

public overrideDefaultPenStyle(style: PenStyle): PenStyle source

import {overrideDefaultPenStyle} from 'myscript/src/configuration/DefaultPenStyle.js'

Generate style

Params:

NameTypeAttributeDescription
style PenStyle

Custom style to be applied

Return:

PenStyle

Overridden style

public overrideDefaultTheme(theme: Theme): Theme source

import {overrideDefaultTheme} from 'myscript/src/configuration/DefaultTheme.js'

Generate theme

Params:

NameTypeAttributeDescription
theme Theme

Custom theme to be applied

Return:

Theme

Overridden theme

public pointerEvents(recognizerContext: RecognizerContext, model: Model, events: PointerEvents, callback: RecognizerCallback) source

Pointer Events

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

events PointerEvents

to be imported

callback RecognizerCallback

public post(recognizerContext: RecognizerContext, url: String, data: Object, apiVersion: String, mimeType: String): Promise source

Post request

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Recognizer context

url String

URL

data Object

Data to be sent

apiVersion String

api version

mimeType String

MimeType to be used

Return:

Promise

public postMessage(suffixUrl: String, recognizerContext: RecognizerContext, model: Model, buildMessage: function(recognizerContext: RecognizerContext, model: Model): Object): Promise<Model> source

Params:

NameTypeAttributeDescription
suffixUrl String
recognizerContext RecognizerContext
model Model
buildMessage function(recognizerContext: RecognizerContext, model: Model): Object

Return:

Promise<Model>

Promise that return an updated model as a result

public postMessage(suffixUrl: String, recognizerContext: RecognizerContext, model: Model, buildMessage: function(recognizerContext: RecognizerContext, model: Model, conversionState: String): Object, conversionState: String, mimeType: String): Promise<Model> source

Params:

NameTypeAttributeDescription
suffixUrl String
recognizerContext RecognizerContext
model Model
buildMessage function(recognizerContext: RecognizerContext, model: Model, conversionState: String): Object
conversionState String
mimeType String

Return:

Promise<Model>

Promise that return an updated model as a result

public redo(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String)) source

Redo

Params:

NameTypeAttributeDescription
undoRedoContext UndoRedoContext

Current undo/redo context.

model Model

Current model.

callback function(err: Object, res: Model, types: ...String)

public redo(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Redo last action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback

public register(element: Element, configuration: Configuration, penStyle: PenStyle, theme: Theme, behaviors: Behaviors): Editor source

import {register} from 'myscript/src/EditorFacade.js'

Attach an Editor to a DOMElement

Params:

NameTypeAttributeDescription
element Element

DOM element to attach an editor

configuration Configuration
  • optional

Configuration to apply

penStyle PenStyle
  • optional

Pen style to apply

theme Theme
  • optional

Theme to apply

behaviors Behaviors
  • optional

Custom behaviors to apply

Return:

Editor

New editor

public reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Reset server context. Currently nothing to do there.

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Reset server context.

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Reset the recognition context

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Reset the recognition context

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

model Model

Current model

callback RecognizerCallback

public resetModelPositions(model: Model): Model source

import {resetModelPositions} from 'myscript/src/model/InkModel.js'

Reset model lastReceivedPosition and lastSentPosition

Params:

NameTypeAttributeDescription
model Model

Return:

Model

public resetModelRendererPosition(model: Model): Model source

import {resetModelRendererPosition} from 'myscript/src/model/InkModel.js'

Reset model lastRenderedPosition

Params:

NameTypeAttributeDescription
model Model

Return:

Model

public resize(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, element: Element) source

Resize

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback
element Element

Current element

public resize(context: Object, model: Model, stroker: Stroker): Model source

Update the rendering context size

Params:

NameTypeAttributeDescription
context Object

Current rendering context

model Model

Current model

stroker Stroker

Current stroker

Return:

Model

public resize(context: Object, model: Model, stroker: Stroker, minHeight: Number, minWidth: Number): Model source

Update the rendering context size

Params:

NameTypeAttributeDescription
context Object

Current rendering context

model Model

Current model

stroker Stroker

Current stroker

minHeight Number

Minimal height for resize

minWidth Number

Minimal Width for resize

Return:

Model

public resize(smartGuide: *) source

Params:

NameTypeAttributeDescription
smartGuide *

public retry(func: *, recognizerContext: *, model: *, callback: *, params: ...*) source

Params:

NameTypeAttributeDescription
func *
recognizerContext *
model *
callback *
params ...*

public send(recognizerContext: RecognizerContext, message: Object) source

Send data message

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

message Object

Data message

public sendConfiguration(recognizerContext: *, model: *, callback: *) source

Params:

NameTypeAttributeDescription
recognizerContext *
model *
callback *

public sendMessage(recognizerContext: RecognizerContext, buildMessage: function(params: ...Object): Object, params: ...Object): Promise source

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext
buildMessage function(params: ...Object): Object
params ...Object

Return:

Promise

public setPenStyle(recognizerContext: RecognizerContext, model: Model, penStyle: PenStyle, callback: RecognizerCallback) source

SetPenStyle action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

penStyle PenStyle

Current penStyle

callback RecognizerCallback

public setPenStyleClasses(recognizerContext: RecognizerContext, model: Model, penStyleClasses: String, callback: RecognizerCallback) source

setPenStyleClasses action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

penStyleClasses String

Current penStyleClasses

callback RecognizerCallback

public setRecognitionContext(recognizerContext: RecognizerContext, recognitionContext: RecognitionContext): RecognizerContext source

import {setRecognitionContext} from 'myscript/src/model/RecognizerContext.js'

Set the recognition context

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

recognitionContext RecognitionContext

public setTheme(recognizerContext: RecognizerContext, model: Model, theme: Theme, callback: RecognizerCallback) source

SetTheme action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

theme Theme

Current theme

callback RecognizerCallback

public shouldAttemptImmediateReconnect(recognizerContext: RecognizerContext): Boolean source

import {shouldAttemptImmediateReconnect} from 'myscript/src/model/RecognizerContext.js'

Test if it should attempt immediate reconnect

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Return:

Boolean

True if should attempt reconnect, false otherwise

public slice(stroke: Stroke, start: Number, end: Number): Stroke source

Slice a stroke and return the sliced part of it

Params:

NameTypeAttributeDescription
stroke Stroke

Current stroke

start Number
  • optional
  • default: 0

Zero-based index at which to begin extraction

end Number
  • optional
  • default: length

Zero-based index at which to end extraction

Return:

Stroke

Sliced stroke

public toCSS(penStyle: *): * source

Params:

NameTypeAttributeDescription
penStyle *

Return:

*

public toCSS(theme: *): * source

Params:

NameTypeAttributeDescription
theme *

Return:

*

public toJSON(penStyle: *): * source

Params:

NameTypeAttributeDescription
penStyle *

Return:

*

public toJSON(theme: *): * source

Params:

NameTypeAttributeDescription
theme *

Return:

*

public toJSON(stroke: Stroke): {type: String, x: Array<Number>, y: Array<Number>, t: Array<Number>} source

Get a JSON copy of a stroke by filtering its properties

Params:

NameTypeAttributeDescription
stroke Stroke

Current stroke

Return:

{type: String, x: Array<Number>, y: Array<Number>, t: Array<Number>}

Simplified stroke object

public toJSONV4(stroke: Stroke): {x: Array<Number>, y: Array<Number>, t: Array<Number>} source

import {toJSONV4} from 'myscript/src/model/StrokeComponent.js'

Get a JSON copy of a stroke by filtering its properties

Params:

NameTypeAttributeDescription
stroke Stroke

Current stroke

Return:

{x: Array<Number>, y: Array<Number>, t: Array<Number>}

Simplified stroke object

public undo(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String)) source

Undo

Params:

NameTypeAttributeDescription
undoRedoContext UndoRedoContext

Current undo/redo context.

model Model

Current model.

callback function(err: Object, res: Model, types: ...String)

public undo(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

Undo last action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback

public updateModel(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String)) source

import {updateModel} from 'myscript/src/model/UndoRedoManager.js'

Mutate the undoRedo stack by adding a new model to it.

Params:

NameTypeAttributeDescription
undoRedoContext UndoRedoContext

Current undo/redo context.

model Model

Current model.

callback function(err: Object, res: Model, types: ...String)

public updateModelReceivedPosition(model: Model): Model source

import {updateModelReceivedPosition} from 'myscript/src/model/InkModel.js'

Update model lastReceivedPosition regarding to lastSentPosition

Params:

NameTypeAttributeDescription
model Model

Return:

Model

public updateModelRenderedPosition(model: Model, position: Number): Model source

import {updateModelRenderedPosition} from 'myscript/src/model/InkModel.js'

Update model lastRenderedPosition

Params:

NameTypeAttributeDescription
model Model
position Number
  • optional

Return:

Model

public updateModelSentPosition(model: Model, position: Number): Model source

import {updateModelSentPosition} from 'myscript/src/model/InkModel.js'

Update model lastSentPosition

Params:

NameTypeAttributeDescription
model Model
position Number
  • optional

Return:

Model

public updateRecognitionPositions(recognizerContext: RecognizerContext, positions: RecognitionPositions): RecognizerContext source

import {updateRecognitionPositions} from 'myscript/src/model/RecognizerContext.js'

Update the recognition context positions

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognizer context

positions RecognitionPositions

Current recognition positions

public updateUndoRedoState(undoRedoContext: UndoRedoContext): UndoRedoContext source

import {updateUndoRedoState} from 'myscript/src/model/UndoRedoContext.js'

Update the undo/redo state

Params:

NameTypeAttributeDescription
undoRedoContext UndoRedoContext

Current undo/redo context

Return:

UndoRedoContext

Updated undo/redo context

public waitForIdle(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback) source

WaitForIdle action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

callback RecognizerCallback

public zoom(recognizerContext: RecognizerContext, model: Model, value: Number, callback: RecognizerCallback) source

Zoom action

Params:

NameTypeAttributeDescription
recognizerContext RecognizerContext

Current recognition context

model Model

Current model

value Number
  • default: 10

Zoom value

callback RecognizerCallback