A social knowledge tool for researchers built on ATProto
1import { Result } from '../../../shared/core/Result';
2import { FeedActivity } from './FeedActivity';
3import { ActivityId } from './value-objects/ActivityId';
4
5export interface FeedQueryOptions {
6 page: number;
7 limit: number;
8 beforeActivityId?: ActivityId; // For cursor-based pagination
9}
10
11export interface PaginatedFeedResult {
12 activities: FeedActivity[];
13 totalCount: number;
14 hasMore: boolean;
15 nextCursor?: ActivityId; // For cursor-based pagination
16}
17
18export interface IFeedRepository {
19 addActivity(activity: FeedActivity): Promise<Result<void>>;
20 getGlobalFeed(
21 options: FeedQueryOptions,
22 ): Promise<Result<PaginatedFeedResult>>;
23 findById(activityId: ActivityId): Promise<Result<FeedActivity | null>>;
24}