import type { ExistsResult, ExistsOptions } from './npm.js'; interface PurlObject { name: string; namespace?: string | undefined; qualifiers?: Record | undefined; subpath?: string | undefined; type?: string | undefined; version?: string | undefined; } /** * Check if an R package exists on CRAN. * * Queries CRAN database to verify package existence and retrieve * the latest version. Note: CRAN provides a list of all packages * via their packages.rds file. * * @param name - Package name (e.g., 'ggplot2') * @param version - Optional version to validate (e.g., '3.4.4') * @param options - Optional configuration including cache * @returns Promise resolving to existence result with latest version * * @example * ```typescript * // Check if package exists * const result = await cranExists('ggplot2') * // -> { exists: true, latestVersion: '3.4.4' } * * // Validate specific version * const result = await cranExists('ggplot2', '3.4.4') * // -> { exists: true, latestVersion: '3.4.4' } * * // Non-existent package * const result = await cranExists('FakePackage') * // -> { exists: false, error: 'Package not found' } * ``` */ export declare function cranExists(name: string, version?: string, options?: ExistsOptions): Promise; /** * Validate CRAN package URL. * CRAN packages require a version. Name must not contain injection characters. */ export declare function validate(purl: PurlObject, throws: boolean): boolean; export {};