返回 CodeWhale
repo-activity-lib.d.mts
根目录 / web / scripts / repo-activity-lib.d.mts
1 export interface SnapshotPull {
2 number: number;
3 title: string;
4 url: string;
5 login: string;
6 avatar: string;
7 mergedAt: string;
8 firstTime: boolean;
9 }
10 export interface SnapshotPerson {
11 login: string;
12 avatar: string;
13 }
14 export interface SnapshotMilestone {
15 title: string;
16 url: string;
17 open: number;
18 closed: number;
19 }
20 export interface SnapshotReleaseCredit {
21 tag: string;
22 url: string;
23 publishedAt: string;
24 previousPublishedAt: string;
25 authors: SnapshotPerson[];
26 }
27 export const ACTIVITY_WINDOW_DAYS: number;
28 export const RELEASES_CREDITED: number;
29 export const SEARCH_RESULT_CAP: number;
30 export const READ_DEADLINE_MS: number;
31 export const READ_MAX_BYTES: number;
32 export function readCappedJson(
33 url: string,
34 options?: { headers?: Record<string, string>; fetchImpl?: typeof fetch; deadlineMs?: number; maxBytes?: number },
35 ): Promise<unknown>;
36 export function windowStart(readAtIso: string, days?: number): string;
37 export function mergedPullFromSearchItem(item: unknown): SnapshotPull | null;
38 export function authorsBetween(pulls: SnapshotPull[], afterIso: string | null, untilIso: string): SnapshotPerson[];
39 export function versionedMilestones(rows: unknown): SnapshotMilestone[];
40 type ReleaseRow = { tag_name: string; html_url: string; published_at: string; draft?: boolean; prerelease?: boolean };
41 export function creditedPairs(releases: ReleaseRow[]): Array<{ release: ReleaseRow; previous: ReleaseRow }>;
42 export function releaseCredits(
43 pairs: Array<{ release: ReleaseRow; previous: ReleaseRow }>,
44 pullsFor: (release: ReleaseRow, previous: ReleaseRow) => SnapshotPull[],
45 ): SnapshotReleaseCredit[];
46
46 lines Plain Text