/** * Type checker functions inspired by React.PropTypes. */ import { Model } from ".."; export declare interface TypeCheckFunc { (value: any, name: string): null; isRequired?: TypeCheckFunc; load?: (value: any) => any; ref?: typeof Model; } /** * ReferenceTypeOption can specify the options of reference type. */ export interface ReferenceTypeOption { /** * eager: * If it's true, methods like `find` will try to load the newest data for the referenced models. * Otherwise the referenced models will be just decoded class instances stored under this parent's namespace. */ eager?: boolean; } export declare const Types: { array: TypeCheckFunc; bool: TypeCheckFunc; number: TypeCheckFunc; object: TypeCheckFunc; string: TypeCheckFunc; date: TypeCheckFunc; arrayOf: (checkValue: TypeCheckFunc) => TypeCheckFunc; dictOf: (checkValue: TypeCheckFunc) => TypeCheckFunc; reference: (refConstructor: typeof Model, opt?: ReferenceTypeOption) => TypeCheckFunc; shape: (validations?: { [key: string]: TypeCheckFunc; }) => TypeCheckFunc; };