feat: add telegram-style resource stream

This commit is contained in:
TerryM
2026-05-25 05:25:57 +08:00
parent aaebd7ccd1
commit a784f159fe
45 changed files with 3201 additions and 1160 deletions

34
src/types/post.ts Normal file
View File

@@ -0,0 +1,34 @@
export type AttachmentKind = "image" | "video" | "document";
export type Attachment = {
id: string;
kind: AttachmentKind;
url: string;
mime: string;
filename: string;
sizeBytes: number;
width?: number;
height?: number;
durationSec?: number;
posterUrl?: string;
thumbnailUrl?: string;
};
export type Post = {
id: string;
categoryId: number;
categorySlug: string;
language: string;
text?: string;
attachments: Attachment[];
isRecommended: boolean;
publishedAt: string;
updatedAt: string;
};
export type PostListResponse = {
items: Post[];
nextCursor?: string;
};
export type PostScope = { kind: "all" } | { kind: "category"; slug: string };