/**
 * @almadar/ui/runtime — perf instrumentation
 *
 * Ring buffer of timing events for the canvas render path, plus mark/measure
 * helpers and a React.Profiler onRender callback. All gated behind
 * `createLogger('almadar:perf:canvas')` so production (LOG_LEVEL >= WARN)
 * skips both `performance.*` calls and the ring write.
 */
import type { ProfilerOnRenderCallback } from 'react';
export declare const PERF_NAMESPACE = "almadar:perf:canvas";
export interface PerfEntry {
    readonly name: string;
    readonly durationMs: number;
    readonly ts: number;
    readonly detail?: Readonly<Record<string, unknown>>;
}
/**
 * Start a phase. Returns an opaque token; pass to {@link perfEnd}.
 * Returns -1 when the namespace is gated off, so call sites pay only one comparison.
 */
export declare function perfStart(name: string): number;
export declare function perfEnd(name: string, startToken: number, detail?: Record<string, unknown>): void;
/** Synchronous wrapper that times a fn end-to-end. */
export declare function perfTime<T>(name: string, fn: () => T, detail?: Record<string, unknown>): T;
/**
 * React.Profiler `onRender` callback. Records `actualDuration` per commit.
 * Phase is `"mount" | "update" | "nested-update"`.
 */
export declare const profilerOnRender: ProfilerOnRenderCallback;
/** Snapshot in insertion order (oldest first). Stable identity until next push. */
export declare function getPerfSnapshot(): readonly PerfEntry[];
/** React hook: returns the current ring snapshot, re-renders on push. */
export declare function usePerfBuffer(): readonly PerfEntry[];
export declare function clearPerf(): void;
