class Facet

A facet represents a span of text within a string with special meaning (e.g. mentions, links, tags).


constructor(text, facet)

Creates a new facet.


text: string

The full source text.

facet: AppBskyRichtextFacet.Main

The facet data.


sourceText: string

The original text the facet is contained within.

byteIndex: { byteEnd: number; byteStart: number; }

The range of bytes in the source text that this facet applies to, when the source text is encoded as UTF-8. Unless you know what you're doing, you should use the index property.


byteEnd: number

The index of the first byte excluded from the facet.

byteStart: number

The index of the first byte included in the facet.

features: FacetFeature[]

The decorations applied to the text within the facet range.



Returns a record representation of the facet.