import { Time } from "./time.js"; import { Logger } from "./logger.js"; export type TraceCtx = { readonly spanId: string; readonly time: Time; readonly parent: TraceNode; readonly metrics: Map>; readonly logger?: Logger; } & Record; export type CleanCtx = { readonly spanId: string; } & Record; export type TraceCtxParam = { readonly spanId: string; } & Partial<{ readonly time: Time; readonly parent: TraceNode; readonly logger: Logger; }> & Record; export declare class Metric { value?: T; readonly path: string; constructor(path: string); set(value: T): void; add>(value: R): void; } export type MetricMap = Map>; export declare class Metrics { readonly tracenode: TraceNode; private readonly map; readonly spanRefs: MetricMap; constructor(tracenode: TraceNode); toJSON(): Record; get(ipath: string): Metric; } export interface Invokaction { readonly result: "success" | "error"; readonly start: number; readonly end: number; readonly metrics?: Metrics; } export type TraceNodeMap = Map; export declare class TraceNode { readonly childs: TraceNodeMap; readonly invokations: Invokaction[]; readonly spanId: string; readonly ctx: TraceCtx; readonly metrics: Metrics; static root(time: Time, logger?: Logger): TraceNode; constructor(ctx: TraceCtx); getRootPath(rpath?: string[]): string; invokes(): { ctx: CleanCtx; invokations: Invokaction[]; }; ctxWith(spanId: string, logger?: Logger): TraceCtxParam; span Promise | T, T>(inSpanId: string | TraceCtxParam, fn: V): ReturnType; } //# sourceMappingURL=tracer.d.ts.map