/**
 * Shared singleton pattern utilities
 *
 * This module provides standardized singleton patterns that are used
 * throughout the codebase. It reduces boilerplate and ensures
 * consistent singleton management.
 */
/**
 * Type for a factory function that creates an instance
 */
export type Factory<T, TArgs extends unknown[] = []> = (...args: TArgs) => T;
/**
 * Type for a class constructor
 */
export type Constructor<T, TArgs extends unknown[] = []> = new (...args: TArgs) => T;
/**
 * Create a singleton getter function
 *
 * @param key - Unique key for this singleton
 * @param factory - Factory function to create the instance
 * @returns A function that returns the singleton instance
 *
 * @example
 * ```typescript
 * class MyService {
 *   constructor(config: Config) { ... }
 * }
 *
 * export const getMyService = createSingleton(
 *   'myService',
 *   (config?: Config) => new MyService(config ?? defaultConfig)
 * );
 *
 * // Usage:
 * const service = getMyService();
 * const serviceWithConfig = getMyService(customConfig); // Only used on first call
 * ```
 */
export declare function createSingleton<T, TArgs extends unknown[] = []>(key: string | symbol, factory: Factory<T, TArgs>): (...args: TArgs) => T;
/**
 * Create a singleton getter with reset capability
 *
 * @param key - Unique key for this singleton
 * @param factory - Factory function to create the instance
 * @returns Object with get and reset functions
 *
 * @example
 * ```typescript
 * const { get: getCache, reset: resetCache } = createResettableSingleton(
 *   'cache',
 *   () => new Cache()
 * );
 *
 * // Usage:
 * const cache = getCache();
 * resetCache(); // Clears the instance, next get() creates new one
 * ```
 */
export declare function createResettableSingleton<T, TArgs extends unknown[] = []>(key: string | symbol, factory: Factory<T, TArgs>): {
    get: (...args: TArgs) => T;
    reset: () => void;
};
/**
 * Create a lazy singleton that's only created when first accessed
 *
 * @param factory - Factory function to create the instance
 * @returns Object with value getter and reset function
 *
 * @example
 * ```typescript
 * const heavyService = createLazySingleton(() => new HeavyService());
 *
 * // Service not created yet
 * // ...
 * const service = heavyService.value; // Created now
 * ```
 */
export declare function createLazySingleton<T>(factory: () => T): {
    readonly value: T;
    reset: () => void;
};
/**
 * Clear all singleton instances (useful for testing)
 */
export declare function clearAllSingletons(): void;
/**
 * Check if a singleton exists
 *
 * @param key - Singleton key to check
 * @returns true if singleton instance exists
 */
export declare function hasSingleton(key: string | symbol): boolean;
/**
 * Get a singleton instance without creating it
 *
 * @param key - Singleton key
 * @returns The instance or undefined if not created
 */
export declare function peekSingleton<T>(key: string | symbol): T | undefined;
/**
 * Create a module-level singleton pattern (most common use case)
 *
 * This is the simplest pattern for creating a singleton at module level.
 *
 * @param factory - Factory function to create the instance
 * @returns Singleton manager object
 *
 * @example
 * ```typescript
 * // In myService.ts
 * class MyService {
 *   constructor(private config: Config) {}
 * }
 *
 * const { getInstance, resetInstance } = moduleSingleton(
 *   () => new MyService(loadConfig())
 * );
 *
 * export { getInstance as getMyService, resetInstance as resetMyService };
 * ```
 */
export declare function moduleSingleton<T>(factory: () => T): {
    getInstance: () => T;
    resetInstance: () => void;
    hasInstance: () => boolean;
};
