import { Factory } from './types'; /** * Fast class detection helper that avoids try/catch in hot path * Detects ES6 classes by checking for 'class ' prefix in function string * This is ~35-40ns faster than try/catch approach for each instantiation */ export declare const isClass: (fn: unknown) => fn is new (...a: any[]) => any; /** * Optimized instantiation helper that uses class detection to avoid exceptions * Falls back to try/catch only when class detection is ambiguous * * Performance benefits: * - Eliminates exception overhead for class constructors (~35-40ns per call) * - Maintains backwards compatibility with function factories * - Provides clear error messages for invalid factories */ export declare function instantiate(factory: Factory, params: P): T; /** * Safely dispose of an object by calling its dispose method if available * Supports both sync and async disposal patterns * * @param obj - Object to dispose * @returns Promise that resolves when disposal is complete (for backward compatibility) */ export declare function safeDispose(obj: unknown): Promise; /** * Dispose of an object and return any error that occurred * Unlike safeDispose, this function returns the error for aggregation * * @param obj - Object to dispose * @returns Object with disposed flag and optional error */ export declare function disposeWithResult(obj: unknown): Promise<{ disposed: boolean; error?: Error; }>;