import type { Integrity } from '../recipe/integrity.js'; export type Fetch = typeof globalThis.fetch; export type Limiter = (task: () => Promise) => Promise; export interface PackumentVersion { readonly name: string; readonly version: string; readonly integrity?: Integrity; readonly tarball?: string; readonly dependencies?: Readonly>; readonly devDependencies?: Readonly>; readonly optionalDependencies?: Readonly>; readonly peerDependencies?: Readonly>; readonly peerDependenciesMeta?: Readonly>>; readonly engines?: Readonly>; readonly funding?: unknown; readonly os?: readonly string[]; readonly cpu?: readonly string[]; readonly libc?: readonly string[]; readonly deprecated?: string; readonly bin?: string | Readonly>; readonly bundledDependencies?: readonly string[]; readonly hasInstallScript?: boolean; readonly license?: string; readonly type?: string; readonly main?: string; readonly exports?: unknown; } export interface Packument { readonly name: string; readonly distTags: Readonly>; readonly versions: Readonly>; } export interface RegistryAdapter { packument(name: string): Promise; resolve(name: string, range: string): Promise; manifest?(name: string, version: string): Promise; readonly limit?: Limiter; } export interface ArtifactRoute { readonly registryUrl: string; readonly fetch: typeof fetch; readonly authHeaderFor: (url: string) => string | undefined; readonly limit: Limiter; } export interface RemoteArtifactRegistry extends RegistryAdapter { artifactRoute(name: string): ArtifactRoute | undefined; } export interface CacheAdapter { packument(name: string): Promise; } export interface NpmTarballSource { tarball(name: string, version: string): Promise; } export interface YarnBerryChecksumSource { berryChecksum(name: string, version: string, cacheKey: string): Promise; } export interface NpmCacheAdapter extends CacheAdapter, NpmTarballSource { } export interface YarnBerryCacheAdapter extends CacheAdapter, YarnBerryChecksumSource { }