/* * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. */ import { l } from "@atproto/lex"; import * as EmbedImages from "../embed/images.defs.js"; import * as EmbedVideo from "../embed/video.defs.js"; import * as EmbedGallery from "../embed/gallery.defs.js"; import * as EmbedExternal from "../embed/external.defs.js"; import * as EmbedRecord from "../embed/record.defs.js"; import * as EmbedRecordWithMedia from "../embed/recordWithMedia.defs.js"; import * as RichtextFacet from "../richtext/facet.defs.js"; import * as LabelDefs from "../../../com/atproto/label/defs.defs.js"; import * as RepoStrongRef from "../../../com/atproto/repo/strongRef.defs.js"; const $nsid = "app.bsky.feed.post"; export { $nsid }; /** Record containing a Bluesky post. */ type Main = { $type: "app.bsky.feed.post"; /** * Additional hashtags, in addition to any included in post text and facets. */ "tags"?:(string)[]; /** * The primary post content. May be an empty string, if there are embeds. */ "text":string;"embed"?:l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.Unknown$TypedObject; /** * Indicates human language of post primary text content. */ "langs"?:(l.LanguageString)[];"reply"?:ReplyRef; /** * Annotations of text (mentions, URLs, hashtags, etc) */ "facets"?:(RichtextFacet.Main)[]; /** * Self-label values for this post. Effectively content warnings. */ "labels"?:l.$Typed | l.Unknown$TypedObject; /** * @deprecated replaced by app.bsky.richtext.facet. */ "entities"?:(Entity)[]; /** * Client-declared timestamp when this post was originally created. */ "createdAt":l.DatetimeString }; export type { Main }; /** Record containing a Bluesky post. */ const main = /*#__PURE__*/ l.record<"tid", Main>("tid", $nsid, /*#__PURE__*/ l.object({"tags":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string({"maxLength":640,"maxGraphemes":64}), {"maxLength":8})),"text":/*#__PURE__*/ l.string({"maxLength":3000,"maxGraphemes":300}),"embed":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef((() => EmbedImages.main) as any),/*#__PURE__*/ l.typedRef((() => EmbedVideo.main) as any),/*#__PURE__*/ l.typedRef((() => EmbedGallery.main) as any),/*#__PURE__*/ l.typedRef((() => EmbedExternal.main) as any),/*#__PURE__*/ l.typedRef((() => EmbedRecord.main) as any),/*#__PURE__*/ l.typedRef((() => EmbedRecordWithMedia.main) as any)], false)),"langs":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string({"format":"language"}), {"maxLength":3})),"reply":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => replyRef) as any)),"facets":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => RichtextFacet.main) as any), )),"labels":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef((() => LabelDefs.selfLabels) as any)], false)),"entities":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => entity) as any), )),"createdAt":/*#__PURE__*/ l.string({"format":"datetime"})})); 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); /** @deprecated use facets instead. */ type Entity = { $type?: "app.bsky.feed.post#entity"; /** * Expected values are 'mention' and 'link'. */ "type":string;"index":TextSlice;"value":string }; export type { Entity }; /** @deprecated use facets instead. */ const entity = /*#__PURE__*/ l.typedObject($nsid, "entity", /*#__PURE__*/ l.object({"type":/*#__PURE__*/ l.string(),"index":/*#__PURE__*/ l.ref((() => textSlice) as any),"value":/*#__PURE__*/ l.string()})); export { entity }; type ReplyRef = { $type?: "app.bsky.feed.post#replyRef";"root":RepoStrongRef.Main;"parent":RepoStrongRef.Main }; export type { ReplyRef }; const replyRef = /*#__PURE__*/ l.typedObject($nsid, "replyRef", /*#__PURE__*/ l.object({"root":/*#__PURE__*/ l.ref((() => RepoStrongRef.main) as any),"parent":/*#__PURE__*/ l.ref((() => RepoStrongRef.main) as any)})); export { replyRef }; /** * A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. * @deprecated . Use app.bsky.richtext instead */ type TextSlice = { $type?: "app.bsky.feed.post#textSlice";"end":number;"start":number }; export type { TextSlice }; /** * A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. * @deprecated . Use app.bsky.richtext instead */ const textSlice = /*#__PURE__*/ l.typedObject($nsid, "textSlice", /*#__PURE__*/ l.object({"end":/*#__PURE__*/ l.integer({"minimum":0}),"start":/*#__PURE__*/ l.integer({"minimum":0})})); export { textSlice };