import { I as IPlatform, M as MemoryDatabase, a as MemoryCache, b as MemoryStorage, c as MemoryEmail, d as MemoryQueue, e as IDatabase } from './ConsoleEmail-DDB28vyS.mjs';
export { C as ConsoleEmail, p as EmailMessage, E as EnvSecrets, k as IEmail, m as IMetrics, i as IQueryBuilder, l as IQueue, n as ISecrets, j as IStorage, J as Job, o as JobOptions, h as MemoryMetrics, f as MemorySecrets, N as NoopMetrics, Q as QueryResult, S as StorageFile, g as createPlatform } from './ConsoleEmail-DDB28vyS.mjs';
export { C as ConsoleLogger, I as ICache, a as ILogger, N as NoopLogger } from './IAI-D8wA_i8N.mjs';
import 'zod';

/**
 * Testing Utilities for Platform Core
 *
 * This module provides utilities for testing applications that use platform-core.
 * Import from '@digilogiclabs/platform-core/testing' in your test files.
 */

/**
 * Create a fresh test platform with all memory adapters.
 * Each call creates a new isolated platform instance.
 */
declare function createTestPlatform(): IPlatform;
/**
 * Test platform with access to underlying adapters for assertions.
 * Allows direct inspection of emails sent, queue jobs, etc.
 */
interface TestPlatformWithInternals extends IPlatform {
    /** Access underlying memory database */
    memoryDb: MemoryDatabase;
    /** Access underlying memory cache */
    memoryCache: MemoryCache;
    /** Access underlying memory storage */
    memoryStorage: MemoryStorage;
    /** Access underlying memory email (check sent emails) */
    memoryEmail: MemoryEmail;
    /** Access underlying memory queue (check queued jobs) */
    memoryQueue: MemoryQueue;
}
/**
 * Create a test platform with direct access to underlying adapters.
 * Useful for asserting on emails sent, jobs queued, etc.
 *
 * @example
 * ```typescript
 * const { platform, memoryEmail, memoryQueue } = createTestPlatformWithInternals();
 *
 * // Run your code that sends emails
 * await myService.sendWelcomeEmail(user);
 *
 * // Assert email was sent
 * const sentEmails = memoryEmail.getSentEmails();
 * expect(sentEmails).toHaveLength(1);
 * expect(sentEmails[0].to).toBe(user.email);
 * ```
 */
declare function createTestPlatformWithInternals(): TestPlatformWithInternals;
/**
 * Seed test data into a memory database.
 *
 * @example
 * ```typescript
 * const platform = createTestPlatform();
 * await seedTestData(platform.db, 'users', [
 *   { id: '1', name: 'Alice', email: 'alice@test.com' },
 *   { id: '2', name: 'Bob', email: 'bob@test.com' },
 * ]);
 * ```
 */
declare function seedTestData<T extends Record<string, unknown>>(db: IDatabase, table: string, data: T[]): Promise<void>;
/**
 * Clear all data from a test platform.
 * Useful in beforeEach/afterEach hooks.
 */
declare function clearTestPlatform(platform: TestPlatformWithInternals): Promise<void>;
/**
 * Wait for all pending queue jobs to complete.
 * Useful when testing async workflows.
 *
 * @param platform - Test platform with memory queue
 * @param timeoutMs - Maximum time to wait (default: 5000ms)
 */
declare function waitForQueueDrain(platform: TestPlatformWithInternals, timeoutMs?: number): Promise<void>;
/**
 * Assert that an email was sent with specific properties.
 */
declare function assertEmailSent(memoryEmail: MemoryEmail, expected: {
    to?: string;
    subject?: string | RegExp;
    bodyContains?: string;
}): void;
/**
 * Create a mock function that tracks calls.
 * Simple alternative to jest.fn() for test frameworks without built-in mocking.
 */
declare function createMockFn<TArgs extends unknown[], TReturn>(implementation?: (...args: TArgs) => TReturn): {
    (...args: TArgs): TReturn;
    calls: TArgs[];
    callCount: number;
    lastCall: TArgs | undefined;
    reset: () => void;
};

export { IDatabase, IPlatform, MemoryCache, MemoryDatabase, MemoryEmail, MemoryQueue, MemoryStorage, type TestPlatformWithInternals, assertEmailSent, clearTestPlatform, createMockFn, createTestPlatform, createTestPlatformWithInternals, seedTestData, waitForQueueDrain };
