import { FetchOptions, GetLatestVersionOptions as GetLatestVersionOptions$1, GetVersionsOptions as GetVersionsOptions$1, InferGetLatestVersionResult, InferGetVersionsResult, MaybeError, NPM_REGISTRY, PackageError, PackageManifest, PackageManifestError, PackageVersionMeta, PackageVersionsInfo, PackageVersionsInfoWithMetadata, ResolvedPackageVersion, ResolvedPackageVersionWithMetadata, RetryOptions } from "fast-npm-meta"; //#region src/types.d.ts interface NpmConfigOptions { /** * Working directory used to locate the default project `.npmrc` and package manager config. * * @default `process.cwd()` */ cwd?: string; /** * Environment source used for `npm_config_*` overrides and `HOME` lookup. * * @default `process.env` */ env?: NodeJS.ProcessEnv; /** * Explicit path to the user `.npmrc` file. * * @default `process.env.npm_config_userconfig` when present, otherwise `${HOME}/.npmrc` */ userConfigPath?: string; /** * Explicit path to the project `.npmrc` file. * Set to `false` to skip loading project config entirely. * * @default `${cwd}/.npmrc` */ projectConfigPath?: string | false; /** * Directory the search for package manager config files carrying registry settings * npm does not read starts from: `pnpm-workspace.yaml`, `.yarnrc.yml` and `bunfig.toml`. * Only the detected package manager's own file is read, searching upward from this * directory and stopping at the repository root. * Set to `false` to skip loading package manager config entirely. * * @default `cwd` */ packageManagerConfigDir?: string | false; } interface NpmConfig { /** * Effective default registry for unscoped packages. * * @default `https://registry.npmjs.org/` */ registry: string; /** * Flat config map containing the effective default registry plus any scoped registries. */ npmConfigs: Record; /** * Scoped registry map keyed by package scope, for example `@my-scope`. * * @default `{}` */ scopeRegistries: Record; /** * Auth settings grouped by normalized registry key, for example `//host/path/`. * * @default `{}` */ authByRegistry: Record; /** * Whether TLS certificates should be verified for registry requests. * * @default `true` */ strictSSL: boolean; /** * Inline CA certificate values collected from `ca[]` or equivalent inputs. * * @default `[]` */ ca: string[]; /** * CA bundle file path from `cafile`. */ caFile?: string; /** * Explicit user agent string from config when provided. */ userAgent?: string; /** * HTTP proxy URL from `proxy`. */ proxy?: string; /** * HTTPS proxy URL from `https-proxy`. */ httpsProxy?: string; /** * No-proxy value from `noproxy`. */ noProxy?: string; /** * Resolved user config path that was used during loading. */ userConfigPath: string; /** * Resolved project config path that was used during loading. * Omitted when project config loading is disabled. */ projectConfigPath?: string; } /** * Normalized auth settings that can be attached to a resolved registry. */ interface RegistryAuthConfig { /** * Bearer token read from `:_authToken`. */ token?: string; /** * Base64-encoded basic auth value. * This may come from `_auth` directly or be derived from `username` and `_password`. */ basicAuth?: string; /** * Client certificate file path used for mTLS. */ certFile?: string; /** * Client private key file path used for mTLS. */ keyFile?: string; } interface NpaOptions { /** * Raw package spec string to parse. * Supported inputs are registry package specs such as `foo`, * `foo@latest`, `foo@1.2.3`, and `@scope/foo@beta`. */ spec: string; } interface NpaResult { /** * Original package spec string after trimming surrounding whitespace. */ raw: string; /** * Normalized package name, for example `foo` or `@scope/foo`. */ name: string; /** * URL-safe package name used by npm-compatible registries. * Scoped package slashes are encoded as `%2f`. */ escapedName: string; /** * Package scope when the package is scoped. */ scope?: string; /** * Raw version, tag, or range portion after the package name. * * @default `''` */ rawSpec: string; } interface NpmPackumentVersion { _npmUser?: { approver?: unknown; trustedPublisher?: unknown; }; deprecated?: string; dist?: { attestations?: { provenance?: unknown; }; integrity?: string; provenance?: 'trustedPublisher' | boolean; }; engines?: Partial>; integrity?: string; provenance?: 'trustedPublisher' | boolean; } /** * Options for `getLatestVersion()` and `getLatestVersionBatch()`. * * This extends `fast-npm-meta`'s latest-version options with npm config * loading controls for registry resolution. */ interface GetLatestVersionOptions extends NpmConfigOptions, GetLatestVersionOptions$1 {} /** * Options for `getVersions()` and `getVersionsBatch()`. * * This extends `fast-npm-meta`'s versions options with npm config loading * controls for registry resolution. */ interface GetVersionsOptions extends NpmConfigOptions, GetVersionsOptions$1 {} //#endregion //#region src/api/index.d.ts declare function getLatestVersion(spec: string, options?: GetLatestVersionOptions): Promise>; declare function getLatestVersionBatch(specs: string[], options?: GetLatestVersionOptions): Promise[]>; declare function getVersions(spec: string, options?: GetVersionsOptions): Promise>; declare function getVersionsBatch(specs: string[], options?: GetVersionsOptions): Promise[]>; //#endregion //#region src/config.d.ts declare function loadNpmConfig(options?: NpmConfigOptions): Promise; //#endregion //#region src/constants.d.ts declare const DEFAULT_STRICT_SSL = true; declare const NPM_CONFIG_ENV_PREFIX = "npm_config_"; declare const DEFAULT_RETRY_OPTIONS: RetryOptions; //#endregion //#region src/npa.d.ts declare function parseNpmSpec(options: NpaOptions): NpaResult; //#endregion export { DEFAULT_RETRY_OPTIONS, DEFAULT_STRICT_SSL, type FetchOptions, GetLatestVersionOptions, GetVersionsOptions, type InferGetLatestVersionResult, type InferGetVersionsResult, type MaybeError, NPM_CONFIG_ENV_PREFIX, NPM_REGISTRY, NpaOptions, NpaResult, NpmConfig, NpmConfigOptions, NpmPackumentVersion, type PackageError, type PackageManifest, type PackageManifestError, type PackageVersionMeta, type PackageVersionsInfo, type PackageVersionsInfoWithMetadata, RegistryAuthConfig, type ResolvedPackageVersion, type ResolvedPackageVersionWithMetadata, type RetryOptions, getLatestVersion, getLatestVersionBatch, getVersions, getVersionsBatch, loadNpmConfig, parseNpmSpec };