/** * ThreadTS Universal - Observability Decorators * * Decorators for logging, measuring, and validating method execution. * Supports both legacy (experimentalDecorators) and Stage-3 decorator syntax. * * @module decorators/observability */ /** * Decorator for logging method execution * Logs method calls, arguments, results, and execution time */ export declare function logged(options?: { logArgs?: boolean; logResult?: boolean; logTiming?: boolean; }): (targetOrMethod: unknown, propertyKeyOrContext?: string | symbol | import('./utils').DecoratorContext, descriptor?: PropertyDescriptor) => import('./utils').DecoratorReturnType; /** * Performance statistics type */ export interface PerformanceStats { count: number; min: number; max: number; avg: number; median: number; p95: number; p99: number; } /** * Decorator for measuring method performance. * Collects timing statistics across multiple calls. * * @example * ```typescript * class Calculator { * @measure() * async compute(data: number[]): Promise { * return data.reduce((a, b) => a + b, 0); * } * } * // Access stats: Calculator.prototype.compute.getStats() * ``` */ export declare function measure(): (targetOrMethod: unknown, propertyKeyOrContext?: string | symbol | import('./utils').DecoratorContext, descriptor?: PropertyDescriptor) => import('./utils').DecoratorReturnType; /** * Validator function type */ export type ValidatorFn = (arg: unknown) => boolean | string; /** * Decorator for validating method arguments. * Throws an error if validation fails. * * @param validators - Array of validator functions for each argument * * @example * ```typescript * class UserService { * @validate([ * (id) => typeof id === 'string' && id.length > 0, * (data) => data && typeof data.name === 'string' * ]) * async updateUser(id: string, data: UserData): Promise { * await api.updateUser(id, data); * } * } * ``` */ export declare function validate(validators: ValidatorFn[]): (targetOrMethod: unknown, propertyKeyOrContext?: string | symbol | import('./utils').DecoratorContext, descriptor?: PropertyDescriptor) => import('./utils').DecoratorReturnType; //# sourceMappingURL=observability.d.ts.map