/** * Registry publish status verification. * * Checks whether a package version has been published to its ecosystem registry. * Supports npm (via execFileSync), crates.io, PyPI, Packagist, pub.dev, and Maven Central (via fetch). * * @packageDocumentation */ import type { ManifestSourceType, PublishCheckResult, PublishConfig } from './types'; /** * Maps manifest source types to their registry check implementations. * * @remarks * Each entry provides the registry name and a check function that returns * whether the given version is published. The check function receives the * package name, version, and publish config. * * @public * @since 1.0.0 */ export declare const REGISTRY_TABLE: Record Promise | PublishCheckResult; }>; /** * Checks whether a package version has been published to its ecosystem registry. * * @remarks * Uses the REGISTRY_TABLE to dispatch to the correct check implementation * based on the detected manifest source type. Fail-open on network errors: * returns `published: false` with an error message when the check cannot complete. * * @param manifestSource - The detected manifest source type. * @param packageName - Package name as read from the manifest. * @param version - Version string to check. * @param config - Publish configuration with timeout and optional registry URL. * @returns The publish check result. * * @example * ```ts * import { checkPublishStatus } from './publish'; * * const result = await checkPublishStatus('package.json', '@codluv/vg', '1.0.0', { enabled: true, timeout: 5000 }); * ``` * * @public * @since 1.0.0 */ export declare function checkPublishStatus(manifestSource: ManifestSourceType, packageName: string, version: string, config: PublishConfig): Promise; /** * Reads the package name from a manifest file for registry lookups. * * @remarks * Extracts the package name from the detected manifest type (package.json, * Cargo.toml, pyproject.toml, etc.) so that publish status can be checked * against the correct registry. Returns null for manifest types where a * package name cannot be determined. * * @param manifestSource - Detected manifest type. * @param cwd - Project directory. * @returns The package name, or null if it cannot be determined. * * @example * ```ts * import { readPackageName } from 'versionguard'; * * const name = readPackageName('package.json', process.cwd()); * ``` * * @public * @since 1.0.0 */ export declare function readPackageName(manifestSource: ManifestSourceType, cwd: string): string | null; //# sourceMappingURL=publish.d.ts.map