@eklabdev/blingts4
Version:
A comprehensive TypeScript decorators library implementing Stage 2 decorators for TS 4.9+
26 lines (25 loc) • 1.22 kB
TypeScript
import { z } from 'zod';
/**
* Validates method arguments using a Zod schema
* @param schema Zod schema for validation
*/
export declare function ValidateArgs(schema: z.ZodType): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
/**
* Marks a method as deprecated
* @param message Optional deprecation message
*/
export declare function Deprecate(message?: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
/**
* Checks for required permissions before executing a method
* @param permissions Required permissions
*/
export declare function GuardSync(GuardFn: (...args: any[]) => boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
export declare function GuardAsync(GuardFn: (...args: any[]) => Promise<boolean>): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
/**
* Implements rate limiting for a method
* @param options Rate limit configuration
*/
export declare function RateLimited(options: {
limit: number;
window: number;
}): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;