import { type RegistriesByPrefix, type RegistriesByScope, type RegistryContext, type RegistryDeclaration, type RegistryServerType } from '@pnpm/types'; export declare const DEFAULT_REGISTRIES_BY_SCOPE: RegistriesByScope; export declare function normalizeRegistriesByScope(registries?: Record): RegistriesByScope; /** * User entries win on collision, so a GHES user can point `gh` at their * enterprise host. URLs are deliberately not normalized the way * `normalizeRegistriesByScope` normalizes `registries`: the name and URL are recorded * in lockfile dep paths, so rewriting one changes what a lockfile resolves to. * * Null-prototype because names come out of those dep paths: a crafted * `foo@constructor:1.0.0` must not resolve to `Object.prototype.constructor` * and slip past the `if (!registry)` guards that fail closed on unknown names. */ export declare function normalizeRegistriesByPrefix(registriesByPrefix?: Record): RegistriesByPrefix; /** * Narrow a config-shaped object down to the registry facts alone, so the * install and lockfile layers are not handed the whole config, and so a * forwarding call site cannot drop one. The single place a new * {@link RegistryContext} field has to be listed. */ export declare function pickRegistryContext(source: RegistryContext): RegistryContext; /** * Rebuilds the declarations from the lookups they were split into, for a * client that has to describe its registries to a pnpr server. * * The inverse of what the config reader does to the `registries` setting, * minus the default registry: that one travels as the request's own * `registry` field. * * Entries are keyed by the URL each lookup holds rather than by a normalized * one, so a registry a prefix addresses without a trailing slash stays the URL * the client resolves against. * * A built-in route the user has not pointed elsewhere is not declared: it is * not part of the client's configuration, and declaring `@jsr` would put * npm.jsr.io in front of a pnpr server's allowlist on every request, including * the requests that never resolve a JSR package. */ export declare function toRegistryDeclarations(context: Partial): Record; /** * The registries the CLI resolves from, merged across every source, in the * shape the `registries` setting is written in — the view `pnpm config get * registries` prints. * * Unlike {@link toRegistryDeclarations}, nothing is omitted: the default * registry is declared as the bare `@` scope, and the built-in routes — the * `@jsr` scope and the `npmjs` / `gh` prefixes — are declared too, because * this view answers "where does this install resolve from", not "what did * the user write". Registry keys, declaration fields, and scope lists come * out in one canonical order so both CLI implementations print identical * JSON. */ export declare function toResolvedRegistryDeclarations(context: Partial): Record; /** * The layout the user declared for `registry`, or `undefined` for none. * * Built-in layouts are deliberately not applied here — they belong with * `isCanonicalRegistryTarballUrl`, which acts on them, so that a code path * that never threads `registryOptionsByUrl` still gets them. */ export declare function getRegistryServerType(registryContext: Pick, registry: string): RegistryServerType | undefined; /** * Whether `registry`'s abbreviated metadata carries the `time` field, from its * own declaration if it has one and from the `registrySupportsTimeField` * setting otherwise. * * The setting is the answer for every registry a project does not describe. */ export declare function registrySupportsTimeField(registryContext: Pick & { registrySupportsTimeField?: boolean; }, registry: string): boolean;