/** * The parts of a `pnpm-lock.yaml` (lockfile version 9) that decide what * `pnpm install` puts in `node_modules`. * * Only what the layout needs is kept: each importer's direct dependencies, * each package's integrity and platform constraints, and each snapshot's own * dependencies. Everything is a plain string as pnpm wrote it -- a reference * such as `19.3.0(react@19.3.0)` is turned into a snapshot key by * {@link snapshotKeyOf}, as pnpm's lockfile crate does. */ export type PnpmLockfile = { importers: Record; /** Keyed `@`, without peers. */ packages: Record; /** Keyed `@()…`: one per installed copy. */ snapshots: Record; }; /** An importer's dependencies, alias to the reference pnpm locked it at. */ export type ImporterSnapshot = { dependencies: Record; devDependencies: Record; optionalDependencies: Record; }; export type PackageInfo = { integrity: string | null; /** `resolution.tarball`, for a package that is not at its registry's standard place. */ tarball: string | null; os: string[] | null; cpu: string[] | null; libc: string[] | null; hasBin: boolean; }; export type SnapshotInfo = { dependencies: Record; optionalDependencies: Record; optional: boolean; }; /** A lockfile this cannot read: not YAML, or not pnpm's version 9 shape. */ export declare class LockfileError extends Error { } /** * Reads a pnpm 9 lockfile. pnpm 11 and later may put a document of their own * (the package manager's dependencies) before the project's, so the document * read is the one that has `importers`. */ export declare function parsePnpmLockfile(text: string): PnpmLockfile; /** `@scope/name` of `@scope/name@1.0.0(peer@2.0.0)`. */ export declare function nameOfKey(key: string): string; /** `1.0.0` of `@scope/name@1.0.0(peer@2.0.0)`: the version, without peers. */ export declare function versionOfKey(key: string): string; /** The `packages:` key a snapshot key's metadata is under: the key without its peers. */ export declare function packageKeyOf(snapshotKey: string): string; /** * The snapshot a dependency reference points at, or `null` for a `link:` to * a directory (a workspace sibling), which is not in the virtual store. */ export declare function snapshotKeyOf(alias: string, reference: string): string | null;