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).
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).
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.
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);
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).
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