/* * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. */ import { l } from "@atproto/lex"; import * as RepoStrongRef from "../../../com/atproto/repo/strongRef.defs.js"; import * as LabelDefs from "../../../com/atproto/label/defs.defs.js"; import * as ActorDefs from "../actor/defs.defs.js"; const $nsid = "app.bsky.embed.external"; export { $nsid }; /** A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). */ type Main = { $type?: "app.bsky.embed.external";"external":External }; export type { Main }; /** A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). */ const main = /*#__PURE__*/ l.typedObject
($nsid, "main", /*#__PURE__*/ l.object({"external":/*#__PURE__*/ l.ref((() => external) as any)})); 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); type View = { $type?: "app.bsky.embed.external#view";"external":ViewExternal }; export type { View }; const view = /*#__PURE__*/ l.typedObject($nsid, "view", /*#__PURE__*/ l.object({"external":/*#__PURE__*/ l.ref((() => viewExternal) as any)})); export { view }; /** RGB color definition, inspired by site.standard.theme.color#rgb */ type ColorRGB = { $type?: "app.bsky.embed.external#colorRGB";"b":number;"g":number;"r":number }; export type { ColorRGB as ColorRgb }; /** RGB color definition, inspired by site.standard.theme.color#rgb */ const colorRGB = /*#__PURE__*/ l.typedObject($nsid, "colorRGB", /*#__PURE__*/ l.object({"b":/*#__PURE__*/ l.integer({"maximum":255,"minimum":0}),"g":/*#__PURE__*/ l.integer({"maximum":255,"minimum":0}),"r":/*#__PURE__*/ l.integer({"maximum":255,"minimum":0})})); export { colorRGB }; type External = { $type?: "app.bsky.embed.external#external";"uri":l.UriString;"thumb"?:l.BlobRef;"title":string;"description":string; /** * StrongRefs (uri+cid) of the Atmosphere records that backed this view. */ "associatedRefs"?:(RepoStrongRef.Main)[] }; export type { External }; const external = /*#__PURE__*/ l.typedObject($nsid, "external", /*#__PURE__*/ l.object({"uri":/*#__PURE__*/ l.string({"format":"uri"}),"thumb":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.blob({"accept":["image/*"],"maxSize":1000000})),"title":/*#__PURE__*/ l.string(),"description":/*#__PURE__*/ l.string(),"associatedRefs":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => RepoStrongRef.main) as any), ))})); export { external }; type ViewExternal = { $type?: "app.bsky.embed.external#viewExternal";"uri":l.UriString;"thumb"?:l.UriString;"title":string;"labels"?:(LabelDefs.Label)[];"source"?:ViewExternalSource; /** * When the external content was created, if available. Example: a publication date, for an article. */ "createdAt"?:l.DatetimeString; /** * When the external content was updated, if available. */ "updatedAt"?:l.DatetimeString;"description":string; /** * Estimated reading time in minutes, if applicable and available. */ "readingTime"?:number; /** * StrongRefs (uri+cid) of the Atmosphere records that backed this view. */ "associatedRefs"?:(RepoStrongRef.Main)[]; /** * Profiles of the owners of the Atmosphere records that backed this view. */ "associatedProfiles"?:(ActorDefs.ProfileViewBasic)[] }; export type { ViewExternal }; const viewExternal = /*#__PURE__*/ l.typedObject($nsid, "viewExternal", /*#__PURE__*/ l.object({"uri":/*#__PURE__*/ l.string({"format":"uri"}),"thumb":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({"format":"uri"})),"title":/*#__PURE__*/ l.string(),"labels":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => LabelDefs.label) as any), )),"source":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => viewExternalSource) as any)),"createdAt":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({"format":"datetime"})),"updatedAt":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({"format":"datetime"})),"description":/*#__PURE__*/ l.string(),"readingTime":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()),"associatedRefs":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => RepoStrongRef.main) as any), )),"associatedProfiles":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => ActorDefs.profileViewBasic) as any), ))})); export { viewExternal }; /** The source of an external embed, such as a standard.site publication. */ type ViewExternalSource = { $type?: "app.bsky.embed.external#viewExternalSource"; /** * URI of the source, if available. Example: the https:// URL of a site.standard.publication record. */ "uri":l.UriString; /** * Fully-qualified URL where an icon representing the source can be fetched. For example, CDN location provided by the App View. */ "icon"?:l.UriString;"theme"?:ViewExternalSourceTheme;"title":string;"description"?:string }; export type { ViewExternalSource }; /** The source of an external embed, such as a standard.site publication. */ const viewExternalSource = /*#__PURE__*/ l.typedObject($nsid, "viewExternalSource", /*#__PURE__*/ l.object({"uri":/*#__PURE__*/ l.string({"format":"uri"}),"icon":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({"format":"uri"})),"theme":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => viewExternalSourceTheme) as any)),"title":/*#__PURE__*/ l.string(),"description":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string())})); export { viewExternalSource }; /** The theme colors of an external source, such as a site.standard.publication. These colors may be used when rendering an embed from that source. */ type ViewExternalSourceTheme = { $type?: "app.bsky.embed.external#viewExternalSourceTheme";"accentRGB"?:ColorRGB;"backgroundRGB"?:ColorRGB;"foregroundRGB"?:ColorRGB;"accentForegroundRGB"?:ColorRGB }; export type { ViewExternalSourceTheme }; /** The theme colors of an external source, such as a site.standard.publication. These colors may be used when rendering an embed from that source. */ const viewExternalSourceTheme = /*#__PURE__*/ l.typedObject($nsid, "viewExternalSourceTheme", /*#__PURE__*/ l.object({"accentRGB":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => colorRGB) as any)),"backgroundRGB":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => colorRGB) as any)),"foregroundRGB":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => colorRGB) as any)),"accentForegroundRGB":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => colorRGB) as any))})); export { viewExternalSourceTheme };