UNPKG

@tsed/common

Version:
53 lines (52 loc) 1.13 kB
import { Header as H } from "@tsed/schema"; /** * Sets the response’s HTTP header field to value. To set multiple fields at once, pass an object as the parameter. * * ```typescript * @Header('Content-Type', 'text/plain'); * private myMethod() {} * * @Status(204) * @Header({ * "Content-Type": "text/plain", * "Content-Length": 123, * "ETag": { * "value": "12345", * "description": "header description" * } * }) * private myMethod() {} * ``` * * This example will produce the swagger responses object: * * ```json * { * "responses": { * "204": { * "description": "Description", * "headers": { * "Content-Type": { * "type": "string" * }, * "Content-Length": { * "type": "number" * }, * "ETag": { * "type": "string", * "description": "header description" * } * } * } * } * } * ``` * * @decorator * @operation * @response * @ignore * @deprecated Since v6. Use @Header from @tsed/schema. * @ignore */ export declare const Header: typeof H;