/** * @since 2.0.0 */ import type { LazyArg } from "./Function.js"; import type * as MetricKey from "./MetricKey.js"; import type * as MetricState from "./MetricState.js"; import type { Pipeable } from "./Pipeable.js"; import type * as Types from "./Types.js"; /** * @since 2.0.0 * @category symbols */ export declare const MetricHookTypeId: unique symbol; /** * @since 2.0.0 * @category symbols */ export type MetricHookTypeId = typeof MetricHookTypeId; /** * @since 2.0.0 * @category models */ export interface MetricHook extends MetricHook.Variance, Pipeable { get(): Out; update(input: In): void; modify(input: In): void; } /** * @since 2.0.0 */ export declare namespace MetricHook { /** * @since 2.0.0 * @category models */ type Root = MetricHook; /** * @since 2.0.0 * @category models */ type Untyped = MetricHook; /** * @since 2.0.0 * @category models */ type Counter = MetricHook>; /** * @since 2.0.0 * @category models */ type Gauge = MetricHook>; /** * @since 2.0.0 * @category models */ type Frequency = MetricHook; /** * @since 2.0.0 * @category models */ type Histogram = MetricHook; /** * @since 2.0.0 * @category models */ type Summary = MetricHook; /** * @since 2.0.0 * @category models */ interface Variance { readonly [MetricHookTypeId]: { readonly _In: Types.Contravariant; readonly _Out: Types.Covariant; }; } } /** * @since 2.0.0 * @category constructors */ export declare const make: (options: { readonly get: LazyArg; readonly update: (input: In) => void; readonly modify: (input: In) => void; }) => MetricHook; /** * @since 2.0.0 * @category constructors */ export declare const counter: (key: MetricKey.MetricKey.Counter) => MetricHook.Counter; /** * @since 2.0.0 * @category constructors */ export declare const frequency: (_key: MetricKey.MetricKey.Frequency) => MetricHook.Frequency; /** * @since 2.0.0 * @category constructors */ export declare const gauge: { /** * @since 2.0.0 * @category constructors */ (key: MetricKey.MetricKey.Gauge, startAt: number): MetricHook.Gauge; /** * @since 2.0.0 * @category constructors */ (key: MetricKey.MetricKey.Gauge, startAt: bigint): MetricHook.Gauge; }; /** * @since 2.0.0 * @category constructors */ export declare const histogram: (key: MetricKey.MetricKey.Histogram) => MetricHook.Histogram; /** * @since 2.0.0 * @category constructors */ export declare const summary: (key: MetricKey.MetricKey.Summary) => MetricHook.Summary; /** * @since 2.0.0 * @category utils */ export declare const onUpdate: { /** * @since 2.0.0 * @category utils */ (f: (input: In) => void): (self: MetricHook) => MetricHook; /** * @since 2.0.0 * @category utils */ (self: MetricHook, f: (input: In) => void): MetricHook; }; /** * @since 3.6.5 * @category utils */ export declare const onModify: { /** * @since 3.6.5 * @category utils */ (f: (input: In) => void): (self: MetricHook) => MetricHook; /** * @since 3.6.5 * @category utils */ (self: MetricHook, f: (input: In) => void): MetricHook; }; //# sourceMappingURL=MetricHook.d.ts.map