bsky.lexicons.app.bsky.embed

AtProto lexicons record types of app.bsky.embed.*
struct AspectRatio;
app.bsky.embed.defs.aspectRatio
width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.
int width;
Width
minimum = 1
int height;
Height
minimum = 1
struct Images;
app.bsky.embed.images: Embed data of images
A set of images embedded in a Bluesky record (eg, a post).
struct ViewImage;
app.bsky.embed.images#viewImage
string thumb;
Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.
string fullsize;
Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.
string alt;
Alt text description of the image, for accessibility.
AspectRatio aspectRatio;
struct View;
app.bsky.embed.images#view
ViewImage[] images;
string type;
Type
struct Image;
Image[] images;
Images data
Blob image;
Blob of image
string alt;
Alt text
AspectRatio aspectRatio;
Aspect ratio
pure nothrow @nogc @safe this(Image[] images);
pure nothrow @safe this(Image image);
pure nothrow @safe this(Blob blob, string alt, AspectRatio aspect = AspectRatio.init);
pure nothrow @safe this(Blob blob, string alt, int width, int height);
Constructor
struct External;
app.bsky.embed.external: Embed data of external link
A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).
struct ViewExternal;
app.bsky.embed.external#viewExternal
string uri;
string title;
string description;
string thumb;
struct View;
app.bsky.embed.external#view
ViewExternal external;
string type;
Type
struct External;
External external;
External data
string uri;
URL of external link
string title;
Title of external link
string description;
Descriptions
Blob thumb;
Thumbnail of external link
pure nothrow @nogc @safe this(External external);
Constructor
struct Record;
app.bsky.embed.record: Embed data of record
A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.
struct ViewRecord;
app.bsky.embed.record#viewRecord
string uri;
string cid;
ProfileViewBasic author;
JSONValue value;
Label[] labels;
size_t replyCount;
size_t repostCount;
size_t likeCount;
size_t quoteCount;
SumType!(Images.View, Video.View, External.View, View, RecordWithMedia.View)[] embeds;
SysTime indexedAt;
struct View;
app.bsky.embed.external#view
JSONValue record;
string type;
Type
alias Record = bsky.lexicons.com.atproto.repo.StrongRef;
Record record;
Record data
pure nothrow @nogc @safe this(Record record);
pure nothrow @nogc @safe this(string uri, string cid);
Constructor
struct RecordWithMedia;
Embed data of external link
Examples: ditto
import std.json;
import bsky._internal.json;
auto rwm = RecordWithMedia(
	record: Record("at://test.bsly.social/app.bsky.feed.post/3kpadeirzya27", "abcde"),
	image: Images.Image(Blob.init, "test"));
auto jv = rwm.serializeToJson();
assert(jv.getValue!string("$type") == "app.bsky.embed.recordWithMedia");
assert("record" in jv);
assert("record" in jv["record"]);
assert("media" in jv);
assert(jv["record"]["record"].type == JSONType.object);
assert(jv["record"]["record"].getValue!string("uri") == "at://test.bsly.social/app.bsky.feed.post/3kpadeirzya27");
assert(jv["record"]["record"].getValue!string("cid") == "abcde");
assert(jv["media"].getValue!string("$type") == "app.bsky.embed.images");
auto rwm2 = jv.deserializeFromJson!RecordWithMedia;
assert(rwm == rwm2);
struct View;
app.bsky.embed.recordWithMedia#view
Record.View record;
SumType!(Images.View, Video.View, External.View) media;
string type;
Type
Record record;
Record data
alias Media = std.sumtype.SumType!(Images, Video, External).SumType;
Media media;
Image/External data
pure nothrow @nogc @safe this(Record record, Media media);
pure nothrow @nogc @safe this(Record record, External external);
pure nothrow @nogc @safe this(Record record, Images images);
pure nothrow @safe this(Record record, Images.Image image);
pure nothrow @nogc @safe this(Record record, Video video);
pure nothrow @nogc @safe this(StrongRef record, Media media);
pure nothrow @nogc @safe this(StrongRef record, External external);
pure nothrow @safe this(StrongRef record, Images.Image image);
pure nothrow @nogc @safe this(StrongRef record, Images images);
pure nothrow @nogc @safe this(StrongRef record, Video video);
Constructor
struct Video;
app.bsky.embed.video: Embed data of video
A video embedded in a Bluesky record (eg, a post).
struct View;
app.bsky.embed.video#view
string cid;
string playlist;
string thumbnail;
string alt;
AspectRatio aspectRatio;
string type;
Type
Blob video;
Video data
struct Caption;
Caption[] captions;
Caption data
string lang;
Language
Blob file;
File
Accept: text/vtt
string alt;
Alt string
Alt text description of the video, for accessibility.
AspectRatio aspectRatio;
Aspect ratio
alias Embed = std.sumtype.SumType!(Images, External, Record, RecordWithMedia, Video).SumType;