/** * What the whole site did over a period, one of the digests' cadences: its * most upvoted dumps, who joined, the new public playlists and the totals. * This module types it for the `/community` page, which shows it as it was at * the server's last refresh; the digests gather the same figures for each * reader's own period. * * @module */ import type { Dump } from "./dump.ts"; import type { Playlist } from "./playlist.ts"; import type { PublicUser } from "./user.ts"; /** * Returned by `GET /api/community?period=` to the `Community` page, and * gathered by `community-service.ts`, which the digests read too. */ export interface CommunityStats { /** The period covered, from `from` to `to`. */ from: Date; to: Date; /** The most upvoted public dumps posted in it, 10 at most. */ top: Dump[]; /** In sign-up order, each with `invitedByUsername` when someone invited them. */ members: PublicUser[]; /** The public playlists created in it, the fullest first, with `dumpCount`. */ playlists: Playlist[]; chatMessages: number; /** Public dumps posted, upvotes cast and comments written in it. */ totals: { dumps: number; upvotes: number; comments: number }; }