/**
 * @file DLX manifest storage utilities. Manages persistent caching of DLX
 *   package and binary metadata with TTL support and atomic file operations.
 *   Primary API (on {@link DlxManifest}):
 *
 *   - `getManifestEntry(spec)` — retrieve a manifest entry by spec
 *   - `setPackageEntry(spec, key, details)` — store npm package metadata
 *   - `setBinaryEntry(spec, key, details)` — store binary download metadata
 *   - `getAllPackages()` — enumerate cached package names
 *   - `clear(name)` / `clearAll()` — eviction
 *   - `isFresh(record, ttlMs)` — TTL check The bare `get(name)` / `set(name,
 *     record)` methods are deprecated legacy shims kept for backward
 *     compatibility with pre-5.x callers. Features:
 *   - TTL-based cache expiration
 *   - Atomic file operations with locking
 *   - JSON-based persistent storage
 *   - Error-resistant implementation Storage Format:
 *   - Stores in ~/.socket/_dlx/.dlx-manifest.json
 *   - Per-spec manifest entries with timestamps
 *   - Thread-safe operations using process lock utility Usage:
 *   - Update check caching
 *   - Binary metadata tracking
 *   - Rate limiting registry requests
 */
/**
 * Details for npm package entries.
 */
export interface PackageDetails {
    installed_version: string;
    size?: number;
    update_check?: {
        last_check: number;
        last_notification: number;
        latest_known: string;
    };
}
/**
 * Details for binary download entries.
 */
export interface BinaryDetails {
    /**
     * SRI integrity hash (sha512-<base64>, aligned with npm).
     */
    integrity: string;
    platform: string;
    arch: string;
    size: number;
    source: {
        type: 'download' | 'extract';
        url?: string;
        path?: string;
    };
    /**
     * Update check metadata (same structure as packages).
     */
    update_check?: {
        last_check: number;
        last_notification: number;
        latest_known: string;
    };
}
/**
 * Unified manifest entry for all cached items (packages and binaries). Shared
 * fields at root, type-specific fields in details.
 */
export interface DlxManifestEntry {
    type: 'package' | 'binary';
    cache_key: string;
    timestamp: number;
    details: PackageDetails | BinaryDetails;
}
/**
 * Legacy store record format (deprecated, for migration).
 */
export interface StoreRecord {
    timestampFetch: number;
    timestampNotification: number;
    version: string;
}
export interface DlxManifestOptions {
    /**
     * Custom manifest file path (defaults to ~/.socket/_dlx/.dlx-manifest.json).
     */
    manifestPath?: string;
}
/**
 * Type guard for binary entries.
 *
 * @example
 *   ;```typescript
 *   const entry = manifest.getManifestEntry('https://example.com/tool')
 *   if (entry && isBinaryEntry(entry)) {
 *     console.log(entry.details.integrity)
 *   }
 *   ```
 */
export declare function isBinaryEntry(entry: DlxManifestEntry): entry is DlxManifestEntry & {
    details: BinaryDetails;
};
/**
 * Type guard for package entries.
 *
 * @example
 *   ;```typescript
 *   const entry = manifest.getManifestEntry('@socketsecurity/cli@^2.0.0')
 *   if (entry && isPackageEntry(entry)) {
 *     console.log(entry.details.installed_version)
 *   }
 *   ```
 */
export declare function isPackageEntry(entry: DlxManifestEntry): entry is DlxManifestEntry & {
    details: PackageDetails;
};
/**
 * DLX manifest storage manager with atomic operations. Supports both legacy
 * format (package name keys) and new unified manifest format (spec keys).
 */
export declare class DlxManifest {
    private readonly manifestPath;
    private readonly lockPath;
    constructor(options?: DlxManifestOptions);
    /**
     * Read the entire manifest file.
     *
     * @private
     */
    private readManifest;
    private writeManifest;
    /**
     * Clear cached data for a specific entry.
     */
    clear(name: string): Promise<void>;
    /**
     * Clear all cached data.
     */
    clearAll(): Promise<void>;
    /**
     * Get cached update information for a package (legacy format).
     *
     * @deprecated Use getManifestEntry() for new code.
     */
    get(name: string): StoreRecord | undefined;
    /**
     * Get all cached package names.
     */
    getAllPackages(): string[];
    /**
     * Get a manifest entry by spec (e.g., "@socketsecurity/cli@^2.0.11").
     */
    getManifestEntry(spec: string): DlxManifestEntry | undefined;
    /**
     * Check if cached data is fresh based on TTL.
     */
    isFresh(record: StoreRecord | undefined, ttlMs: number): boolean;
    /**
     * Store update information for a package (legacy format).
     *
     * @deprecated Use setPackageEntry() for new code.
     */
    set(name: string, record: StoreRecord): Promise<void>;
    /**
     * Set a binary manifest entry.
     */
    setBinaryEntry(spec: string, cacheKey: string, details: BinaryDetails): Promise<void>;
    /**
     * Set a package manifest entry.
     */
    setPackageEntry(spec: string, cacheKey: string, details: PackageDetails): Promise<void>;
}
export declare const dlxManifest: DlxManifest;
