ts5deco-express-controller
Version:
TypeScript 5 Modern Decorator Express Controller Framework
29 lines • 832 B
TypeScript
import { MiddlewareFunction } from '../types';
/**
* 컨트롤러 데코레이터 옵션
*/
export interface ControllerOptions {
path?: string;
middlewares?: MiddlewareFunction[];
}
/**
* 컨트롤러를 정의하는 데코레이터 - TypeScript 5 Modern Decorator
*
* @param pathOrOptions - 기본 경로 또는 옵션 객체
* @returns 클래스 데코레이터
*
* @example
* ```typescript
* @Controller('/api/users')
* export class UserController {
* // ...
* }
*
* @Controller({ path: '/api/users', middlewares: [authMiddleware] })
* export class UserController {
* // ...
* }
* ```
*/
export declare function Controller(pathOrOptions?: string | ControllerOptions): <T extends new (...args: any[]) => any>(target: T, context: ClassDecoratorContext) => T;
//# sourceMappingURL=controller.d.ts.map