@gabliam/web-core
Version:
Gabliam plugin for add web-core
41 lines (40 loc) • 1.18 kB
TypeScript
import { inversifyInterfaces } from '@gabliam/core';
/**
* Type of the `UseInterceptors` decorator / constructor function.
*/
export interface UseInterceptorsDecorator {
/**
* Decorator that marks a class or a property to use an interceptor.
*
* @usageNotes
*
* Injection of interceptor that are created with @Service
* interceptor can be inject at the top of controller
* (The interceptor is valid for all method) or on method
*
* The following example use a interceptor on property
*
* ```typescript
* @RestController()
* class Sample {
* @UseInterceptors(LogInterceptor)
* @Get('/hello')
* hello() {
* return 'hello world';
* }
* }
* ```
*/
(...ids: inversifyInterfaces.ServiceIdentifier<any>[]): any;
/**
* see the `@UseInterceptors` decorator.
*/
new (...ids: inversifyInterfaces.ServiceIdentifier<any>[]): any;
}
/**
* `UseInterceptors` decorator and metadata.
*/
export interface UseInterceptors {
ids: inversifyInterfaces.ServiceIdentifier<any>[];
}
export declare const UseInterceptors: UseInterceptorsDecorator;