import { _ as URLBuilder, c as Client, d as Dependency, f as Maintainer, m as ParsedPURL, p as Package, t as Registry, v as Version } from "./registry.mjs"; //#region src/core/purl.d.ts /** * Parse a package URL into normalized components. * * @param purlStr - Package URL to parse. * @returns {ParsedPURL} The normalized components. * @see https://github.com/package-url/purl-spec (ECMA-427) */ declare function parsePURL(purlStr: string): ParsedPURL; /** * Build a registry package name from PURL components. * * @param parsed - Parsed package URL components. * @returns {string} The namespace-qualified package name. */ declare function fullName(parsed: ParsedPURL): string; /** * Create a registry from a package URL. * * @param purlStr - Package URL to resolve. * @param client - Optional HTTP client. * @returns {Promise<[Registry, string, string]>} The registry, package name, and version. */ declare function createFromPURL(purlStr: string, client?: Client): Promise<[Registry, string, string]>; /** * Build a package URL from normalized components. * * @param parts - Package URL components. * @returns {string} The canonical package URL. */ declare function buildPURL(parts: Readonly<{ type: string; name: string; version?: string; namespace?: string; qualifiers?: Readonly>; subpath?: string; }>): string; //#endregion //#region src/core/license.d.ts /** * Normalize common license names to SPDX expressions. * * @param raw - License name or SPDX expression. * @returns {string} The normalized SPDX expression, or an empty string. */ declare function normalizeLicense(raw: string | null | undefined): string; /** * Combine license strings into one SPDX expression. * * @param licenses - License names or expressions to normalize. * @param operator - SPDX operator joining multiple licenses. * @returns {string} The combined SPDX expression, or an empty string. */ declare function combineLicenses(licenses: readonly (string | null | undefined)[], operator?: "OR" | "AND"): string; //#endregion //#region src/core/repository.d.ts /** * Normalize repository shorthands and Git transports to HTTPS. * * @param raw - Repository URL string or object with a URL field. * @returns {string} The normalized URL, or an empty string. */ declare function normalizeRepositoryURL(raw: unknown): string; //#endregion //#region src/core/errors.d.ts /** Custom error types for registry operations. */ declare class PkioError extends Error { constructor(message: string, options?: ErrorOptions); } declare class HTTPError extends PkioError { readonly statusCode: number; readonly url: string; readonly body: string; constructor(statusCode: number, url: string, body: string); isNotFound(): boolean; isRateLimit(): boolean; isServerError(): boolean; } declare class NotFoundError extends PkioError { readonly ecosystem: string; readonly packageName: string; readonly version: string; constructor(ecosystem: string, packageName: string, version?: string); } declare class RateLimitError extends PkioError { readonly retryAfter: number; constructor(retryAfter: number); } declare class UnknownEcosystemError extends PkioError { readonly ecosystem: string; constructor(ecosystem: string); } declare class InvalidPURLError extends PkioError { readonly purl: string; constructor(purl: string, reason: string); } //#endregion //#region src/helpers.d.ts /** * Fetch normalized package metadata from a package URL. * * @param purl - Package URL. * @param signal - Optional cancellation signal. * @param client - Optional HTTP client. * @returns {Promise} Normalized package metadata. */ declare function fetchPackageFromPURL(purl: string, signal?: AbortSignal, client?: Client): Promise; /** * Fetch all versions from a package URL. * * @param purl - Package URL. * @param signal - Optional cancellation signal. * @param client - Optional HTTP client. * @returns {Promise} Normalized versions. */ declare function fetchVersionsFromPURL(purl: string, signal?: AbortSignal, client?: Client): Promise; /** * Fetch dependencies for a versioned package URL. * * @param purl - Versioned package URL. * @param signal - Optional cancellation signal. * @param client - Optional HTTP client. * @returns {Promise} Normalized dependencies. */ declare function fetchDependenciesFromPURL(purl: string, signal?: AbortSignal, client?: Client): Promise; /** * Fetch maintainers from a package URL. * * @param purl - Package URL. * @param signal - Optional cancellation signal. * @param client - Optional HTTP client. * @returns {Promise} Normalized maintainers. */ declare function fetchMaintainersFromPURL(purl: string, signal?: AbortSignal, client?: Client): Promise; /** * Fetch packages concurrently, skipping failed lookups. * * @param purls - Package URLs to fetch. * @param options - Optional concurrency, cancellation, and client settings. * @returns {Promise>} Results keyed by package URL. */ declare function bulkFetchPackages(purls: readonly string[], options?: Readonly<{ concurrency?: number; signal?: AbortSignal; client?: Client; }>): Promise>; /** * Select an exact requested or latest version, then the newest usable one. * * @param versions - Candidate versions. * @param options - Optional requested and latest version numbers. * @returns {Version | null} The selected version, or null. */ declare function selectVersion(versions: readonly Version[], options?: Readonly<{ requested?: string; latest?: string; }>): Version | null; /** * Resolve the best documentation URL for a package. * * @param pkg - Package metadata. * @param urls - Ecosystem URL builder. * @param version - Optional package version. * @returns {string} The explicit, homepage, or ecosystem documentation URL. */ declare function resolveDocsUrl(pkg: Package, urls: URLBuilder, version?: string): string; /** * Resolve the ecosystem README URL for a package. * * @param pkg - Package metadata. * @param urls - Ecosystem URL builder. * @param version - Optional package version. * @returns {string} The README URL. */ declare function resolveReadmeUrl(pkg: Package, urls: URLBuilder, version?: string): string; //#endregion export { normalizeLicense as _, fetchVersionsFromPURL as a, fullName as b, selectVersion as c, NotFoundError as d, PkioError as f, combineLicenses as g, normalizeRepositoryURL as h, fetchPackageFromPURL as i, HTTPError as l, UnknownEcosystemError as m, fetchDependenciesFromPURL as n, resolveDocsUrl as o, RateLimitError as p, fetchMaintainersFromPURL as r, resolveReadmeUrl as s, bulkFetchPackages as t, InvalidPURLError as u, buildPURL as v, parsePURL as x, createFromPURL as y }; //# sourceMappingURL=index.d.mts.map