import type { NpmOptions } from '../types/NpmOptions'; import { type NpmAuthOptions } from './npmArgs'; import type { PackageJson } from '../types/PackageInfo'; /** Published versions and dist-tags for a package */ export interface NpmPackageVersionsData { /** All versions of a package */ versions: string[]; /** Mapping from package dist-tag to version */ 'dist-tags': Record; } export interface NpmRegistryFetchJson { /** Package name */ name: string; /** String of date modified (as of writing, this isn't used, and will be a constant date in tests) */ modified: string; /** * Mapping from version to package manifest (package.json and some extra properties). * * This includes manifests for all published versions of the package, which is unfortunate since * this could be a lot of data and there doesn't appear to be a consistent way to reduce it. * (It appears this is what [`npm show/view`][1] receives internally as well, and filtering is applied * to the result. [`pacote`][2] uses `npm-registry-fetch` internally.) * * [1]: https://github.com/npm/cli/blob/f2c3af7de1906b0517bba1e7e5b9247d57960d99/lib/commands/view.js#L102 * [2]: https://github.com/npm/pacote/blob/4b559c4c663a23f988f6be5094c9a45faf6231bc/lib/registry.js */ versions: Record; 'dist-tags': Record; } /** * `Accept` header for `npm-registry-fetch` requests. Per [npm registry docs][1], the first content type * requests a smaller subset of info from the public npm registry, and the other types are fallbacks. * * [1]: https://github.com/npm/registry/blob/main/docs/responses/package-metadata.md */ export declare const _packageContentTypeAccept = "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"; export declare const _npmShowProperties: string[]; /** * Get package versions and tags using `npm-registry-fetch`. * @returns Data about the package, or undefined if there was some issue */ export declare function getNpmPackageInfo(packageName: string, options: NpmAuthOptions & Pick): Promise; //# sourceMappingURL=getNpmPackageInfo.d.ts.map