feat [2/3]: add feed viewing

This commit is contained in:
James Xylight authored and xylight committed 2025-09-17 00:27:11 +00:00
1 parent 5ed8346027
commit 82a8747ad4
6 files changed
+202 -10

No files matched your search

+16 -1
View File
@@ -3,6 +3,7 @@ import { profile } from '$lib/auth.svelte'
import type {
CommentView,
CommunityView,
FeedView,
GetComments,
GetCommunityResponse,
GetPersonDetails,
@@ -48,7 +49,7 @@ export class Feed<Params, Response> {
}
}
interface FeedTypes {
export interface FeedTypes {
'/': [
GetPosts,
{
@@ -94,6 +95,20 @@ interface FeedTypes {
params: { posts: GetPost; comments: GetComments }
},
]
'/f/[id]': [
GetPosts,
{
posts: PostView[]
next_page?: string
params: GetPosts
feed: Promise<FeedView | undefined>
client: {
itemHeights?: (number | null)[]
lastSeen?: number
}
},
]
}
const feeds = new SvelteMap<keyof FeedTypes, Feed<any, any>>()