execution-engine
Version:
A TypeScript library for tracing and visualizing code execution workflows.
17 lines • 866 B
TypeScript
import { TraceContext } from './trace';
/**
* Method decorator to trace function execution, capturing metadata, inputs, outputs, and errors.
*
* @param onTraceEvent - handle function of the trace context.
* @param additionalContext - Additional metadata to attach to the trace context.
* @param options - Configuration options:
* - `contextKey`: Key to store trace context on the instance.
* - `errorStrategy`: Determines whether errors should be caught (`'catch'`) or thrown (`'throw'`).
*
* @returns A method decorator that wraps the original function with execution tracing.
*/
export declare function trace<O>(onTraceEvent: (traceContext: TraceContext<O>) => void, additionalContext?: Record<string, any>, options?: {
contextKey?: string;
errorStrategy?: 'catch' | 'throw';
}): MethodDecorator;
//# sourceMappingURL=trace.decorator.d.ts.map