2026-05-26 12:07:13 +08:00
|
|
|
export type PostLocaleCode = "zh" | "en" | "ja" | "ko" | "vi" | "id" | "ms";
|
|
|
|
|
|
|
|
|
|
export type PostType =
|
|
|
|
|
| "image"
|
|
|
|
|
| "video"
|
|
|
|
|
| "music"
|
|
|
|
|
| "ppt"
|
|
|
|
|
| "pdf"
|
|
|
|
|
| "link"
|
|
|
|
|
| "text"
|
|
|
|
|
| "archive";
|
|
|
|
|
|
|
|
|
|
export type PostTypeFilter = PostType | "all";
|
2026-05-25 05:25:57 +08:00
|
|
|
export type AttachmentKind = "image" | "video" | "document";
|
|
|
|
|
|
2026-05-26 12:07:13 +08:00
|
|
|
export type PostLocaleTexts = {
|
|
|
|
|
text: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type PostLocalizations = Record<PostLocaleCode, PostLocaleTexts>;
|
|
|
|
|
|
2026-05-25 05:25:57 +08:00
|
|
|
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;
|
2026-05-26 12:07:13 +08:00
|
|
|
postType?: PostType | string;
|
2026-05-25 05:25:57 +08:00
|
|
|
categoryId: number;
|
|
|
|
|
categorySlug: string;
|
|
|
|
|
language: string;
|
2026-05-26 12:07:13 +08:00
|
|
|
sourceLanguage?: string;
|
2026-05-25 05:25:57 +08:00
|
|
|
text?: string;
|
2026-05-26 12:07:13 +08:00
|
|
|
localizations?: Partial<PostLocalizations>;
|
2026-05-25 05:25:57 +08:00
|
|
|
attachments: Attachment[];
|
|
|
|
|
isRecommended: boolean;
|
|
|
|
|
publishedAt: string;
|
2026-05-26 12:07:13 +08:00
|
|
|
updatedAt?: string;
|
|
|
|
|
createdAt?: string;
|
|
|
|
|
tags?: string[];
|
2026-05-25 05:25:57 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type PostListResponse = {
|
|
|
|
|
items: Post[];
|
|
|
|
|
nextCursor?: string;
|
|
|
|
|
};
|
|
|
|
|
|
2026-05-26 12:07:13 +08:00
|
|
|
export type PostDownloadResponse = {
|
|
|
|
|
ok: true;
|
|
|
|
|
};
|
|
|
|
|
|
2026-05-25 05:25:57 +08:00
|
|
|
export type PostScope = { kind: "all" } | { kind: "category"; slug: string };
|