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 Ruby gem exists in rubygems.org. * * Queries rubygems.org at https://rubygems.org/api/v1/versions to verify gem * existence and optionally validate a specific version. Returns the latest * version from the versions array. * * **Caching:** Responses can be cached using a TTL cache to reduce registry * requests. Pass `{ cache }` option with a cache instance from `createTtlCache()`. * * @param name - Gem name (e.g., 'rails', 'rake') * @param version - Optional version to validate (e.g., '7.0.0') * @param options - Optional configuration including cache * @returns Promise resolving to existence result with latest version * * @example * ```typescript * // Check if gem exists * const result = await gemExists('rails') * // -> { exists: true, latestVersion: '7.1.3' } * * // Validate specific version * const result = await gemExists('rake', '13.0.0') * // -> { exists: true, latestVersion: '13.1.0' } * * // With caching * import { createTtlCache } from '@socketsecurity/lib/cache-with-ttl' * const cache = createTtlCache({ ttl: 5 * 60 * 1000, prefix: 'gem' }) * const result = await gemExists('rails', undefined, { cache }) * * // Non-existent gem * const result = await gemExists('this-gem-does-not-exist') * // -> { exists: false, error: 'Gem not found' } * ``` */ export declare function gemExists(name: string, version?: string, options?: ExistsOptions): Promise; /** * Validate RubyGem package URL. * Gem packages must not have a namespace. Name must not contain injection characters. */ export declare function validate(purl: PurlObject, throws: boolean): boolean; export {};