Last date modified: 2025-Jul-02
Interface: IContentHighlightingApi
API used for managing highlights associated with a specific content highlighting feature on a specific piece of viewer content.
There will be a unique instance of this API for each content highlighting feature on each document loaded into each viewer type.
Extends
Properties
visible
readonlyvisible:boolean
Whether or not highlights are currently visible
NOTE: This property overrides the visibility of individual highlight sets without changing their visible property value
Methods
addHighlight()
addHighlight(
setId,target,highlightConfig?):Promise<HighlightMemento>
Adds a highlight to the given Set
Parameters
• setId: string
The SetID to add the highlight to
• target: CellRangeMemento | RectRangeMemento | TextRangeMemento | TimeRangeMemento
Object representing the location where the highlight will be added
• highlightConfig?: PartialHighlightConfig
Object that controls styling and behavior for highlights
Returns
Promise<HighlightMemento>
Inherited from
ITransientHighlightManagerApi.addHighlight
addHighlightTooltip()
addHighlightTooltip(
setId,highlightId,text,icon?):TooltipMemento
Adds a hover tooltip to a given highlight
Parameters
• setId: string
The set ID of the highlight where the tooltip will be added
• highlightId: string
The highlight ID of the highlight where the tooltip will be added
• text: string
Message to display in the tooltip
• icon?: string
Name of the RWC icon to display in the tooltip
Returns
Inherited from
ITransientHighlightManagerApi.addHighlightTooltip
addTerm()
addTerm(
setId,searchTerm,searchConfig?,termMetadata?):Promise<void>
Adds a search term to an existing term highlight set (created via the highlightTerm method above)
Parameters
• setId: string
The SetID to add the term and highlights to
• searchTerm: string
Term to search for and highlight
• searchConfig?: PartialTextSearchConfig
Object that controls search behavior for the term
• termMetadata?: UserDataMap
Object that will be included as a property on HighlightMemento objects passed to onadd event handlers (if any).
Returns
Promise<void>
Inherited from
ITransientHighlightManagerApi.addTerm
addTermWithContext()
addTermWithContext(
setId,searchTerm,context,searchConfig?,termMetadata?):Promise<void>
Adds a search term to an existing term highlight set (created via the highlightTerm method above)
Parameters
• setId: string
The SetID to add the term and highlights to
• searchTerm: string
Term to search for and highlight
• context: string
The context which the searchTerm must be contained within. if the context does not contain the searchTerm, an exception will be thrown.
• searchConfig?: PartialTextSearchConfig
DEPRECTATED: This parameter is no longer used by this method. It will be removed in a future version of the application. Object that controls search behavior for the term
• termMetadata?: UserDataMap
Object that will be included as a property on HighlightMemento objects passed to onadd event handlers (if any).
Returns
Promise<void>
Inherited from
ITransientHighlightManagerApi.addTermWithContext
addToSetGroup()
addToSetGroup(
groupId,setId):void
Adds the highlight set with the provided ID to the set group with the provided ID
Parameters
• groupId: string
Set group ID
• setId: string
Highlight set ID
Returns
void
createSet()
createSet(
highlightConfig?,setMetadata?):string
Creates a highlight set for location-based highlighting
Returns the SetID for future reference
Parameters
• highlightConfig?: PartialHighlightConfig
Range highlight set config
• setMetadata?: UserDataMap
Optional set metadata
Returns
string
Inherited from
ITransientHighlightManagerApi.createSet
createSetGroup()
createSetGroup(
id,options?):SetGroupMemento
Creates a new set group
Set group IDs do not need to be unique across instances of the IContentHighlightingApi. They are designed to stay in sync with other
set groups with the same ID across instances of the IContentHighlightingApi.
Parameters
• id: string
Set group ID
• options?: ISetGroupOptions
Optional set group options
Returns
Created set group
deleteSetGroup()
deleteSetGroup(
id):void
Deletes a set group
Parameters
• id: string
ID of the set group to delete
Returns
void
deselectAllAnnotations()
deselectAllAnnotations():
void
Deselects all annotations
Returns
void
Inherited from
ITransientHighlightManagerApi.deselectAllAnnotations
disableAutoHighlight()
disableAutoHighlight():
void
Turn off auto highlighting
Returns
void
Inherited from
ITransientHighlightManagerApi.disableAutoHighlight
doesSetExist()
doesSetExist(
setId):boolean
Returns boolean to determine existence. True, if it exists. False, if it does not exist.
Parameters
• setId: any
the SetID to check for existence
Returns
boolean
Inherited from
ITransientHighlightManagerApi.doesSetExist
emit()
emit(
eventName,event?):void
Emits a custom event
Parameters
• eventName: string
Event name
• event?: any
Event objects
Returns
void
enableAutoHighlight()
enableAutoHighlight(
setId,highlightConfig?):void
Enable highlighting based on user input for the set with the given id Auto highlighting will remain active until disableAutoHighlight is called
Parameters
• setId: string
The SetID to add the highlights to
• highlightConfig?: PartialHighlightConfig
Optional - theh highlight config to use
Returns
void
Inherited from
ITransientHighlightManagerApi.enableAutoHighlight
getHighlights()
getHighlights():
HighlightMemento[]
Gets all highlights
Returns
Array of highlights
getSelectedAnnotations()
getSelectedAnnotations():
HighlightMemento[]
Returns the currently selected annotations
Returns
An array of the selected annotations represented as HighlightMementos
Inherited from
ITransientHighlightManagerApi.getSelectedAnnotations
getSetGroups()
getSetGroups():
SetGroupMemento[]
Gets all sets groups
Returns
Array of set groups
getSets()
getSets():
HighlightSetMemento[]
Gets all highlight sets
Returns
Array of highlight sets
goToFirst()
goToFirst(
setId):Promise<HighlightMemento>
Selects the first highlight in a given highlightSet
Parameters
• setId: string
The SetID to remove the Highlight from
Returns
Promise<HighlightMemento>
the memento that was set to active
Inherited from
ITransientHighlightManagerApi.goToFirst
goToHighlight()
goToHighlight(
setId,highlightId):Promise<void>
Selects a specified highlight based on SetId and HighlightId Same as , created to provide consistency with teh "goTo" naming
Parameters
• setId: string
The SetID to remove the Highlight from
• highlightId: string
The TermID to select from the Highlight set
Returns
Promise<void>
Inherited from
ITransientHighlightManagerApi.goToHighlight
goToLast()
goToLast(
setId):Promise<HighlightMemento>
Selects the last highlight in a given highlightSet
Parameters
• setId: string
The SetID to remove the Highlight from
Returns
Promise<HighlightMemento>
the memento that was set to active
Inherited from
ITransientHighlightManagerApi.goToLast
goToNext()
goToNext(
setId):Promise<HighlightMemento>
Selects the next highlight in a given highlightSet
Parameters
• setId: string
The SetID to remove the Highlight from
Returns
Promise<HighlightMemento>
the memento that was set to active
Inherited from
ITransientHighlightManagerApi.goToNext
goToPrev()
goToPrev(
setId):Promise<HighlightMemento>
Selects the previous highlight in a given highlightSet
Parameters
• setId: string
The SetID to remove the Highlight from
Returns
Promise<HighlightMemento>
the memento that was set to active
Inherited from
ITransientHighlightManagerApi.goToPrev
hide()
hide():
void
Hide highlights
NOTE: This overrides the visibility of individual highlight sets without changing their visible property value
Returns
void
highlightTerm()
highlightTerm(
searchTerm,highlightConfig?,searchConfig?,termMetadata?,setMetadata?):string
Creates a highlight set for term-based highlighting and highlights the first term
Parameters
• searchTerm: string
Term to search for and highlight
• highlightConfig?: PartialHighlightConfig
Object that controls styling and behavior for highlights
• searchConfig?: PartialTextSearchConfig
Object that controls search behavior for the term
• termMetadata?: UserDataMap
Object that will be included as a property on HighlightMemento objects passed to onadd event handlers (if any).
• setMetadata?: UserDataMap
Optional set metadata
Returns
string
Inherited from
ITransientHighlightManagerApi.highlightTerm
highlightTermWithContext()
highlightTermWithContext(
searchTerm,context,highlightConfig?,searchConfig?,termMetadata?,setMetadata?):string
Creates a highlight set for term-based highlighting and highlights the first term
Parameters
• searchTerm: string
Term to search for and highlight
• context: string
The context which the searchTerm must be contained within. if the context does not contain the searchTerm, an exception will be thrown.
• highlightConfig?: PartialHighlightConfig
Object that controls styling and behavior for highlights
• searchConfig?: PartialTextSearchConfig
DEPRECTATED: This parameter is no longer used by this method. It will be removed in a future version of the application. Object that controls search behavior for the term
• termMetadata?: UserDataMap
Object that will be included as a property on HighlightMemento objects passed to onadd event handlers (if any).
• setMetadata?: UserDataMap
Optional set metadata
Returns
string
Inherited from
ITransientHighlightManagerApi.highlightTermWithContext
isTermHighlightingInProgress()
isTermHighlightingInProgress(
setId?):boolean
Checks whether any term searches are still in progress
Parameters
• setId?: string
Optional set ID to check for. If no value is provided, all sets will be checked
Returns
boolean
Whether any term searches are still in progress
off()
off(
eventName,handler):void
Unregisters an event handler for a custom event
Parameters
• eventName: string
Event name
• handler: ContentHighlightingApiCustomEventHandler
Event handler to unregister
Returns
void
offhighlightactivechange()
offhighlightactivechange(
handler):void
Unregisters an event handler for the highlightactivechange event
Parameters
• handler: ContentHighlightingApiHighlightActiveChangeHandler
Event handler to unregister
Returns
void
offhighlightadd()
offhighlightadd(
handler):void
Unregisters an event handler for the highlightadd event
Parameters
• handler: ContentHighlightingApiHighlightAddHandler
Event handler to unregister
Returns
void
offhighlightclick()
offhighlightclick(
handler):void
Unregisters an event handler for the highlightclick event
Parameters
• handler: ContentHighlightingApiHighlightClickHandler
Event handler to unregister
Returns
void
offhighlightmove()
offhighlightmove(
handler):void
Unregisters an event handler for the highlightmove event
Parameters
• handler: ContentHighlightingApiHighlightMoveHandler
Event handler to unregister
Returns
void
offhighlightremove()
offhighlightremove(
handler):void
Unregisters an event handler for the highlightremove event
Parameters
• handler: ContentHighlightingApiHighlightRemoveHandler
Event handler to unregister
Returns
void
offsearch()
offsearch(
handler):void
Unregisters an event handler for the search event
Parameters
• handler: ContentHighlightingApiSearchHandler
Event handler to unregister
Returns
void
offsearchcomplete()
offsearchcomplete(
handler):void
Unregisters an event handler for the searchcomplete event
Parameters
• handler: ContentHighlightingApiSearchCompleteHandler
Event handler to unregister
Returns
void
offsetadd()
offsetadd(
handler):void
Unregisters an event handler for the setadd event
Parameters
• handler: ContentHighlightingApiSetAddHandler
Event handler to unregister
Returns
void
offsetremove()
offsetremove(
handler):void
Unregisters an event handler for the setremove event
Parameters
• handler: ContentHighlightingApiSetRemoveHandler
Event handler to unregister
Returns
void
offsetvisiblechange()
offsetvisiblechange(
handler):void
Unregisters an event handler for the setvisiblechange event
Parameters
• handler: ContentHighlightingApiSetVisibleChangeHandler
Event handler to unregister
Returns
void
offvisiblechange()
offvisiblechange(
handler):void
Unregisters an event handler for the visiblechange event
Parameters
• handler: ContentHighlightingApiVisibleChangeHandler
Event handler to unregister
Returns
void
on()
on(
eventName,handler):void
Registers an event hander for a custom event
Parameters
• eventName: string
Event name
• handler: ContentHighlightingApiCustomEventHandler
Event handler to register
Returns
void
onhighlightactivechange()
onhighlightactivechange(
handler):void
Registers an event handler for the highlightactivechange event
This event indicates that the list of active highlight sets has changed.
Parameters
• handler: ContentHighlightingApiHighlightActiveChangeHandler
Event handler to register
Returns
void
onhighlightadd()
onhighlightadd(
handler):void
Registers an event handler for the highlightadd event
This event indicates that a new highlight has been added.
Parameters
• handler: ContentHighlightingApiHighlightAddHandler
Event handler to register
Returns
void
onhighlightclick()
onhighlightclick(
handler):void
Registers an event handler for the highlightclick event
This event indicates that a highlight has been clicked.
Parameters
• handler: ContentHighlightingApiHighlightClickHandler
Event handler to register
Returns
void
onhighlightmove()
onhighlightmove(
handler):void
Registers an event handler for the highlightmove event
This event indicates that a highlight has been moved.
Parameters
• handler: ContentHighlightingApiHighlightMoveHandler
Event handler to register
Returns
void
onhighlightremove()
onhighlightremove(
handler):void
Registers an event handler for the highlightremove event
This event indicates that a highlight has been removed.
Parameters
• handler: ContentHighlightingApiHighlightRemoveHandler
Event handler to register
Returns
void
onsearch()
onsearch(
handler):void
Registers an event handler for the search event
This event indicates that a new term search has been initiated.
Parameters
• handler: ContentHighlightingApiSearchHandler
Event handler to register
Returns
void
onsearchcomplete()
onsearchcomplete(
handler):void
Registers an event handler for the searchcomplete event
This event indicates that all term searches have completed for a given highlight set.
Parameters
• handler: ContentHighlightingApiSearchCompleteHandler
Event handler to register
Returns
void
onsetadd()
onsetadd(
handler):void
Registers an event handler for the setadd event
This event indicates that a new highlight set has been added.
Parameters
• handler: ContentHighlightingApiSetAddHandler
Event handler to register
Returns
void
onsetremove()
onsetremove(
handler):void
Registers an event handler for the setremove event
This event indicates that a highlight set has been removed.
Parameters
• handler: ContentHighlightingApiSetRemoveHandler
Event handler to register
Returns
void
onsetvisiblechange()
onsetvisiblechange(
handler):void
Registers an event handler for the setvisiblechange event
This event indicates that the visibility of a highlight set has changed.
Parameters
• handler: ContentHighlightingApiSetVisibleChangeHandler
Event handler to register
Returns
void
onvisiblechange()
onvisiblechange(
handler):void
Registers an event handler for the visiblechange event
This event indicates that the overall API visibility value has changed.
Parameters
• handler: ContentHighlightingApiVisibleChangeHandler
Event handler to register
Returns
void
removeFromSetGroup()
removeFromSetGroup(
groupId,setId):void
Removes the highlight set with the provided ID from the set group with the provided ID
Parameters
• groupId: string
Set group ID
• setId: string
Highlight set ID
Returns
void
removeHighlight()
removeHighlight(
setId,highlightId):void
Removes a highlight from a given Set
Parameters
• setId: string
The SetID to remove the Highlight from
• highlightId: string
The TermID to remove from the Highlight set
Returns
void
Inherited from
ITransientHighlightManagerApi.removeHighlight
removeHighlightSet()
removeHighlightSet(
setId):void
Removes a highlight Set
Parameters
• setId: string
The SetID to be removed
Returns
void
Inherited from
ITransientHighlightManagerApi.removeHighlightSet
removeHighlightTooltip()
removeHighlightTooltip(
setId,highlightId,tooltip):void
Removes the specified hover tooltip from a given highlight
Parameters
• setId: string
The set ID of the highlight where the tooltip will be removed
• highlightId: string
The set ID of the highlight where the tooltip will be removed
• tooltip: TooltipMemento
Object representing the specific tooltip that will be removed
Returns
void
Inherited from
ITransientHighlightManagerApi.removeHighlightTooltip
selectAnnotation()
selectAnnotation(
setId,highlightId):Promise<void>
Selects the provided annotation
Parameters
• setId: string
The SetID to select the Highlight from
• highlightId: string
The TermID to select from the Highlight set
Returns
Promise<void>
Inherited from
ITransientHighlightManagerApi.selectAnnotation
serialize()
serialize(
setId):HighlightSetMemento
Returns the Highlight Set object based on SetID
Parameters
• setId: any
the SetID to get object data from
Returns
Inherited from
ITransientHighlightManagerApi.serialize
setAllHighlightSetsVisibility()
setAllHighlightSetsVisibility(
visible):void
Sets the visible property of all highlight sets
NOTE: This value does not change the visibility of the feature.
Parameters
• visible: boolean
Whether the highlight sets should be visible or not
Returns
void
setGroupVisibility()
setGroupVisibility(
groupId,visible):void
Sets the visibility of the set group with the provided ID
Parameters
• groupId: string
Set group ID
• visible: boolean
Whether the set group should be visible or not
Returns
void
setHighlightSetVisibility()
setHighlightSetVisibility(
setId,visible):void
Sets visibility for a given highlightSet
Parameters
• setId: string
The SetID of the highlightSet to configure visibility on
• visible: boolean
Boolean to set highlightSet visibility
Returns
void
Inherited from
ITransientHighlightManagerApi.setHighlightSetVisibility
setHighlightVisibility()
setHighlightVisibility(
setId,highlightId,visible):void
Sets visibility for a given highlight
Parameters
• setId: string
The SetID of the highlight to configure visibility on
• highlightId: string
The Highlight ID of the highlight to configure visibility on
• visible: boolean
Boolean to set highlight visibility
Returns
void
Inherited from
ITransientHighlightManagerApi.setHighlightVisibility
setVisibility()
setVisibility(
visible):void
Set the visibility of highlights
NOTE: This overrides the visibility of individual highlight sets without changing their visible property value
Parameters
• visible: boolean
Whether the highlights should be visible or not
Returns
void
show()
show():
void
Show highlights
NOTE: This overrides the visibility of individual highlight sets without changing their visible property value
Returns
void
toggleHighlightSetVisibility()
toggleHighlightSetVisibility(
setId):void
Toggles visibility for a given Set
Parameters
• setId: string
The SetID to toggle visibility on
Returns
void
Inherited from
ITransientHighlightManagerApi.toggleHighlightSetVisibility
toggleHighlightVisibility()
toggleHighlightVisibility(
setId,highlightId):void
Toggles visibility for a given Set
Parameters
• setId: string
The SetID to toggle visibility on
• highlightId: string
The Highlight ID of the highlight to toggle visibility on
Returns
void
Inherited from
ITransientHighlightManagerApi.toggleHighlightVisibility
toggleVisibility()
toggleVisibility():
boolean
Toggle the visibility of highlights
NOTE: This overrides the visibility of individual highlight sets without changing their visible property value
Returns
boolean
waitForTermHighlightingToComplete()
waitForTermHighlightingToComplete():
Promise<void>
Waits for all term searches to complete
Returns
Promise<void>
On this page
- Interface: IContentHighlightingApi
- Extends
- Properties
- Methods
- addHighlight()
- addHighlightTooltip()
- addTerm()
- addTermWithContext()
- addToSetGroup()
- createSet()
- createSetGroup()
- deleteSetGroup()
- deselectAllAnnotations()
- disableAutoHighlight()
- doesSetExist()
- emit()
- enableAutoHighlight()
- getHighlights()
- getSelectedAnnotations()
- getSetGroups()
- getSets()
- goToFirst()
- goToHighlight()
- goToLast()
- goToNext()
- goToPrev()
- hide()
- highlightTerm()
- highlightTermWithContext()
- isTermHighlightingInProgress()
- off()
- offhighlightactivechange()
- offhighlightadd()
- offhighlightclick()
- offhighlightmove()
- offhighlightremove()
- offsearch()
- offsearchcomplete()
- offsetadd()
- offsetremove()
- offsetvisiblechange()
- offvisiblechange()
- on()
- onhighlightactivechange()
- onhighlightadd()
- onhighlightclick()
- onhighlightmove()
- onhighlightremove()
- onsearch()
- onsearchcomplete()
- onsetadd()
- onsetremove()
- onsetvisiblechange()
- onvisiblechange()
- removeFromSetGroup()
- removeHighlight()
- removeHighlightSet()
- removeHighlightTooltip()
- selectAnnotation()
- serialize()
- setAllHighlightSetsVisibility()
- setGroupVisibility()
- setHighlightSetVisibility()
- setHighlightVisibility()
- setVisibility()
- show()
- toggleHighlightSetVisibility()
- toggleHighlightVisibility()
- toggleVisibility()
- waitForTermHighlightingToComplete()