import { IOEndpoint } from '../io-tools'; import { EventsDefinition } from '../object-plus'; import { AttributeOptions, AttributeToJSON, Parse } from './metatypes'; export interface AttributeCheck { (value: any, key: string): boolean; error?: any; } export declare type Infer = A extends ChainableAttributeSpec ? TrueReturnType : A extends Function ? TrueReturnType : A; declare type TrueReturnType = F extends DateConstructor ? Date : F extends (...args: any[]) => infer R ? R : F extends new (...args: any[]) => infer R ? R : void; export declare class ChainableAttributeSpec { options: AttributeOptions & { type?: F; }; constructor(options: AttributeOptions); check(check: AttributeCheck, error?: any): this; readonly as: PropertyDecorator; readonly isRequired: this; readonly required: this; endpoint(endpoint: IOEndpoint): this; watcher(ref: string | ((value: any, key: string) => void)): this; parse(fun: Parse): this; toJSON(fun: AttributeToJSON): this; get(fun: any): this; set(fun: any): this; changeEvents(events: boolean): this; events(map: EventsDefinition): this; readonly has: this; metadata(options: object): this; value(x: any): this; static from(spec: any): ChainableAttributeSpec; } export declare function type(this: void, Type: ChainableAttributeSpec | F, value?: any): ChainableAttributeSpec; export declare function shared(this: void, Constructor: C): ChainableAttributeSpec; export declare function value(this: void, x: any): ChainableAttributeSpec; export {};