/** * Validation decorators for parameter, role, and permission checking */ import { ChatContext } from '@/types/models'; import type { DecoratorHandler } from './base'; /** * Decorator that only executes if message has parameters */ export declare function HasParam(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor; /** * Decorator that only executes if message is a reply */ export declare function IsReply(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor; /** * Decorator that only executes if user has specific roles or passes custom validation * @param allowedRolesOrValidator - 허용된 역할 배열 또는 커스텀 검증 함수 * @param callbackOrLabel - 권한이 없을 때 실행될 콜백 함수 또는 커스텀 검증 함수의 레이블 텍스트 * @param callback - 권한이 없을 때 실행될 콜백 함수 (커스텀 레이블 사용 시) */ export declare function HasRole(allowedRolesOrValidator: string[] | ((context: ChatContext) => Promise | boolean), callbackOrLabel?: string | ((context: ChatContext, allowedRoles: string[] | undefined, userRole: string | null) => Promise), callback?: (context: ChatContext, allowedRoles: string[] | undefined, userRole: string | null) => Promise): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; /** * Decorator that only executes if user is admin (HOST or MANAGER) */ export declare function IsAdmin(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor; /** * Decorator that only executes if user is not banned */ export declare function IsNotBanned(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor; /** * Decorator for throttling commands (rate limiting) * @param maxCalls - 최대 호출 횟수 * @param windowMs - 시간 창 (밀리초) * @param callback - 제한 시 실행될 콜백 함수 */ export declare function Throttle(maxCalls: number, windowMs: number, callback?: (context: ChatContext, maxCalls: number, windowMs: number, msUntilNext: number) => Promise): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; /** * Room decorator for restricting execution to specific rooms * Can be used as both class decorator and method decorator * @param roomIds - 허용된 방 ID 배열 */ export declare function AllowedRoom(roomIds: string[]): ClassDecorator & MethodDecorator; /** * Function-based decorators for easier use (backward compatibility) */ export declare const decorators: { hasParam: (handler: DecoratorHandler) => DecoratorHandler; isReply: (handler: DecoratorHandler) => DecoratorHandler; isAdmin: (handler: DecoratorHandler) => DecoratorHandler; isNotBanned: (handler: DecoratorHandler) => DecoratorHandler; }; export declare const hasParam: (handler: DecoratorHandler) => DecoratorHandler; export declare const isReply: (handler: DecoratorHandler) => DecoratorHandler; export declare const isAdmin: (handler: DecoratorHandler) => DecoratorHandler; export declare const isNotBanned: (handler: DecoratorHandler) => DecoratorHandler; /** * Debug function to check room restrictions for a method */ export declare function debugRoomRestrictions(method: Function, controllerConstructor?: Function): void; //# sourceMappingURL=validation.d.ts.map