UNPKG

ts5deco-express-controller

Version:

TypeScript 5 Modern Decorator Express Controller Framework

57 lines 2.13 kB
import { MiddlewareFunction } from '../types'; /** * 라우트 데코레이터 옵션 */ export interface RouteOptions { path?: string; middlewares?: MiddlewareFunction[]; } /** * GET 요청을 처리하는 라우트 데코레이터 * * @param pathOrOptions - 경로 또는 옵션 객체 * @returns 메서드 데코레이터 * * @example * ```typescript * @Get('/users') * async getUsers() { * // ... * } * * @Get({ path: '/users/:id', middlewares: [validateId] }) * async getUser() { * // ... * } * ``` */ export declare const Get: (pathOrOptions?: string | RouteOptions) => (target: any, context: ClassMethodDecoratorContext) => void; /** * POST 요청을 처리하는 라우트 데코레이터 */ export declare const Post: (pathOrOptions?: string | RouteOptions) => (target: any, context: ClassMethodDecoratorContext) => void; /** * PUT 요청을 처리하는 라우트 데코레이터 */ export declare const Put: (pathOrOptions?: string | RouteOptions) => (target: any, context: ClassMethodDecoratorContext) => void; /** * DELETE 요청을 처리하는 라우트 데코레이터 */ export declare const Delete: (pathOrOptions?: string | RouteOptions) => (target: any, context: ClassMethodDecoratorContext) => void; /** * PATCH 요청을 처리하는 라우트 데코레이터 */ export declare const Patch: (pathOrOptions?: string | RouteOptions) => (target: any, context: ClassMethodDecoratorContext) => void; /** * HEAD 요청을 처리하는 라우트 데코레이터 */ export declare const Head: (pathOrOptions?: string | RouteOptions) => (target: any, context: ClassMethodDecoratorContext) => void; /** * OPTIONS 요청을 처리하는 라우트 데코레이터 */ export declare const Options: (pathOrOptions?: string | RouteOptions) => (target: any, context: ClassMethodDecoratorContext) => void; /** * 모든 HTTP 메서드를 처리하는 라우트 데코레이터 - TypeScript 5 Modern Decorator */ export declare function All(pathOrOptions?: string | RouteOptions): (target: any, context: ClassMethodDecoratorContext) => void; //# sourceMappingURL=route.d.ts.map