UNPKG

@dooboostore/simple-boot-http-server

Version:

back end http server frameworks

74 lines 4.8 kB
import 'reflect-metadata'; import { ConstructorType } from '@dooboostore/core/types'; import { ReflectMethod } from '@dooboostore/simple-boot/types/Types'; import { Resolver } from '../resolvers/Resolver'; import { Mimes } from '../codes/Mimes'; import { HttpMethod } from '../codes/HttpMethod'; export declare enum UrlMappingSituationType { REQ_JSON_BODY = "SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_JSON_BODY", REQ_FORM_URL_BODY = "SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_FORM_URL_BODY" } export type MappingConfig = { method: HttpMethod | string; description?: { name?: string; detail?: string; }; req?: { contentType?: (Mimes | string)[]; accept?: (Mimes | string)[]; }; res?: { status?: number; header?: { [key: string]: string; }; contentType?: Mimes | string; }; resolver?: Resolver | ConstructorType<Resolver>; }; export type SaveMappingConfig = { propertyKey: string | symbol; config: MappingConfig; }; export declare function UrlMapping(config: MappingConfig): ReflectMethod; export declare function UrlMapping(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getUrlMapping: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getUrlMappings: (target: any) => SaveMappingConfig[]; export declare function GET(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function GET(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getGET: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getGETS: (target: any) => SaveMappingConfig[]; export declare function POST(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function POST(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getPOST: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getPOSTS: (target: any) => SaveMappingConfig[]; export declare function DELETE(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function DELETE(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getDELETE: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getDELETES: (target: any) => SaveMappingConfig[]; export declare function PUT(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function PUT(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getPUT: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getPUTS: (target: any) => SaveMappingConfig[]; export declare function PATCH(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function PATCH(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getPATCH: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getPATCHS: (target: any) => SaveMappingConfig[]; export declare function OPTIONS(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function OPTIONS(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getOPTIONS: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getOPTIONSS: (target: any) => SaveMappingConfig[]; export declare function HEAD(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function HEAD(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getHEAD: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getHEADS: (target: any) => SaveMappingConfig[]; export declare function TRACE(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function TRACE(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getTRACE: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getTRACES: (target: any) => SaveMappingConfig[]; export declare function CONNECT(config: Omit<MappingConfig, 'method'>): ReflectMethod; export declare function CONNECT(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; export declare const getCONNECT: (target: any, propertyKey: string | symbol) => MappingConfig | undefined; export declare const getCONNECTS: (target: any) => SaveMappingConfig[]; //# sourceMappingURL=MethodMapping.d.ts.map