HighlightRange

HighlightRange

new HighlightRange(highlight, props) → {HighlightRange}

Source:
Properties:
Name Type Description
guid string

Unique GUID for range.

highlight Highlight

Highlight object with which the range is associated with.

start number

Stores start index of range from text.

end number

Stores end index of range from text.

text string

Stores Text for the highlight as string.

Main Highlight Range Class, it will be used to create ranges for highlights in DCR

Parameters:
Name Type Description
highlight Highlight

A graph object of the current application is passed so it can be used to update the garph easily.

props object

An object is passed with basic or updates to basic properties of the range object, currently we don't mutate the props but in future it will be supported.

Returns:

Returns HighlightRange Object.

Type
HighlightRange

Methods

(static) getPosition() → {object}

Source:

Get postion of a range containing start and end value of the range.

Returns:

Returns an object with postions of a range.

Type
object

(static) updatePosition(positions) → {HighlightRange}

Source:

Updates start/End positions for a range

Parameters:
Name Type Description
positions object

An object with positions is to be passed, e-g: {start = null; end = null;}.

Returns:

Returns an object of HighlightRange Class.

Type
HighlightRange