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 a Go module exists in the Go module proxy. * * Queries proxy.golang.org to verify module existence and retrieve * the latest version. Go module names are typically full import paths * like 'github.com/user/repo'. * * @param name - Full module path (e.g., 'github.com/gorilla/mux') * @param namespace - Optional namespace (combined with name if provided) * @param version - Optional version to validate (e.g., 'v1.8.0') * @param options - Optional configuration including cache * @returns Promise resolving to existence result with latest version * * @example * ```typescript * // Check if module exists * const result = await golangExists('github.com/gorilla/mux') * // -> { exists: true, latestVersion: 'v1.8.0' } * * // With namespace (constructs full path) * const result = await golangExists('mux', 'github.com/gorilla') * // -> { exists: true, latestVersion: 'v1.8.0' } * * // Validate specific version * const result = await golangExists('github.com/gorilla/mux', undefined, 'v1.8.0') * // -> { exists: true, latestVersion: 'v1.8.0' } * * // Non-existent module * const result = await golangExists('github.com/fake/module') * // -> { exists: false, error: 'Module not found' } * ``` */ export declare function golangExists(name: string, namespace?: string, version?: string, options?: ExistsOptions): Promise; /** * Validate Golang package URL. * Name and namespace must not contain injection characters. * If version starts with "v", it must be followed by a valid semver version. */ export declare function validate(purl: PurlObject, throws: boolean): boolean; export {};