@tsed/common
Version:
A TypeScript Framework on top of Express
33 lines (32 loc) • 1.02 kB
TypeScript
import { Type } from "@tsed/core";
import { IParamOptions } from "../../interfaces/IParamOptions";
/**
* HeaderParams return the value from [`request.get()`](http://expressjs.com/en/4x/api.html#req.get) method.
*
* #### Example
*
* ```typescript
* @Controller('/')
* class MyCtrl {
* @Get('/')
* get(@HeaderParams() body: any) {
* console.log('Entire body', body);
* }
*
* @Get('/')
* get(@HeaderParams('x-token') token: string) {
* console.log('token', id);
* }
* }
* ```
*
* @param expression The path of the property to get.
* @decorator
* @operation
* @input
*/
export declare function HeaderParams(expression: string, useType: Type<any>): ParameterDecorator;
export declare function HeaderParams(expression: string): ParameterDecorator;
export declare function HeaderParams(useType: Type<any>): ParameterDecorator;
export declare function HeaderParams(options: IParamOptions<any>): ParameterDecorator;
export declare function HeaderParams(): ParameterDecorator;