Markerlist()

Class Markerlist

new Markerlist()

Creates an instance of Markerlist.

Methods

addMarker(start, end, id) → {object}

addMarker
Add Marker

Parameters:
Name Type Description
start number | object

start text offset

end number

end text offset

id string

id of marker

Returns:
object -

marker

forEachByRangeAffected(start, end, iteratee)

forEachByRangeAffected
Iterate markers affected by given range

Parameters:
Name Type Description
start number

start offset

end end

end offset

iteratee function

iteratee

getAll() → {Array.<object>}

getAll
Get markers all

Returns:
Array.<object> -

markers

getMarker(id) → {object}

getMarker
Get marker with given id

Parameters:
Name Type Description
id string

id of marker

Returns:
object -

marker

getMarkersData() → {object}

getMarkersData
Get marker data to export

Returns:
object -

markers data

removeMarker(id) → {marker}

removeMarker
Remove marker with given id

Parameters:
Name Type Description
id string

of marker that should be removed

Returns:
marker -

removed marker

resetMarkers()

resetMarkers
Reset markerlist

sortBy(rangeKey,)

sortBy
Sort markers with given key of marker

Parameters:
Name Type Description
rangeKey, string

start or end

updateMarker(id, obj) → {object}

updateMarker
Update marker with extra information

Parameters:
Name Type Description
id string

id of marker

obj object

extra information

Returns:
object -

marker