Skip to content

Modules | @vltpkg/types

Type Aliases

Bugs

type Bugs: string | object;

Defined in

index.ts:76


ConditionalValue

type ConditionalValue: ConditionalValue[] | ConditionalValueObject | string | null;

Defined in

index.ts:42


ConditionalValueObject

type ConditionalValueObject: object;

Index Signature

[k: string]: ConditionalValue

Defined in

index.ts:38


Dist

type Dist: object;

The Manifest[‘dist’] field present in registry manifests

Type declaration

fileCount?
optional fileCount: number;
integrity?
optional integrity: Integrity;
shasum?
optional shasum: string;
signatures?
optional signatures: object[];
tarball?
optional tarball: string;
unpackedSize?
optional unpackedSize: number;

Defined in

index.ts:19


Exports

type Exports: Exclude<ConditionalValue, null> | ExportsSubpaths;

Defined in

index.ts:52


ExportsSubpaths

type ExportsSubpaths: { [path in "." | `./${string}`]?: ConditionalValue };

Defined in

index.ts:48


Funding

type Funding: FundingEntry | FundingEntry[];

Defined in

index.ts:59


FundingEntry

type FundingEntry: string | object;

Defined in

index.ts:58


Imports

type Imports: Record<`#${string}`, ConditionalValue>;

Defined in

index.ts:56


Integrity

type Integrity: `sha512-${string}`;

sha512 SRI string

Defined in

index.ts:13


JSONField

type JSONField:
| JSONField[]
| boolean
| number
| string
| object
| null;

anything that can be encoded in JSON

Defined in

index.ts:4


KeyID

type KeyID: `SHA256:${string}`;

SHA256 key identifier

Defined in

index.ts:16


Manifest

type Manifest: object;

Type declaration

acceptDependencies?
optional acceptDependencies: Record<string, string>;

dependency ranges that are acceptable, but not forced

bin?
optional bin: Record<string, string> | string;

executable built and linked by this package

bugs?
optional bugs: Bugs;

where to go to file issues

bundleDependencies?
optional bundleDependencies: string[];

names of dependencies included in the package tarball

cpu?
optional cpu: string[] | string;

supported CPU architectures this package can run on

dependencies?
optional dependencies: Record<string, string>;

production dependencies, name:specifier

deprecated?
optional deprecated: string;

a message indicating that this is not to be used

description?
optional description: string;

a short description of the package

devDependencies?
optional devDependencies: Record<string, string>;

development dependencies, name:specifier

dist?
optional dist: Dist;

Only present in Manifests served by a registry. Contains information about the artifact served for this package release.

engines?
optional engines: Record<string, string>;

supported run-time platforms this package can run on

exports?
optional exports: Exports;

named subpath exports

funding?
optional funding: Funding;

URLs that can be visited to fund this project

gitHead?
optional gitHead: string;

the HEAD of the git repo this was published from only present in published packages

gypfile?
optional gypfile: boolean;

npm puts this on published manifests

imports?
optional imports: Imports;

named #identifier imports

keywords?
optional keywords: string[];

search keywords

main?
optional main: string;

the main module, if exports[’.’] is not set

name?
optional name: string;

The name of the package. optional because {} is a valid package.json

optionalDependencies?
optional optionalDependencies: Record<string, string>;

optional dependencies, name:specifier

os?
optional os: string[] | string;

supported operating systems this package can run on

peerDependencies?
optional peerDependencies: Record<string, string>;

peer dependencies, name:specifier

peerDependenciesMeta?
optional peerDependenciesMeta: Record<string, PeerDependenciesMetaValue>;

peer dependencies marked as optional

private?
optional private: boolean;

whether the package is private

repository?
optional repository: Repository;

where the development happens

scripts?
optional scripts: Record<string, string>;

run-script actions for this package

type?
optional type: "commonjs" | "module";

whether this is ESM or CommonJS by default

version?
optional version: string;

The version of the package. optional because {} is a valid package.json

Defined in

index.ts:83


ManifestRegistry

type ManifestRegistry: Manifest & Required<Pick<Manifest, "name" | "version" | "dist">>;

Defined in

index.ts:148


Packument

type Packument: object;

Type declaration

dist-tags
dist-tags: Record<string, string>;
modified?
optional modified: string;
name
name: string
readme?
optional readme: string;
time?
optional time: Record<string, string>;
versions
versions: Record<string, Manifest>

Defined in

index.ts:151


PeerDependenciesMetaValue

type PeerDependenciesMetaValue: object;

An object used to mark some peerDeps as optional

Type declaration

optional?
optional optional: boolean;

Defined in

index.ts:32


Person

type Person: string | object;

Defined in

index.ts:61


RefType

type RefType:
| "branch"
| "head"
| "other"
| "pull"
| "tag";

Defined in

index.ts:160


Repository

type Repository: string | object;

Defined in

index.ts:69


RevDoc

type RevDoc: Omit<Packument, "versions"> & object;

An object kind of resembling a packument, but about a git repo.

Type declaration

refs
refs: Record<string, RevDocEntry>

all named things that can be cloned down remotely

shas
shas: Record<string, string[]>

all named shas referenced above

versions
versions: Record<string, RevDocEntry>

all semver-looking tags go in this record

Defined in

index.ts:180


RevDocEntry

type RevDocEntry: Omit<Manifest, "type"> & Required<Pick<Manifest, "version">> & object;

A representation of a given remote ref in a RevDoc object.

Type declaration

rawRef
rawRef: string

canonical full ref, like refs/tags/blahblah

ref
ref: string

ref as passed git locally

sha
sha: string

sha this references

type
type: RefType

what type of ref this is: ‘branch’, ‘tag’, etc.

Defined in

index.ts:165

Functions

asIntegrity()

function asIntegrity(i): `sha512-${string}`

Parameters

i: unknown

Returns

`sha512-${string}`

Defined in

index.ts:193


asKeyID()

function asKeyID(k): `SHA256:${string}`

Parameters

k: unknown

Returns

`SHA256:${string}`

Defined in

index.ts:217


asManifest()

function asManifest(m, from?): Manifest

Parameters

m: unknown

from?

Returns

Manifest

Defined in

index.ts:302


asManifestRegistry()

function asManifestRegistry(m, from?): ManifestRegistry

Parameters

m: unknown

from?

Returns

ManifestRegistry

Defined in

index.ts:312


asPackument()

function asPackument(p, from?): Packument

Parameters

p: unknown

from?

Returns

Packument

Defined in

index.ts:348


assertIntegrity()

function assertIntegrity(i): asserts i is `sha512-${string}`

Parameters

i: unknown

Returns

asserts i is `sha512-${string}`

Defined in

index.ts:207


assertKeyID()

function assertKeyID(k): asserts k is `SHA256:${string}`

Parameters

k: unknown

Returns

asserts k is `SHA256:${string}`

Defined in

index.ts:231


assertManifest()

function assertManifest(m): asserts m is Manifest

Parameters

m: unknown

Returns

asserts m is Manifest

Defined in

index.ts:326


assertManifestRegistry()

function assertManifestRegistry(m): asserts m is ManifestRegistry

Parameters

m: unknown

Returns

asserts m is ManifestRegistry

Defined in

index.ts:331


assertPackument()

function assertPackument(m): asserts m is Packument

Parameters

m: unknown

Returns

asserts m is Packument

Defined in

index.ts:362


isIntegrity()

function isIntegrity(i): i is `sha512-${string}`

Parameters

i: unknown

Returns

i is `sha512-${string}`

Defined in

index.ts:190


isKeyID()

function isKeyID(k): k is `SHA256:${string}`

Parameters

k: unknown

Returns

k is `SHA256:${string}`

Defined in

index.ts:214


isManifest()

function isManifest(m): m is Manifest

Parameters

m: unknown

Returns

m is Manifest

Defined in

index.ts:284


isManifestRegistry()

function isManifestRegistry(m): m is ManifestRegistry

Parameters

m: unknown

Returns

m is ManifestRegistry

Defined in

index.ts:297


isPackument()

function isPackument(p): p is Packument

Parameters

p: unknown

Returns

p is Packument

Defined in

index.ts:337