Something went wrong. Try again.
your personal website on atproto - mirror blento.app
Something went wrong. Try again.
1.8 kB · 115 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116export type PostEmbedImage = { type: 'images';
images: { alt: string; thumb: string; fullsize: string; aspectRatio?: { width: number; height: number; }; }[];};
export type PostEmbedExternal = { type: 'external';
external: { href: string; thumb: string; title: string; description: string; };};
export type PostEmbedVideo = { type: 'video';
video: { playlist: string;
thumb: string; alt: string;
aspectRatio?: { width: number; height: number; }; };};
export type QuotedPostData = { author: { displayName: string; handle: string; avatar?: string; href?: string; }; href?: string; htmlContent?: string; createdAt?: string; embed?: PostEmbed;};
export type PostEmbedRecord = { type: 'record'; record: QuotedPostData;};
export type PostEmbedRecordWithMedia = { type: 'recordWithMedia'; record: QuotedPostData; media: PostEmbed;};
export type UnknownEmbed = { type: 'unknown';} & Record<string, unknown>;
export type PostEmbed = | PostEmbedImage | PostEmbedExternal | PostEmbedVideo | PostEmbedRecord | PostEmbedRecordWithMedia | UnknownEmbed;
export type PostData = { href?: string; id?: string;
reposted?: { handle: string; href: string }; replyTo?: { handle: string; href: string };
author: { displayName: string; handle: string; avatar?: string; href?: string; };
replyCount: number; repostCount: number; likeCount: number;
createdAt: string;
embed?: PostEmbed;
htmlContent?: string;
replies?: PostData[];
labels?: string[];};
export const nsfwLabels = ['porn', 'sexual', 'graphic-media', 'nudity'];
export function hasNSFWLabel(post: PostData): boolean { if (!post.labels) return false;
return post.labels.some((label) => nsfwLabels.includes(label));}
export { default as Post } from './Post.svelte';