import { Type, IType } from "../Type"; import { IContext, IValidationResult } from "../type-checker"; import { INode } from "../../core/interface"; import { ObjectNode } from "../../core/ObjectNode"; export declare type IFunctionReturn = () => T; export declare type IOptionalValue = S | T | IFunctionReturn | IFunctionReturn; export declare class OptionalValue extends Type { readonly type: IType; readonly defaultValue: IOptionalValue; constructor(type: IType, defaultValue: IOptionalValue); readonly flags: number; readonly shouldAttachNode: boolean; readonly valueType: IType; describe(): string; instantiate(parent: ObjectNode, subpath: string, environment: any, value: S): INode; reconcile(current: INode, newValue: any): INode; private getDefaultValue(); isValidSnapshot(value: any, context: IContext): IValidationResult; isAssignableFrom(type: IType): boolean; } export declare function optional(type: IType, defaultValueOrFunction: S): IType; export declare function optional(type: IType, defaultValueOrFunction: T): IType; export declare function optional(type: IType, defaultValueOrFunction: () => S): IType; export declare function optional(type: IType, defaultValueOrFunction: () => T): IType;