import type { IncludedDependencies, Modules } from '@pnpm/installing.modules-yaml'; import type { LockfileObject } from '@pnpm/lockfile.fs'; import type { WorkspacePackages } from '@pnpm/resolving.resolver-base'; import type { DepPath, HoistedDependencies, ProjectId, ProjectManifest, ProjectRootDir, ProjectRootDirRealPath, ReadPackageHook, Registries } from '@pnpm/types'; /** * Note that some fields are affected by modules directory state. Such fields should be used for * mutating the modules directory only or in a manner that does not influence dependency resolution. */ export interface PnpmContext { currentLockfile: LockfileObject; currentLockfileIsUpToDate: boolean; existsCurrentLockfile: boolean; existsWantedLockfile: boolean; existsNonEmptyWantedLockfile: boolean; extraBinPaths: string[]; /** Affected by existing modules directory, if it exists. */ extraNodePaths: string[]; lockfileHadConflicts: boolean; hoistedDependencies: HoistedDependencies; /** Required included dependencies or dependencies currently included by the modules directory. */ include: IncludedDependencies; modulesFile: Modules | null; pendingBuilds: string[]; projects: Record>; rootModulesDir: string; hoistPattern: string[] | undefined; /** As applied to existing modules directory, if it exists. */ currentHoistPattern: string[] | undefined; hoistedModulesDir: string; publicHoistPattern: string[] | undefined; /** As applied to existing modules directory, if it exists. */ currentPublicHoistPattern: string[] | undefined; lockfileDir: string; virtualStoreDir: string; /** As applied to existing modules directory, otherwise options. */ virtualStoreDirMaxLength: number; /** As applied to existing modules directory, if it exists. */ skipped: Set; storeDir: string; wantedLockfile: LockfileObject; wantedLockfileIsModified: boolean; workspacePackages: WorkspacePackages; registries: Registries; } export interface ProjectOptions { buildIndex: number; binsDir?: string; manifest: ProjectManifest; modulesDir?: string; rootDir: ProjectRootDir; rootDirRealPath?: ProjectRootDirRealPath; } interface HookOptions { originalManifest?: ProjectManifest; } export interface GetContextOptions { autoInstallPeers: boolean; ci?: boolean; excludeLinksFromLockfile: boolean; peersSuffixMaxLength: number; allProjects: Array; confirmModulesPurge?: boolean; force: boolean; frozenLockfile?: boolean; frozenStore?: boolean; enableGlobalVirtualStore?: boolean; extraBinPaths: string[]; extendNodePath?: boolean; lockfileDir: string; modulesDir?: string; nodeLinker: 'isolated' | 'hoisted' | 'pnp'; readPackageHook?: ReadPackageHook; include?: IncludedDependencies; registries: Registries; storeDir: string; useLockfile: boolean; useGitBranchLockfile?: boolean; mergeGitBranchLockfiles?: boolean; virtualStoreDir?: string; virtualStoreDirMaxLength: number; workspacePackages?: WorkspacePackages; hoistPattern?: string[] | undefined; publicHoistPattern?: string[] | undefined; global?: boolean; } export declare function getContext(opts: GetContextOptions): Promise; export interface PnpmSingleContext { currentLockfile: LockfileObject; currentLockfileIsUpToDate: boolean; existsCurrentLockfile: boolean; existsWantedLockfile: boolean; existsNonEmptyWantedLockfile: boolean; /** Affected by existing modules directory, if it exists. */ extraBinPaths: string[]; extraNodePaths: string[]; lockfileHadConflicts: boolean; hoistedDependencies: HoistedDependencies; hoistedModulesDir: string; hoistPattern: string[] | undefined; manifest: ProjectManifest; modulesDir: string; importerId: string; prefix: string; /** Required included dependencies or dependencies currently included by the modules directory. */ include: IncludedDependencies; modulesFile: Modules | null; pendingBuilds: string[]; publicHoistPattern: string[] | undefined; registries: Registries; rootModulesDir: string; lockfileDir: string; virtualStoreDir: string; /** As applied to existing modules directory, if it exists. */ skipped: Set; storeDir: string; wantedLockfile: LockfileObject; wantedLockfileIsModified: boolean; } export declare function getContextForSingleImporter(manifest: ProjectManifest, opts: { autoInstallPeers: boolean; ci?: boolean; enableGlobalVirtualStore?: boolean; excludeLinksFromLockfile: boolean; peersSuffixMaxLength: number; force: boolean; frozenStore?: boolean; confirmModulesPurge?: boolean; extraBinPaths: string[]; extendNodePath?: boolean; lockfileDir: string; nodeLinker: 'isolated' | 'hoisted' | 'pnp'; modulesDir?: string; readPackageHook?: ReadPackageHook; include?: IncludedDependencies; dir: string; registries: Registries; storeDir: string; useLockfile: boolean; useGitBranchLockfile?: boolean; mergeGitBranchLockfiles?: boolean; virtualStoreDir?: string; virtualStoreDirMaxLength: number; hoistPattern?: string[] | undefined; publicHoistPattern?: string[] | undefined; }): Promise; export declare function arrayOfWorkspacePackagesToMap(pkgs: Array>): WorkspacePackages; export {};