//#region src/user.d.ts type User = { readonly _type: "user"; id: string; created_at: string; username: string; discord_id: string | null; discord_username: string | null; avatar_url: `https://${string}/${string}` | null; is_admin: boolean; }; //#endregion //#region src/project.d.ts type Project = { readonly _type: "project"; id: string; created_at: string; updated_at: string; title: string | null; visibility: "public"; slug: string | null; created_by: User | null; current_version: number | null; last_posted_version: number | null; parent_id: string | null; parent_version: number | null; deleted_at: null; posted: boolean; stats: { views: number; likes: number; comments: number; }; auto_set_current: boolean; description: string | null; generated_description: string | null; comments_mode: "open" | "closed"; enable_chat: boolean; from_template: boolean | null; domains: [{ name: string; }] | { name: string; }[]; thumbnail: { moderation_state: "ok" | "bad"; url: `https://${string}/${string}` | null; } | null; video: { url: `https://${string}/${string}`; } | null; }; //#endregion //#region src/project-revision.d.ts type ProjectRevision = { readonly _type: "project_revision"; id: string; version: number; created_at: string; visited_at: null; parent_id: string | null; parent_revision_version: number | null; parent_revision_project_id: string | null; created_by: User; meta: { version: string; }; project_id: string; updated_at: string; deleted_at: null; stats: { multiplayer_count: number; }; draft: boolean; site_id: string; chat_session_id: null; chat_session_run_index: null; current_screenshot_url: `https://${string}/${string}` | null; }; //#endregion //#region src/site.d.ts type WebsimPromptType = { type: "plaintext"; text: string; } | { type: "manual-edit"; text: ""; } | { type: "refactor"; text: string; } | { type: "fix"; text: string; } | { type: "get"; text: string; } | { type: "tweak-edit"; text: ""; data: null; }; type SiteLoreAttachment = { id: string; mediaType: string; filename: string; description: string; useVision: boolean; }; type SiteLore = { readonly version: 1; attachments: SiteLoreAttachment[]; enableApi?: boolean; enableMobilePrompt?: boolean; enableDB?: boolean; enableMultiplayer_v2?: boolean; enableDB_v2_1?: boolean; enableLLM2?: boolean; enableTweaks?: boolean; enableComments?: boolean; enableVideo: false; }; type Site = { readonly _type: "site"; id: string; parent_id: string | null; created_at: string; state: "initial" | "generating" | "done" | "failed"; model: string; lore: SiteLore | null; title: string | null; url: string | null; prompt: WebsimPromptType; owner: User; link_url: `/p/${string}`; versioned_link_url: `/p/${string}/${number}`; deleted_at: string | null; yapping: string | null; }; //#endregion //#region src/comments.d.ts declare namespace CommentContent { export type Text = { readonly type: "text"; readonly text: string; readonly italic?: boolean; }; export type Break = { readonly type: "break"; }; export type User = { readonly type: "user"; readonly username: string; }; export type Link = { readonly type: "link"; readonly url: string; readonly children: readonly [CommentContent.Text | CommentContent.Image]; }; export type Image = { readonly type: "image"; readonly url: `https://${string}/${string}`; readonly alt: string; }; export type Paragraph = { readonly type: "paragraph"; readonly children: readonly CommentContent[]; }; export type Document = { readonly type: "document"; readonly children: readonly CommentContent.Paragraph[]; }; } type CommentContent = CommentContent.Text | CommentContent.Break | CommentContent.User | CommentContent.Link | CommentContent.Image; type WebsimCommentCardData = { readonly type: "tip_comment"; readonly credits_spent: number; } | { readonly type: "project_post"; readonly project: Project; readonly project_revision: ProjectRevision; readonly site: Site; } | null; type WebsimCommentPostPresentation = { readonly type: "tweet"; } | { readonly type: "video"; readonly video_url: `https://${string}/${string}`; } | null; type WebsimComment = { readonly id: string; readonly project_id: string; readonly content: CommentContent.Document | null; readonly raw_content: string | null; readonly created_at: string; readonly deleted: boolean; readonly author: User; readonly reply_count: number; readonly parent_comment_id: string | null; readonly reply_to_data: null; readonly pinned: boolean; readonly pinned_by: User | null; readonly reactions: readonly { readonly emoji: { readonly name: string; }; readonly user_ids: readonly string[]; }[]; readonly source: "comments"; readonly type: "text"; readonly card_data: WebsimCommentCardData; readonly project_data: null; readonly post_presentation: WebsimCommentPostPresentation; }; //#endregion //#region src/shared/index.d.ts type Prettify = T extends infer O ? { [K in keyof O]: O[K] } : never; //#endregion //#region src/project-asset.d.ts declare namespace ProjectAssetMeta { type text = { meta: { version: "1"; in_generation: true; }; content_type: "text/javascript" | "text/css" | "text/html"; }; type image = { meta: { version: "1"; description: string; title: string; transparent?: boolean; aspect?: "square"; in_generation?: false; in_generation_asset?: true; }; content_type: "image/png"; }; type audio = { meta: { version: "1"; duration: number; }; content_type: "audio/mpeg"; }; } type ProjectAssetMetaByContentType = ProjectAssetMeta.text | ProjectAssetMeta.image | ProjectAssetMeta.audio; type ProjectAsset = Prettify<{ readonly _type: "project_asset"; id: string; project_id: string; path: string; state: "done"; created_at: string; created_by: User; updated_at: string; bucket_key: string; project_version: number; size: number; is_liked: boolean; } & ProjectAssetMetaByContentType>; //#endregion //#region src/screenshot.d.ts type Screenshot = { readonly _type: "screenshot"; id: string; project_id: string; project_version: number; created_at: string; state: "done"; height: number; width: number; content_type: "image/webp"; moderation_state: "ok"; source: "user" | "server"; url: `https://${string}/${string}`; }; //#endregion export { type CommentContent, type Prettify, type Project, type ProjectAsset, type ProjectRevision, type Screenshot, type Site, type SiteLore, type SiteLoreAttachment, type User, type WebsimComment, type WebsimPromptType };