import type { SwapLifecycleEvent, SwapLifecycleObservationKey, WidgetTelemetryHandler, WidgetTelemetryAttributes, WidgetOperation, WidgetOperationOutcome } from '@layerswap/widget-types'; type Attributes = WidgetTelemetryAttributes; type Flow = { id: string; started: number; attributes: Attributes; opened: boolean; engaged: boolean; submitted: boolean; prompted: boolean; transferSubmitted: boolean; deposited: boolean; completed: boolean; attempts: number; swapId?: string; validation?: string; amountMode?: SwapLifecycleEvent['amountMode']; walletKey?: string; observations: Map; }; /** One live widget is enforced by LayerswapProvider. Kept factory-based for isolation tests. */ export declare function createWidgetTelemetry(clock?: () => number, wallClock?: () => number): { /** A registration without a handler still owns the slot: it silences the ones below it. */ register(handler?: WidgetTelemetryHandler): () => void; createFlow(attributes: Attributes): Flow; mount(current: Flow): () => void; update(current: Flow, attributes: Attributes, walletKey?: string): void; amountInputMethod(event: SwapLifecycleEvent): SwapLifecycleEvent["amountMode"]; recordAmountInput(method: NonNullable): void; interaction(action: string, trigger: string, inForm: boolean, attributes?: Attributes): void; validation(code?: string): void; lifecycle(event: SwapLifecycleEvent): void; beginOperation(operation: WidgetOperation, attributes?: Attributes): (_outcome: WidgetOperationOutcome, _extra?: Attributes) => void; }; export declare const widgetTelemetry: { /** A registration without a handler still owns the slot: it silences the ones below it. */ register(handler?: WidgetTelemetryHandler): () => void; createFlow(attributes: Attributes): Flow; mount(current: Flow): () => void; update(current: Flow, attributes: Attributes, walletKey?: string): void; amountInputMethod(event: SwapLifecycleEvent): SwapLifecycleEvent["amountMode"]; recordAmountInput(method: NonNullable): void; interaction(action: string, trigger: string, inForm: boolean, attributes?: Attributes): void; validation(code?: string): void; lifecycle(event: SwapLifecycleEvent): void; beginOperation(operation: WidgetOperation, attributes?: Attributes): (_outcome: WidgetOperationOutcome, _extra?: Attributes) => void; }; export declare function startApiOperation(method: string, endpoint: string): (_outcome: WidgetOperationOutcome, _extra?: Attributes, _data?: unknown) => void; /** Activated controls only: native click also covers keyboard and touch activation. */ export declare function captureWidgetInteraction(event: { target: EventTarget | null; type: string; nativeEvent?: { isTrusted?: boolean; }; }): void; export {}; //# sourceMappingURL=widgetTelemetry.d.ts.map