UNPKG

@master4n/decorators

Version:
30 lines (28 loc) 1.05 kB
/*** * Decorator can set a class property value from YAML file * @param ymlKey a key from yaml file. * @param ymlValue a default direct value. */ declare function Value(ymlKey: string, ymlValue?: any): (target: any, propertyKey: string) => void; /** * Decorator can set a class property as UUIDv4 value */ declare function GenerateID(target: any, key: string): void; /** * Decorator will allow defined and non null values only. */ declare function NotNull(target: any, key: string, descriptor: PropertyDescriptor): PropertyDescriptor; /** * Decorator for date validation. */ declare function ValidDate(target: any, key: string | symbol): void; /** * Decorator for static property of class. * It will make static property work as counter */ declare function Counter(target: any, propertyKey: string): void; /** * Decorator logging in and out of method. */ declare function Log(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; export { Counter, GenerateID, Log, NotNull, ValidDate, Value };