Last date modified: 2025-Jul-02

Interface: HighlightMemento

The configuration object for [[Highlight]] objects. Like [[HighlightConfig]] but the properties are all optional. This type is used when creating new highlight sets.

Extends

Properties

activationMode?

optionalactivationMode: HighlightActivationMode

Controls how the highlight is rendered when it is active and inactive.

Inherited from

PartialHighlightConfig.activationMode


activeStyle?

optionalactiveStyle: HighlightStyle

The style to use for the highlight when it is active

Inherited from

PartialHighlightConfig.activeStyle


allowDelete?

optionalallowDelete: boolean

Determines if the highlight can be deleted, default is false

Inherited from

PartialHighlightConfig.allowDelete


allowMove?

optionalallowMove: boolean

Determines if the highlight can be moved, default is false

Inherited from

PartialHighlightConfig.allowMove


allowResize?

optionalallowResize: boolean

Determines if the highlight can be resized, default is false

Inherited from

PartialHighlightConfig.allowResize


borderColor?

optionalborderColor: string

The border color. This property is ignored for text highlights and for any highlights where borderLineType is LineType.none.

The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the inverse of the fill color will be used. The border color for a highlight may be changed at any time by setting the [[Highlight.borderColor]] property.

Inherited from

PartialHighlightConfig.borderColor


borderLineType?

optionalborderLineType: LineType

The border line type. This property is ignored for text highlights.

If not specified, the default value of LineType.none will be used (resulting in no border). The line type for a highlight may be changed at any time by setting the [[Highlight.borderLineType]] property.

Inherited from

PartialHighlightConfig.borderLineType


borderWidth?

optionalborderWidth: number

The border width in pixels. This property is ignored for text highlights and for any highlights where borderLineType is LineType.none.

If not specified, the default value of 1 pixel will be used. The line type for a highlight may be changed at any time by setting the [[Highlight.borderLineType]] property.

Inherited from

PartialHighlightConfig.borderWidth


compound?

optionalcompound: boolean


cssClass?

optionalcssClass: string

A CSS class or space-separated list of classes to apply to the highlighted text. This property is ignored for cell and rectangular highlights.

Note that this property must be used very carefully to avoid affecting the layout of the text. Any CSS properties that change the box size or visibility of the text will cause layout issues in the viewer.

If not specified, the CSS class for the text will not be altered by the highlight. The CSS class for a highlight may be changed at any time by setting the [[Highlight.cssClass]] property.

Inherited from

PartialHighlightConfig.cssClass


enableDelete?

optionalenableDelete: boolean

Controls whether the user is able to delete the highlight by pressing the DELETE key while the highlight is active.

If not specified, defaults to false. This value may be changed at any time by setting the [[Highlight.enableDelete]] property.

Inherited from

PartialHighlightConfig.enableDelete


enableMove?

optionalenableMove: boolean

Controls whether the user is able to move the highlight using the mouse, touch, or keyboard while the highlight is active. This property is ignored for text highlights.

If not specified, defaults to false. This value may be changed at any time by setting the [[Highlight.enableMove]] property.

Inherited from

PartialHighlightConfig.enableMove


enableResize?

optionalenableResize: boolean

Controls whether the user is able to resize the highlight using the mouse, touch, or keyboard while the highlight is active. This property is ignored for text highlights.

If not specified, defaults to false. This value may be changed at any time by setting the [[Highlight.enableResize]] property.

Inherited from

PartialHighlightConfig.enableResize


fillColor?

optionalfillColor: string

The background fill color for text and rectangular highlights. The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the default will be based on the highlight properties: white (#fff) for cross redactions black (#000) for other redactions transparent yellow (rgba(255,255,0,0.5)) for highlights

The fill color for a highlight may be changed at any time by setting the [[Highlight.fillColor]] property.

Inherited from

PartialHighlightConfig.fillColor


highlightId

highlightId: string


image?

optionalimage: HighlightImage

The image to draw over the highlight. This property is ignored for text highlights.

The only supported value is "cross", which draws a diagonal cross and outline over the highlight in the inverse of the highlight color.

If not specified, no image will be drawn. The highlight image may be changed at any time by setting the [[Highlight.image]] property.

Inherited from

PartialHighlightConfig.image


inverse?

optionalinverse: boolean

If true, the highlight will be treated as an inverse redaction - that is, the full page will be redacted except or the highlight range. If there are multiple inverse redactions on the page, they will each be subtracted from the full page redaction.

This property is only supported for rectangular redactions. If specified for any other type of highlight, it will be ignored.

If not specified, defaults to false. The inverse flat may not be changed once a highlight is created.

Inherited from

PartialHighlightConfig.inverse


label?

optionallabel: string

A string value specifying a label to attach to each highlight. This property is ignored for text highlights.

If not specified, the highlight will no label. The label may be changed at any time by setting the [[Highlight.label]] property.

Inherited from

PartialHighlightConfig.label


labelColor?

optionallabelColor: string

The color for text labels. This property is ignored for text highlights and highlights without labels.

The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the inverse of the fill color will be used. The label color for a highlight may be changed at any time by setting the [[Highlight.labelColor]] property.

Inherited from

PartialHighlightConfig.labelColor


labelFontFace?

optionallabelFontFace: string

The label font name. This property is ignored for text highlights and for any highlights without a label.

If not specified, defaults to "Arial". The label font may be changed at any time by setting the [[Highlight.labelFont]] property.

Inherited from

PartialHighlightConfig.labelFontFace


labelFontSize?

optionallabelFontSize: FontSizeOrAuto

The label font size. This property is ignored for text highlights and for any highlights without a label.

May be a numeric value in points, a [[FontSize]] object with a size in either points or pixels, or "auto" to automatically scale the label with the size of the highlight.

If not specified, defaults to "auto". The label size may be changed at any time by setting the [[Highlight.labelFontSize]] property.

Inherited from

PartialHighlightConfig.labelFontSize


labelFontWeight?

optionallabelFontWeight: FontWeight

The label font weight. This property is ignored for text highlights and for any highlights without a label.

If not specified, defaults to FontWeight.normal. The label font weight may be changed at any time by setting the [[Highlight.labelFontWeight]] property.

Inherited from

PartialHighlightConfig.labelFontWeight


range

range: HighlightRange

The range affected by the highlight For now, we need to expose the raw range object to maintain backwards compatibility and not break existing callers of this method. In the future, this will be downgraded to a memento object


redaction?

optionalredaction: boolean

If true, the highlight will be treated as a redaction.

If not specified, defaults to false. The redaction flag may not be changed once a highlight is created.

Inherited from

PartialHighlightConfig.redaction


relativeOrder?

optionalrelativeOrder: RelativeOrderType

For cell highlights, controls whether the highlight renders above embeddings, or below embeddings.

If not specified, defaults to aboveEmbeddings.

Inherited from

PartialHighlightConfig.relativeOrder


reversion?

optionalreversion: boolean

If true, the highlight will be treated as a redaction reversion. Any redacted cells under a redaction reversion will be displayed unredacted.

Redaction reversions are only supported for cell redactions in spreadsheets. For cell highlights and rectangular and text highlights and redactions, this flag is ignored.

All other [[HighlightStyle]] properties (fill color, label properties, etc.) are ignored for reversions.

If not specified, defaults to false. The reversion flag may not be changed once a highlight is created.

Inherited from

PartialHighlightConfig.reversion


strokeColor?

optionalstrokeColor: string

The stroke color for cross redactions. This property is ignored for other highlight types.

The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the inverse of the fill color will be used. The stroke color for a highlight may be changed at any time by setting the [[Highlight.strokeColor]] property.

Inherited from

PartialHighlightConfig.strokeColor


term?

optionalterm: string


termContext?

optionaltermContext: string


termMetadata?

optionaltermMetadata: any


textColor?

optionaltextColor: string

The text color for text highlights. The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the text color will not be altered by the highlight. The text color for a highlight may be changed at any time by setting the [[Highlight.textColor]] property.

Inherited from

PartialHighlightConfig.textColor


userData?

optionaluserData: UserDataMap

User data to apply to any highlights created using this PartialRangeHighlightConfig. The individual properties in this userData object are copied by value to each highlight.

Inherited from

PartialHighlightConfig.userData


visible?

optionalvisible: boolean

Return to top of the page
Feedback