import { Schema } from "../schema"; import { DatasetStore } from "../../dataset-store/dataset-store"; import { EnumField, KeyField, PickField, ProbabilityField, RefField, SequenceField, SequentialField } from "../../fields/core"; import { CustomField } from "../../fields/core/custom/custom-field"; import { IResolver } from "../../resolvers/interfaces/resolvers"; import { FieldIsArray } from "../../schema-resolver/value-object/array"; import { FieldPossibleNull } from "../../schema-resolver/value-object/possible-null"; export declare type FieldTypes = CustomField | KeyField | EnumField | PickField | ProbabilityField | RefField | SequenceField | SequentialField | Schema; export declare type FieldObjectInput = { /** Schema field type*/ type: FieldTypes; /** Array schema field configuration * - `boolean`- array length between 1 and 10 * - `number` - specific array length * - `config.min` and `config.max` - limits of array length */ isArray?: IsArrayConfig; /** Null schema field configuration * - `boolean` - `true` 100% chances to be null, `false` 0% chances * - `number` specific porcent of chances * - `function` function that returns a number between 0 and 1 or a boolean. Receive 'currentFields' and 'store' as parameters */ possibleNull?: PossibleNullConfig; }; export declare type SchemaFieldConfig = FieldTypes | FieldObjectInput; /** * Input schema config */ export declare type SchemaInput = Record; export declare type ResolverObject = { type: IResolver; isArray: FieldIsArray; possibleNull: FieldPossibleNull; }; export declare type ArrayLimitObject = { min?: number; max?: number; }; export declare type IsArrayFunction = (props: IsArrayFunctionProps) => ArrayLimitObject | number | undefined | Promise; export declare type IsArrayFunctionProps = { /** Current schema document fields */ currentFields: C; /** Store to interact with all dataset schemas */ store: DatasetStore; }; export declare type PossibleNullFunction = (props: PossibleNullFunctionProps) => number | boolean | undefined | Promise; export declare type PossibleNullFunctionProps = { /** Current schema document fields */ currentFields: C; /** Store to interact with all dataset schemas */ store: DatasetStore; }; export declare type IsArrayConfig = number | ArrayLimitObject | IsArrayFunction | undefined; export declare type PossibleNullConfig = boolean | number | PossibleNullFunction | undefined;