import type { Context, MiddlewareHandler } from 'hono'; /** Hono variables used to collect Server-Timing metrics. */ export type Variables = { /** Operations that have started but not finished. */ activeTimings?: Active[] | undefined; /** Metrics emitted in the `Server-Timing` response header. */ serverTiming?: Metric[] | undefined; }; /** Hono environment shape used by timing helpers. */ export type Environment = { Variables: Variables; }; /** One Server-Timing metric. */ export type Metric = { /** Metric duration in milliseconds. */ duration: number; /** Metric name. */ name: string; }; /** One operation that has started but not finished. */ export type Active = { /** Metric name. */ name: string; /** Monotonic start time. */ start: number; }; /** Adds a `Server-Timing` header with total request duration. */ export declare function middleware(): MiddlewareHandler; /** Measures one async operation and adds it to the current request timings. */ export declare function time(c: Context, name: string, fn: () => Promise | value): Promise; //# sourceMappingURL=Timing.d.ts.map