UNPKG

@opra/common

Version:
16 lines (15 loc) 1.31 kB
import type { StrictOmit, Type, TypeThunkAsync } from 'ts-gems'; import type { HttpController } from '../http/http-controller.js'; import type { HttpParameter } from '../http/http-parameter.js'; export interface HttpControllerDecorator<T extends HttpControllerDecorator<any> = HttpControllerDecorator<any>> extends ClassDecorator { Cookie(name: string | RegExp, optionsOrType?: StrictOmit<HttpParameter.Options, 'location'> | string | Type | false): T; Header(name: string | RegExp, optionsOrType?: StrictOmit<HttpParameter.Options, 'location'> | string | TypeThunkAsync | false): T; QueryParam(name: string | RegExp, optionsOrType?: StrictOmit<HttpParameter.Options, 'location'> | string | TypeThunkAsync | false): T; PathParam(name: string | RegExp, optionsOrType?: StrictOmit<HttpParameter.Options, 'location'> | string | TypeThunkAsync | false): T; KeyParam(name: string | RegExp, optionsOrType?: StrictOmit<HttpParameter.Options, 'location'> | string | TypeThunkAsync | false): T; UseType(...type: TypeThunkAsync[]): T; } export interface HttpControllerDecoratorFactory { <T extends HttpController.Options>(options?: T): HttpControllerDecorator; } export declare function HttpControllerDecoratorFactory<O extends HttpController.Options>(options?: O): HttpControllerDecorator;