import { ICommand } from './abstractCommand'; import { IRequestContext } from "../pipeline/common"; export interface CommandConfiguration { circuitEnabled?: boolean; circuitBreakerSleepWindowInMilliseconds?: number; circuitBreakerRequestVolumeThreshold?: number; executionIsolationSemaphoreMaxConcurrentRequests?: number; fallbackIsolationSemaphoreMaxConcurrentRequests?: number; circuitBreakerForceOpened?: boolean; circuitBreakerForceClosed?: boolean; statisticalWindowNumberOfBuckets?: number; statisticalWindowLength?: number; percentileWindowNumberOfBuckets?: number; percentileWindowLength?: number; circuitBreakerErrorThresholdPercentage?: number; executionTimeoutInMilliseconds?: number; metricsRollingStatisticalWindowInMilliseconds?: number; metricsRollingPercentileWindowInMilliseconds?: number; } /** * Command attribute */ export declare function Command(config?: CommandConfiguration, commandKey?: string, commandGroup?: string): (command: Function) => any; export declare function CommandEntryPoint(ignore?: boolean): (command: any, key: string, pdesc: PropertyDescriptor) => void; export declare class CommandFactory { /** * for test only */ static reset(): void; /** * Declare a command. All commands must be declared. * Do not use this method directly, use @Command */ static declareCommand(command: Function, config: CommandConfiguration, commandKey?: string, commandGroup?: string): { new (context: IRequestContext, ...args: any[]): { [x: string]: any; }; }; /** * Create a new command instance. Do not use it directly, use new instead * Throws an exception if the command is unknown * * @param {IRequestContext} context current context * @param {string} name Command name * @param {any} args Command constructor arguments * @returns {ICommand} A command or null */ static createDynamicCommand(context: IRequestContext, commandName: string, ...args: any[]): T; /** * Create a command proxy to encapsulate command class into a HystrixCommand */ static createProxy(context: IRequestContext, commandName: string, command?: any): { new (context: IRequestContext, ...args): any; }; }