import type { BinaryFetcher, DirectoryFetcher, GitFetcher } from '@pnpm/fetching.fetcher-base'; import { type TarballFetchers } from '@pnpm/fetching.tarball-fetcher'; import type { RetryTimeoutOptions } from '@pnpm/fetching.types'; import type { CustomFetcher, CustomResolver } from '@pnpm/hooks.types'; import { type DispatcherOptions } from '@pnpm/network.fetch'; import { type ResolutionVerifierFactoryOptions, type ResolveFunction, type ResolveLatestDispatcher, type ResolverFactoryOptions } from '@pnpm/resolving.default-resolver'; import type { LatestInfo, LatestQuery, ResolutionVerifier } from '@pnpm/resolving.resolver-base'; import type { StoreIndex } from '@pnpm/store.index'; import type { RegistryConfig } from '@pnpm/types'; export type { LatestInfo, LatestQuery, ResolutionVerifier, ResolveFunction, ResolveLatestDispatcher }; export type ClientOptions = { configByUri: Record; customResolvers?: CustomResolver[]; customFetchers?: CustomFetcher[]; ignoreScripts?: boolean; retry?: RetryTimeoutOptions; storeIndex: StoreIndex; timeout?: number; nodeDownloadMirrors?: Record; unsafePerm?: boolean; userAgent?: string; gitShallowHosts?: string[]; resolveSymlinksInInjectedDirs?: boolean; includeOnlyPackageFiles?: boolean; preserveAbsolutePaths?: boolean; fetchMinSpeedKiBps?: number; } & ResolverFactoryOptions & DispatcherOptions & Pick; export interface Client { fetchers: Fetchers; resolve: ResolveFunction; clearResolutionCache: () => void; /** * List of resolver-side verifiers — one entry per active policy * (today: at most one, `npm.minimumReleaseAge`). Empty when no policy * is active. The install layer fans out across the list to re-validate * each lockfile entry; each verifier handles its own protocol * short-circuit inside `verify`. */ resolutionVerifiers: ResolutionVerifier[]; } export declare function createClient(opts: ClientOptions): Client; export declare function createResolver(opts: Omit): { resolve: ResolveFunction; resolveLatest: ResolveLatestDispatcher; clearCache: () => void; }; /** * Wraps a `ResolveFunction` so any inline policy violation surfaced by * the resolver is rethrown as a `PnpmError` instead of being returned on * the result. Use this from one-shot callers (dlx, self-update) that * have nowhere to defer a violation to — the install command leaves * resolution unwrapped because it aggregates violations across the * whole tree before deciding what to do. * * The error mapping is centralized here so future violation codes * (today: `MINIMUM_RELEASE_AGE_VIOLATION`) get a consistent error code * across every strict-mode caller without each call site re-translating. */ export declare function makeResolutionStrict(resolve: ResolveFunction): ResolveFunction; type Fetchers = { git: GitFetcher; directory: DirectoryFetcher; binary: BinaryFetcher; } & TarballFetchers;