@opra/common
Version:
Opra common package
33 lines (32 loc) • 1.68 kB
TypeScript
import type { ThunkAsync, Type, TypeThunkAsync } from 'ts-gems';
import type { MQHeader } from '../mq/mq-header';
import type { MQOperation } from '../mq/mq-operation.js';
import type { MQOperationResponse } from '../mq/mq-operation-response.js';
export interface MQOperationDecorator {
(target: Object, propertyKey: string): void;
Header(name: string | RegExp, optionsOrType?: MQHeader.Options | string | TypeThunkAsync): this;
Response(type: TypeThunkAsync | string, options?: MQOperationResponse.Options): MQOperationResponseDecorator;
UseType(...type: Type[]): this;
}
export interface MQOperationResponseDecorator {
(target: Object, propertyKey: string): void;
Header(name: string | RegExp, optionsOrType?: MQHeader.Options | string | TypeThunkAsync): this;
}
/**
* @namespace MQOperationDecoratorFactory
*/
export interface MQOperationDecoratorFactory {
/**
* Property decorator
* @param decoratorChain
* @param type
* @param options
*/ <T extends MQOperation.Options>(decoratorChain: Function[], type: ThunkAsync<Type> | string, options?: T): MQOperationDecorator;
}
export declare namespace MQOperationDecoratorFactory {
type AugmentationFunction = (decorator: MQOperationDecorator, decoratorChain: Function[], type: ThunkAsync<Type> | string, options?: MQOperation.Options) => void;
}
export declare function MQOperationDecoratorFactory(decoratorChain: Function[], type: ThunkAsync<Type> | string | TypeThunkAsync, options?: MQOperation.Options): MQOperationDecorator;
export declare namespace MQOperationDecoratorFactory {
var augment: (fn: MQOperationDecoratorFactory.AugmentationFunction) => void;
}