Skip to main content

NusaCustomControlType Interface

Implements mandatory members that allow you to bind the RichEdit control to the Nuance SpeechKit.

Declaration

export interface NusaCustomControlType

Properties

newlineFormat Property

Specifies the escape sequence for the line break in the Rich Text Editor.

Declaration

newlineFormat: string

Property Value

Type Description
string

The string value that is equal to the LineBreak value.

paragraphFormat Property

Specifies the escape sequence for the paragraph break in the Rich Text Editor.

Declaration

paragraphFormat: string

Property Value

Type Description
string

The string value that is equal to the ParagraphBreak value.

Methods

getSelection(element) Method

Returns the current selection range in the RichEdit control.

Declaration

getSelection(element: HTMLElement): {
    start: number;
    length: number;
}

Parameters

Name Type Description
element HTMLElement

An HTML element that represents the RichEdit control.

Returns

Type Description
{length: number, start: number}

An object that contains the length and start position of the selection in the RichEdit control.

getSelectionText(element) Method

Returns the selected text in the RichEdit control.

Declaration

getSelectionText(
    element: HTMLElement
): string

Parameters

Name Type Description
element HTMLElement

An HTML element that represents the RichEdit control.

Returns

Type Description
string

The selected text.

getText(element) Method

Returns the RichEdit control document’s textual representation.

Declaration

getText(
    element: HTMLElement
): string

Parameters

Name Type Description
element HTMLElement

An HTML element that represents the RichEdit control.

Returns

Type Description
string

The document text.

replaceText(element, text, fromPos, length) Method

Replaces the text in the RichEdit.

Declaration

replaceText(
    element: HTMLElement,
    text: string,
    fromPos: number,
    length: number
): void

Parameters

Name Type Description
element HTMLElement

An HTML element that represents the RichEdit control.

text string

The replacement text.

fromPos number

The start position of text to be replaced.

length number

The length of text to be replaced.

setSelection(element, start, length) Method

Sets the selection in the the RichEdit control.

Declaration

setSelection(
    element: HTMLElement,
    start: number,
    length: number
): void

Parameters

Name Type Description
element HTMLElement

An HTML element that represents the RichEdit control.

start number

The start position of the selection.

length number

The selection length.