/**
 * Copyright: (c) Myia SAS 2026.
 * This file and its contents are licensed under the AGPLv3 License.
 * Please see the LICENSE file at the root of this repository
 */
import type { TraceEvent, TraceEventConsumer } from '../../port/trace-event-consumer';
import type { HealTraceExporter } from '../../port/heal-trace-exporter';
import { type TestResultRecord } from '../../model/statement-trace-schema';
export declare class StatementProjector implements TraceEventConsumer {
    private readonly output;
    private readonly allBySeq;
    private readonly rootsBySeq;
    private statementCount;
    private headerEmitted;
    private finalized;
    constructor(output: HealTraceExporter);
    write(event: TraceEvent): void;
    clear(): void;
    /**
     * Emit the final `test-result` record and close the underlying
     * exporter. Called once at test teardown; the projector is unusable
     * afterwards.
     *
     * Any root statements still live in `rootsBySeq` at this point had
     * their `__enter` fire but never their matching `__ok`/`__throw` —
     * typically because Playwright's test timeout short-circuited
     * teardown before the hanging action rejected. Flushing them as
     * `threw` with the test-level error makes the partial work visible
     * in the trace instead of silently dropped.
     */
    finalize(result: Omit<TestResultRecord, 'kind'>, pendingError?: unknown): Promise<void>;
    private flushPendingRoots;
    private maybeEmitRoot;
    private dropSubtree;
}
