/**
 * Shared E2E test setup for connection ingestor tests.
 *
 * Provides helpers to:
 *   - Load .env.e2e environment variables
 *   - Build a RemoteServerConfig with in-memory keys and requested connections
 *   - Boot an Express server on a random port
 *   - Generate valid webhook signatures (GitHub, Trello)
 *   - Wait for ingestor state transitions and event arrival
 */
import type { Server } from 'node:http';
import { IngestorManager } from '../manager.js';
import type { RemoteServerConfig } from '../../../shared/config.js';
import type { IngestedEvent, IngestorState } from '../types.js';
export declare function loadE2EEnv(): void;
/**
 * Check that all required env vars are set.
 * Returns the missing var names (empty array = all present).
 */
export declare function checkEnvVars(vars: string[]): string[];
/**
 * Build a RemoteServerConfig for E2E tests.
 *
 * Creates a single caller ("e2e-client") with the requested connections.
 * Env vars are injected into caller.env so secret resolution works against
 * process.env (already loaded by loadE2EEnv).
 */
export declare function buildE2EConfig(connections: string[], opts?: {
    env?: Record<string, string>;
    ingestorOverrides?: Record<string, Record<string, unknown>>;
}): RemoteServerConfig;
export interface E2EServer {
    server: Server;
    baseUrl: string;
    ingestorManager: IngestorManager;
    /** Gracefully shut down server and stop all ingestors. */
    teardown: () => Promise<void>;
}
/**
 * Boot an Express server with the given config on a random port.
 * Starts all ingestors and returns handles for testing.
 */
export declare function bootServer(config: RemoteServerConfig): Promise<E2EServer>;
/** Generate a valid GitHub HMAC-SHA256 signature for a raw body. */
export declare function signGitHubPayload(rawBody: string | Buffer, secret: string): string;
/** Generate a valid Trello HMAC-SHA1 base64 signature for body + callbackUrl. */
export declare function signTrelloPayload(rawBody: string | Buffer, callbackUrl: string, secret: string): string;
/**
 * Wait for an ingestor to reach a specific state.
 * Polls every 250ms until the timeout is reached.
 */
export declare function waitForIngestorState(manager: IngestorManager, callerAlias: string, connection: string, targetState: IngestorState, timeoutMs?: number): Promise<void>;
/**
 * Poll until at least one event appears for a connection.
 * Returns the events array once non-empty.
 */
export declare function pollUntilEvent(manager: IngestorManager, callerAlias: string, connection: string, timeoutMs?: number): Promise<IngestedEvent[]>;
/** Common shape every IngestedEvent must satisfy (for use with toMatchObject). */
export declare const INGESTED_EVENT_SHAPE: {
    id: any;
    idempotencyKey: any;
    receivedAt: any;
    receivedAtMs: any;
    callerAlias: string;
    source: any;
    eventType: any;
    data: any;
};
//# sourceMappingURL=setup.d.ts.map