/** * TTL Validation Utilities * * Helper functions for validating and normalizing TTL values. */ /** * Maximum TTL in seconds (roughly 100 years). * Prevents integer overflow issues. */ export declare const MAX_TTL_SECONDS = 3153600000; /** * Validate a TTL value. * * @param ttlSeconds - TTL in seconds * @throws StorageTTLError if TTL is invalid */ export declare function validateTTL(ttlSeconds: number): void; /** * Validate TTL if provided (optional TTL). * * @param ttlSeconds - Optional TTL in seconds * @throws StorageTTLError if TTL is provided but invalid */ export declare function validateOptionalTTL(ttlSeconds: number | undefined): void; /** * Calculate expiration timestamp from TTL. * * @param ttlSeconds - TTL in seconds * @returns Expiration timestamp (Date.now() + ttlSeconds * 1000) */ export declare function ttlToExpiresAt(ttlSeconds: number): number; /** * Calculate remaining TTL from expiration timestamp. * * @param expiresAt - Expiration timestamp * @returns Remaining seconds, or 0 if expired */ export declare function expiresAtToTTL(expiresAt: number): number; /** * Check if an expiration timestamp has passed. * * @param expiresAt - Expiration timestamp * @returns true if expired (current time >= expiresAt) */ export declare function isExpired(expiresAt: number | undefined): boolean; /** * Normalize TTL to seconds if provided in milliseconds. * Useful for adapting from APIs that use milliseconds. * * @param ttl - TTL value * @param unit - 'seconds' or 'milliseconds' * @returns TTL in seconds */ export declare function normalizeTTL(ttl: number, unit: 'seconds' | 'milliseconds'): number;