@apizr-io/class-utils
Version:
Package containing all class-validator function with all custom apizr class validation functions
19 lines (18 loc) • 700 B
TypeScript
import { ClassConstructor } from 'class-transformer';
type BaseType = 'string' | 'number' | 'boolean' | 'undefined' | 'null' | 'object';
type AdvancedType = {
type: AllowedType | AllowedType[];
array?: boolean;
};
export type AllowedType = ClassConstructor<object> | BaseType | AdvancedType;
type UnionAdvancedType = {
type: UnionAllowedType | UnionAllowedType[];
array?: boolean;
};
export type UnionAllowedType = ClassConstructor<object> | BaseType | UnionAdvancedType | {
key: 'string' | 'number';
value: UnionAllowedType | UnionAllowedType[];
array?: boolean;
};
export declare const isOneOfTypes: (types: UnionAllowedType[], obj: any) => Promise<boolean>;
export {};