import type { Range } from '@vltpkg/semver'; import type { GitSelectorParsed, Scope, SpecLike, SpecOptions, SpecOptionsFilled, SpecType } from './types.ts'; export * from './types.ts'; export declare const kCustomInspect: unique symbol; export declare const defaultRegistry = "https://registry.npmjs.org/"; export declare const defaultRegistryName = "npm"; export declare const defaultRegistries: { npm: string; gh: string; }; export declare const defaultJsrRegistries: { jsr: string; }; export declare const defaultGitHosts: { github: string; bitbucket: string; gitlab: string; gist: string; }; export declare const defaultGitHostArchives: { github: string; bitbucket: string; gist: string; gitlab: string; }; /** * These are just for legacy support of urls that are supported by npm * and observed in the wild. * * Not configurable, because no more will be added. If you wish to define * custom git hosts, use it with the `'git-hosts'` and `'git-host-archives'` * options. */ export declare const gitHostWebsites: { github: string; bitbucket: string; gist: string; gitlab: string; }; export declare const defaultScopeRegistries: { '@jsr': string; }; export declare const getOptions: (options?: SpecOptions) => SpecOptionsFilled; /** * Injects the Node.js dependencies into the Spec class. */ export type NodeJSDependenciesOptions = { homedir: typeof import('os').homedir; isAbsolute: typeof import('node:path').isAbsolute; join: typeof import('node:path').join; resolve: typeof import('node:path').resolve; winPath: typeof import('node:path').win32; }; export declare const isSpec: (spec: unknown) => spec is Spec; /** * Retrieves the short configured name of the default registry if one * is available. */ export declare const currentDefaultRegistryName: (registry: string, options: SpecOptions) => string | undefined; /** * The base, isomorphic Spec implementation. */ export declare class Spec implements SpecLike { #private; /** * Create a Spec object from a full spec, name+bareSpec, or Spec object * * Note: If a Spec object is provided, it is returned as-is, without * investigating whether the options match. */ static parse(name: string, bareSpec: string, options?: SpecOptions): Spec; static parse(spec: string, options?: SpecOptions): Spec; static parse(spec: Spec, options?: SpecOptions): Spec; static parseArgs(specOrBareSpec: string, opts?: SpecOptions): Spec; static nodejsDependencies?: NodeJSDependenciesOptions; type: SpecType; spec: string; options: SpecOptionsFilled; name: string; scope?: Scope; scopeRegistry?: string; bareSpec: string; gitRemote?: string; gitSelector?: string; gitSelectorParsed?: GitSelectorParsed; gitCommittish?: string; namedGitHost?: string; namedGitHostPath?: string; workspaceSpec?: string; workspace?: string; namedRegistry?: string; namedJsrRegistry?: string; registry?: string; registrySpec?: string; conventionalRegistryTarball?: string; semver?: string; range?: Range; distTag?: string; remoteURL?: string; file?: string; catalog?: string; subspec?: Spec; overridden: boolean; /** * Return the final entry in the chain of subspecs * When deciding which thing to actually fetch, spec.final is the thing * to look at. */ get final(): Spec & { type: Exclude; }; /** * Normally, the string value of a Spec is just the string passed in to * be parsed. However, in the case of a chain of subspecs, like * `foo@npm:bar@npm:baz@npm:quux@latest`, this simplifies out the middle * parts of the chain, returning just `foo@npm:quux@latest` */ toString(): string; ['constructor']: typeof Spec; constructor(name: string, bareSpec: string, options?: SpecOptions); constructor(spec: string, options?: SpecOptions); constructor(spec: Spec | string, bareOrOptions?: SpecOptions | string, options?: SpecOptions); [kCustomInspect](): string; /** * Should only ever be called with the bit that comes AFTER the # * in the git remote url. */ static parseGitSelector(selector: string, spec?: Spec): [parsed: GitSelectorParsed, committish?: string, range?: Range]; } export declare const getNormalizeFile: (opts?: NodeJSDependenciesOptions) => (bareSpec: string, spec: Spec) => [path: string, uri: string];