UNPKG

1.19 kBPlain TextView Raw
1import { DistTags } from './dist-tags';
2import { GitRepository } from './git-repository';
3import { RawPackument } from './raw-packument';
4
5/**
6 * `Packument` represents a packument (package document)
7 * containing all the data about a package.
8 *
9 * @remarks
10 * For some packages, especially legacy ones,
11 * the properties may be mistyped due to incorrect data present on the registry.
12 *
13 * @see {@link RawPackument}
14 */
15export interface Packument extends RawPackument {
16 /**
17 * Unique package name (for example, `foo` or `@bar/baz`;
18 * alias to `_id`)
19 */
20 readonly id: string;
21
22 /**
23 * Mapping of distribution tags to version numbers
24 * (alias to `dist-tags`)
25 *
26 * @see {@link DistTags}
27 */
28 readonly distTags: DistTags;
29
30 /**
31 * Mapping of version numbers to publishing timestamps
32 * without the `created` or `modified` properties
33 * present in the `time` property
34 *
35 * @see {@link VersionsToTimestamps}
36 */
37 readonly versionsToTimestamps: Record<string, string>;
38
39 /** Normalized license */
40 readonly license?: string;
41
42 /** Normalized git repository */
43 readonly gitRepository?: GitRepository;
44}