front-page.ts
This file
Path
packages/project/src/front-page.ts
31 lines · 1.2 KiB · TypeScript
Last changed by
Merge redesign into mainoscabrielbefore adoptioncaedd21
History of this fileTake it
1234567891011121314151617181920212223242526272829303132import type { Reserve } from "@repo/protocol/domain/ask";import type { FrontPageEntry, ProjectListing,} from "@repo/protocol/domain/front-page";import type { RecentLanding } from "@repo/protocol/domain/recent-landing";import type { CreditSummary } from "@repo/protocol/domain/record";import type { Handle, KindName } from "@repo/protocol/ids";import { Context } from "effect";import type { Effect } from "effect";
export interface FrontPageFilter { readonly kind?: KindName; readonly reserved?: Reserve;}
export class FrontPage extends Context.Service< FrontPage, { /** A listing's `posture` is a fallback only: callers read each project's own ledger (`withStandingPosture`). */ readonly projects: () => Effect.Effect<readonly ProjectListing[]>; readonly entries: ( filter: FrontPageFilter ) => Effect.Effect<readonly FrontPageEntry[]>; readonly credits: ( handle: Handle ) => Effect.Effect<readonly CreditSummary[]>; /** The latest landings and refused answers across projects, the latest first, at most `RECENT_LANDINGS_CAP`: read from what is kept, never by replaying a project. */ readonly recentLandings: () => Effect.Effect<readonly RecentLanding[]>; }>()("project/FrontPage") {}