UNPKG

@eklabdev/blingts4

Version:

A comprehensive TypeScript decorators library implementing Stage 2 decorators for TS 4.9+

22 lines (21 loc) 1.08 kB
import { RetryOptions, CircuitBreakerOptions } from '../../types'; /** * Retries a method call on failure * @param options Retry configuration options */ export declare function Retry(options: RetryOptions): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; /** * Limits the execution time of a method * @param ms Timeout in milliseconds */ export declare function Timeout(ms: number): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; /** * Implements the circuit breaker pattern * @param options Circuit breaker configuration options */ export declare function CircuitBreaker(options: CircuitBreakerOptions): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; /** * Provides a fallback implementation when the method fails * @param fallbackFn Fallback function to execute */ export declare function Fallback<T extends (...args: any[]) => any>(fallbackFn: T): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;