@yamamotok/dataobject
Version:
Decorator based JSON serializer and deserializer.
16 lines (15 loc) • 988 B
TypeScript
import { PropertyDecoratorOptions } from './PropertyDecoratorOptions';
import { ValidatorFunction, ValidatorFunctionS, ValidatorOptions } from './Validator';
export declare class Decorator {
static readonly PropertiesMetadataKey: unique symbol;
static getPropertyMap(obj: unknown): PropertyMap | undefined;
private static propertyMap;
static property(options?: PropertyDecoratorOptions): PropertyDecorator;
static required(): PropertyDecorator;
static spread(context?: string | string[]): PropertyDecorator;
static context(...contextNames: string[]): PropertyDecorator;
static validator(validator: ValidatorFunction, options?: ValidatorOptions): PropertyDecorator;
static validatorS(validator: ValidatorFunctionS, options?: ValidatorOptions): PropertyDecorator;
}
export declare type PropertyDecorator = (target: unknown, propertyKey: string) => void;
export declare type PropertyMap = Map<string, undefined | PropertyDecoratorOptions>;