import type { CacheKeyOptions } from '../interfaces'; /** * Error thrown when key generation fails due to invalid input */ export declare class KeyGenerationError extends Error { readonly cause?: unknown; constructor(message: string, cause?: unknown); } /** * Utility class for generating cache keys */ export declare class KeyGenerator { /** * Generate cache key from options and method arguments * * @param options - Cache key options * @param args - Method arguments * @returns Generated cache key * @throws {KeyGenerationError} When key generation produces invalid result */ static generate(options: CacheKeyOptions, args: any[]): string; /** * Normalize key result to ensure it's a valid string * * @param result - Result from key function * @param source - Source description for error messages * @returns Normalized string key * @throws {KeyGenerationError} When result cannot be converted to string */ private static normalizeKeyResult; /** * Generate key from method arguments * * @param args - Method arguments * @returns Serialized key */ static generateFromArgs(args: any[]): string; /** * Normalize key (remove invalid characters, enforce length limits) * * @param key - Raw key * @param maxLength - Maximum key length (default 250) * @returns Normalized key */ static normalize(key: string, maxLength?: number): string; /** * Add namespace to key * * @param key - Original key * @param namespace - Namespace * @returns Namespaced key */ static addNamespace(key: string, namespace?: string): string; /** * Generate hash code for a string * * @param str - Input string * @returns Hash code as string */ static hashCode(str: string): string; /** * Parse pattern into segments for matching * * @param pattern - Pattern with wildcards * @returns Pattern segments */ static parsePattern(pattern: string): { prefix: string; suffix: string; hasWildcard: boolean; }; }