import type { ExistsOptions, ExistsResult } from './npm.js'; interface PurlObject { name: string; namespace?: string | undefined; qualifiers?: Record | undefined; subpath?: string | undefined; type?: string | undefined; version?: string | undefined; } /** * Normalize Docker package URL. * Lowercases name only (namespace is case-sensitive for registry hosts). */ export declare function normalize(purl: PurlObject): PurlObject; /** * Validate Docker package URL. * Name and namespace must not contain injection characters. */ export declare function validate(purl: PurlObject, throws: boolean): boolean; /** * Check if a Docker image exists in Docker Hub. * * Queries Docker Hub API at https://hub.docker.com/v2/repositories to verify * image existence and optionally validate a specific tag. Returns the latest * tag if no specific tag is requested. * * **Note:** Docker Hub has rate limits for unauthenticated requests. * * **Caching:** Responses can be cached using a TTL cache to reduce registry * requests. Pass `{ cache }` option with a cache instance from `createTtlCache()`. * * @param name - Image name (e.g., 'nginx', 'redis') * @param namespace - Optional namespace/repository (e.g., 'library' for official images) * @param version - Optional tag to validate (e.g., 'latest', '1.25.3') * @param options - Optional configuration including cache * @returns Promise resolving to existence result with latest tag * * @example * ```typescript * // Check if official image exists * const result = await dockerExists('nginx', 'library') * // -> { exists: true, latestVersion: 'latest' } * * // Check user image * const result = await dockerExists('myapp', 'myuser') * // -> { exists: true, latestVersion: 'v1.0.0' } * * // Validate specific tag * const result = await dockerExists('nginx', 'library', '1.25.3') * // -> { exists: true, latestVersion: 'latest' } * * // With caching * import { createTtlCache } from '@socketsecurity/lib/cache-with-ttl' * const cache = createTtlCache({ ttl: 5 * 60 * 1000, prefix: 'docker' }) * const result = await dockerExists('nginx', 'library', undefined, { cache }) * * // Non-existent image * const result = await dockerExists('this-image-does-not-exist', 'library') * // -> { exists: false, error: 'Image not found' } * ``` */ export declare function dockerExists(name: string, namespace?: string, version?: string, options?: ExistsOptions): Promise; export {};