/** * Enhanced safeRun utility specifically designed for testing DDD/CQRS patterns. * Provides type-safe error/success pattern for async operations in tests. * * Migrated from @vytches/ddd-utils and enhanced with testing-specific features. */ export type SafeRunResult = readonly [E | undefined, T | undefined]; export declare function safeRun(fn: () => T): SafeRunResult; export declare function safeRun(fn: () => Promise): Promise>; export declare function safeRunTest(fn: () => T | Promise, context?: string): SafeRunResult | Promise>; export declare function expectError(errorType: new (...args: any[]) => E): (result: SafeRunResult) => E; export declare function expectSuccess(result: SafeRunResult): T; export declare function safeRunWithTimeout(fn: () => Promise, timeoutMs: number, context?: string): Promise>;