/* * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. */ import { l } from "@atproto/lex"; const $nsid = "app.bsky.richtext.facet"; export { $nsid }; /** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). */ type Tag = { $type?: "app.bsky.richtext.facet#tag";"tag":string }; export type { Tag }; /** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). */ const tag = /*#__PURE__*/ l.typedObject($nsid, "tag", /*#__PURE__*/ l.object({"tag":/*#__PURE__*/ l.string({"maxLength":640,"maxGraphemes":64})})); export { tag }; /** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */ type Link = { $type?: "app.bsky.richtext.facet#link";"uri":l.UriString }; export type { Link }; /** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */ const link = /*#__PURE__*/ l.typedObject($nsid, "link", /*#__PURE__*/ l.object({"uri":/*#__PURE__*/ l.string({"format":"uri"})})); export { link }; /** Annotation of a sub-string within rich text. */ type Main = { $type?: "app.bsky.richtext.facet";"index":ByteSlice;"features":(l.$Typed | l.$Typed | l.$Typed | l.Unknown$TypedObject)[] }; export type { Main }; /** Annotation of a sub-string within rich text. */ const main = /*#__PURE__*/ l.typedObject
($nsid, "main", /*#__PURE__*/ l.object({"index":/*#__PURE__*/ l.ref((() => byteSlice) as any),"features":/*#__PURE__*/ l.array(/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef((() => mention) as any),/*#__PURE__*/ l.typedRef((() => link) as any),/*#__PURE__*/ l.typedRef((() => tag) as any)], false), )})); export { main }; export const $type = $nsid; export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main); export const $build = /*#__PURE__*/ main.build.bind(main); export const $assert = /*#__PURE__*/ main.assert.bind(main); export const $check = /*#__PURE__*/ main.check.bind(main); export const $cast = /*#__PURE__*/ main.cast.bind(main); export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main); export const $matches = /*#__PURE__*/ main.matches.bind(main); export const $parse = /*#__PURE__*/ main.parse.bind(main); export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main); export const $validate = /*#__PURE__*/ main.validate.bind(main); export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main); /** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */ type Mention = { $type?: "app.bsky.richtext.facet#mention";"did":l.DidString }; export type { Mention }; /** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */ const mention = /*#__PURE__*/ l.typedObject($nsid, "mention", /*#__PURE__*/ l.object({"did":/*#__PURE__*/ l.string({"format":"did"})})); export { mention }; /** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. */ type ByteSlice = { $type?: "app.bsky.richtext.facet#byteSlice";"byteEnd":number;"byteStart":number }; export type { ByteSlice }; /** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. */ const byteSlice = /*#__PURE__*/ l.typedObject($nsid, "byteSlice", /*#__PURE__*/ l.object({"byteEnd":/*#__PURE__*/ l.integer({"minimum":0}),"byteStart":/*#__PURE__*/ l.integer({"minimum":0})})); export { byteSlice };