import type { AppBskyRichtextFacet } from "@atcute/bluesky"; /** * A facet represents a span of text within a string with special meaning (e.g. mentions, links, tags). * @see https://docs.bsky.app/docs/advanced-guides/post-richtext#rich-text-facets */ export declare class Facet { /** The original text the facet is contained within. */ sourceText: string; /** 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 {@link index} property. */ byteIndex: { /** The index of the first byte included in the facet. */ byteStart: number; /** The index of the first byte excluded from the facet. */ byteEnd: number; }; private _index?; /** The decorations applied to the text within the facet range. */ features: Array; /** The span of text this facet applies to. */ get span(): string; /** * The range of indices within the source text that this facet applies to. * @property start The index of the first character included in the facet. * @property end The index of the first character excluded from the facet. */ get index(): { start: number; end: number; }; /** * Creates a new facet. * @param text The full source text. * @param facet The facet data. */ constructor(text: string, facet: AppBskyRichtextFacet.Main); /** * Returns a record representation of the facet. */ toRecord(): AppBskyRichtextFacet.Main; } /** Represents a decoration applied to a span of text. */ export declare class FacetFeature { $type: `app.bsky.richtext.facet#${string}`; /** Whether this facet is a mention. */ isMention(): this is MentionFeature; /** Whether this facet is a link. */ isLink(): this is LinkFeature; /** Whether this facet is an in-text hashtag. */ isTag(): this is TagFeature; /** Represents a specific decoration applied to a span of text. */ /** @internal */ constructor(/** The facet type. */ $type: `app.bsky.richtext.facet#${string}`); } /** Represents a user mention. */ export declare class MentionFeature extends FacetFeature { did: string; $type: "app.bsky.richtext.facet#mention"; constructor(/** The mentioned user's DID. */ did: string); } /** Represents a hyperlink. */ export declare class LinkFeature extends FacetFeature { uri: string; $type: "app.bsky.richtext.facet#link"; constructor(/** The referenced link. */ uri: string); } /** Represents an in-text hashtag. */ export declare class TagFeature extends FacetFeature { tag: string; $type: "app.bsky.richtext.facet#tag"; constructor(/** The hashtag, without the leading #. */ tag: string); }