/**
 * 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 { TraceEventConsumer } from '../port/trace-event-consumer';
import type { Clock } from '../port/clock';
import { ActiveEnterStack } from './active-enter-stack';
import type { TraceEventRecorderState } from './trace-event-recorder-state';
import type { EnterMeta } from '../model/enter-meta';
import { SCHEMA_VERSION } from '../model/trace-schema';
export { SCHEMA_VERSION };
export type { Clock } from '../port/clock';
export type { EnterMeta } from '../model/enter-meta';
export interface CreateTraceEventRecorderOptions {
    exporter: TraceEventConsumer;
    clock: Clock;
    staticContext?: Record<string, unknown>;
}
export declare class TraceEventRecorder implements TraceEventRecorderState {
    readonly SCHEMA_VERSION = 1;
    exporter: TraceEventConsumer;
    readonly clock: Clock;
    readonly staticContext: Record<string, unknown>;
    dynamicContext: Record<string, unknown> | null;
    currentPage: unknown;
    readonly enterStack: ActiveEnterStack;
    readonly stepStack: string[];
    seq: number;
    startedAt: number;
    constructor(options: CreateTraceEventRecorderOptions);
    /**
     * Swap the active exporter for subsequent events. Used by the fixture
     * to install a fresh projector+tee at the start of every test —
     * that way each test has an isolated output pipeline without the
     * recorder having to be rebuilt. The caller is responsible for
     * flushing/closing the previous exporter if needed.
     */
    setExporter: (newExporter: TraceEventConsumer) => void;
    reset: () => void;
    setContext: (ctx: Record<string, unknown> | null) => void;
    setPage: (page: unknown | null) => void;
    pushStep: (name: string) => void;
    popStep: () => void;
    /**
     * Stamp a highlight screenshot filename onto whatever enter event
     * is currently on top of the active-enter stack. Called by the
     * locator-screenshots feature right after it writes the PNG to
     * disk. No-op if the stack is empty (screenshot fired outside any
     * instrumented statement, e.g. before the first __enter).
     */
    setCurrentStatementScreenshot: (filename: string) => void;
    /**
     * Read the `seq` of the enter event currently on top of the active
     * stack — i.e. "what statement is running right now" — for sidecar
     * adapters (network, console) that need to attribute an out-of-band
     * event back to a statement. Returns `undefined` when the stack is
     * empty (event fired between statements / outside any test body).
     *
     * Pure read; no allocation, safe to call from a Playwright event
     * listener on the hot path.
     */
    getCurrentStatementSeq: () => number | undefined;
    /**
     * Snapshot the currently-active step path (a copy of the step
     * stack) for sidecar records that want to denormalize the path the
     * way `StatementProjector` does. Returns `undefined` when no
     * `test.step(...)` is active so callers can omit the field
     * entirely instead of writing an empty array.
     */
    getCurrentStepPath: () => string[] | undefined;
    /**
     * The wall-clock origin used by every timestamp in the trace —
     * sidecar adapters subtract this from `clock.now()` to produce a
     * `t` field on the same axis as `Statement.t`.
     */
    getStartedAt: () => number;
    __enter: (meta: EnterMeta) => void;
    __ok: (vars?: unknown) => void;
    __throw: (err: unknown) => void;
}
