/** * Detect lockfile type from filename */ export declare function detectLockfileType(filePath: string): 'npm' | 'yarn' | 'bun' | null; /** * Check if content is a lockfile based on structure */ export declare function isLockfileContent(content: string, filePath: string): boolean; /** * Parse npm package-lock.json (supports v1, v2, v3) */ export declare function parseNpmLockfile(content: string): ParsedLockfile; /** * Parse yarn.lock (supports classic v1 and berry/v2+) */ export declare function parseYarnLockfile(content: string): ParsedLockfile; /** * Parse bun.lock (JSON format) * * Bun lockfile format (v1): * { * "lockfileVersion": 1, * "packages": { * "pkg-name": ["pkg-name@version", "resolved-url", { deps }, "integrity-hash"], * "@scope/pkg": ["@scope/pkg@version", "", { deps }, "sha512-..."], * } * } * * Array format: [name@version, resolved_url, meta_object, integrity_hash] * Note: resolved_url is often empty string for packages from default registry */ export declare function parseBunLockfile(content: string): ParsedLockfile; /** * Parse a lockfile based on its type */ export declare function parseLockfile(content: string, filePath: string): ParsedLockfile | null; /** * Extract host from a resolved URL */ export declare function extractHost(resolvedUrl: string): string | null; /** * Extract protocol/scheme from a resolved URL */ export declare function extractScheme(resolvedUrl: string): string | null; /** * Extract package name from a resolved URL * Works for npm/yarn registry URLs like: * - https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz * - https://registry.npmjs.org/@babel/core/-/core-7.0.0.tgz */ export declare function extractPackageNameFromUrl(resolvedUrl: string): string | null; /** * Extract integrity hash type (sha1, sha256, sha512, etc.) */ export declare function extractIntegrityType(integrity: string): string | null; /** * Expand host aliases to actual hostnames */ export declare function expandHostAliases(hosts: string[]): string[]; /** * Registry aliases for convenience * @defaultValue * ```ts * { * npm: 'registry.npmjs.org', * yarn: 'registry.yarnpkg.com', * verdaccio: 'registry.verdaccio.org' * } * ``` */ export declare const REGISTRY_ALIASES: Record; /** * Lockfile parser for npm, yarn, and bun lockfiles. * Normalizes different formats into a unified structure for validation. */ export declare interface ParsedPackage { name: string version: string resolved?: string integrity?: string } export declare interface ParsedLockfile { type: 'npm' | 'yarn' | 'yarn-berry' | 'bun' packages: Map }