1 | /**
|
2 | * `PackageDownloads` lists the number of downloads for a package
|
3 | * in a given time period.
|
4 | *
|
5 | * @see {@link RegistryDownloads}
|
6 | * @see {@link https://github.com/npm/registry/blob/master/docs/download-counts.md#point-values}
|
7 | */
|
8 | export interface PackageDownloads extends RegistryDownloads {
|
9 | /** Package name */
|
10 | readonly package: string;
|
11 | }
|
12 |
|
13 | /**
|
14 | * `RegistryDownloads` lists the number of downloads for the registry
|
15 | * in a given time period.
|
16 | *
|
17 | * @see {@link https://github.com/npm/registry/blob/master/docs/download-counts.md#point-values}
|
18 | */
|
19 | export interface RegistryDownloads {
|
20 | /** Total number of downloads */
|
21 | readonly downloads: number;
|
22 |
|
23 | /** Date of the first day (inclusive) */
|
24 | readonly start: string;
|
25 |
|
26 | /** Date of the last day (inclusive) */
|
27 | readonly end: string;
|
28 | }
|
29 |
|
30 | /**
|
31 | * `DailyPackageDownloads` lists the number of downloads for a package
|
32 | * for each day in a given time period.
|
33 | *
|
34 | * @see {@link DailyRegistryDownloads}
|
35 | * @see {@link https://github.com/npm/registry/blob/master/docs/download-counts.md#ranges}
|
36 | */
|
37 | export interface DailyPackageDownloads extends DailyRegistryDownloads {
|
38 | /** Package name */
|
39 | readonly package: string;
|
40 | }
|
41 |
|
42 | /**
|
43 | * `DailyRegistryDownloads` lists the number of downloads for the registry
|
44 | * for each day in a given time period.
|
45 | *
|
46 | * @see {@link DownloadsPerDay}
|
47 | * @see {@link https://github.com/npm/registry/blob/master/docs/download-counts.md#ranges}
|
48 | */
|
49 | export interface DailyRegistryDownloads {
|
50 | /** Download counts per day */
|
51 | readonly downloads: DownloadsPerDay[];
|
52 |
|
53 | /** Date of the first day (inclusive) */
|
54 | readonly start: string;
|
55 |
|
56 | /** Date of the last day (inclusive) */
|
57 | readonly end: string;
|
58 | }
|
59 |
|
60 | /**
|
61 | * `DownloadsPerDay` lists the number of downloads in a given day.
|
62 | */
|
63 | export interface DownloadsPerDay {
|
64 | /** Total number of downloads in the day */
|
65 | readonly downloads: number;
|
66 |
|
67 | /** Day date */
|
68 | readonly day: string;
|
69 | }
|