import { Fork } from "../types"; declare type Deep = boolean | ((type: Type, value: any) => void); export declare type Type = ArrayType | IdentityType | ObjectType | OrType | PredicateType; export interface AnyType { toString(): string; check(value: any, deep?: Deep): boolean; assert(value: any, deep?: Deep): boolean; arrayOf(): AnyType; } declare abstract class BaseType { abstract toString(): string; abstract check(value: any, deep?: Deep): value is T; assert(value: any, deep?: Deep): value is T; arrayOf(): Type; } declare class ArrayType extends BaseType { readonly elemType: Type; readonly kind: "ArrayType"; constructor(elemType: Type); toString(): string; check(value: any, deep?: Deep): value is T; } declare class IdentityType extends BaseType { readonly value: T; readonly kind: "IdentityType"; constructor(value: T); toString(): string; check(value: any, deep?: Deep): value is T; } declare class ObjectType extends BaseType { readonly fields: Field[]; readonly kind: "ObjectType"; constructor(fields: Field[]); toString(): string; check(value: any, deep?: Deep): value is T; } declare class OrType extends BaseType { readonly types: Type[]; readonly kind: "OrType"; constructor(types: Type[]); toString(): string; check(value: any, deep?: Deep): value is T; } declare class PredicateType extends BaseType { readonly name: string; readonly predicate: (value: any, deep?: Deep) => boolean; readonly kind: "PredicateType"; constructor(name: string, predicate: (value: any, deep?: Deep) => boolean); toString(): string; check(value: any, deep?: Deep): value is T; } export declare abstract class Def { readonly type: Type; readonly typeName: string; baseNames: string[]; ownFields: { [name: string]: Field; }; allSupertypes: { [name: string]: Def; }; supertypeList: string[]; allFields: { [name: string]: Field; }; fieldNames: string[]; finalized: boolean; buildable: boolean; buildParams: string[]; constructor(type: Type, typeName: string); isSupertypeOf(that: Def): boolean; checkAllFields(value: any, deep?: any): boolean; abstract check(value: any, deep?: any): boolean; bases(...supertypeNames: string[]): this; abstract build(...buildParams: string[]): this; abstract field(name: string, type: any, defaultFn?: Function, hidden?: boolean): this; abstract finalize(): void; } declare class Field { readonly name: string; readonly type: Type; readonly defaultFn?: Function | undefined; readonly hidden: boolean; constructor(name: string, type: Type, defaultFn?: Function | undefined, hidden?: boolean); toString(): string; getValue(obj: { [key: string]: any; }): any; } declare type FieldType = Field; export { FieldType as Field }; export interface ASTNode { type: string; } export interface Builder { (...args: any[]): ASTNode; from(obj: { [param: string]: any; }): ASTNode; } export default function typesPlugin(_fork: Fork): { Type: { or(...types: any[]): Type; from(value: any, name?: string | undefined): Type; def(typeName: string): Def; hasDef(typeName: string): boolean; }; builtInTypes: { string: Type; function: Type; array: Type; object: Type<{ [key: string]: any; }>; RegExp: Type; Date: Type; number: Type; boolean: Type; null: Type; undefined: Type; }; getSupertypeNames: (typeName: string) => string[]; computeSupertypeLookupTable: (candidates: any) => { [typeName: string]: any; }; builders: import("../gen/builders").builders; defineMethod: (name: any, func?: Function | undefined) => Function; getBuilderName: (typeName: any) => any; getStatementBuilderName: (typeName: any) => any; namedTypes: import("../gen/namedTypes").NamedTypes; getFieldNames: (object: any) => string[]; getFieldValue: (object: any, fieldName: any) => any; eachField: (object: any, callback: (name: any, value: any) => any, context?: any) => void; someField: (object: any, callback: (name: any, value: any) => any, context?: any) => boolean; finalize: () => void; };