Comparing version 0.2.0-beta.38 to 0.2.0-beta.39
import { BasicModel } from '../models'; | ||
import { Validators } from '../validate'; | ||
import { IValidators } from '../validate'; | ||
import { Maybe } from '../maybe'; | ||
@@ -13,6 +13,6 @@ export declare abstract class BasicBuilder<Value, Model extends BasicModel<Value>> { | ||
readonly phantomModel: Model; | ||
protected _validators: Validators<Value>; | ||
protected _validators: IValidators<Value>; | ||
abstract build(defaultValue?: Maybe<Value>): Model; | ||
validators(...validators: Validators<Value>): this; | ||
validators(...validators: IValidators<Value>): this; | ||
} | ||
//# sourceMappingURL=basic.d.ts.map |
import { FieldArrayModel, BasicModel, FieldArrayChild, ModelRef } from './models'; | ||
import { Validators } from './validate'; | ||
import { IValidators } from './validate'; | ||
export declare type IUseFieldArray<Item, Child extends BasicModel<Item>> = [FieldArrayChild<Item, Child>[], FieldArrayModel<Item, Child>]; | ||
export declare function useFieldArray<Item, Child extends BasicModel<Item>>(field: string | ModelRef<readonly Item[], any, FieldArrayModel<Item, Child>>, validators?: Validators<readonly (Item | null)[]>, defaultValue?: Item[]): FieldArrayModel<Item, Child>; | ||
export declare function useFieldArray<Item, Child extends BasicModel<Item>>(field: string | ModelRef<readonly Item[], any, FieldArrayModel<Item, Child>>, validators?: IValidators<readonly (Item | null)[]>, defaultValue?: Item[]): FieldArrayModel<Item, Child>; | ||
export declare function useFieldArray<Item, Child extends BasicModel<Item>>(field: FieldArrayModel<Item, Child>): FieldArrayModel<Item, Child>; | ||
//# sourceMappingURL=field-array.d.ts.map |
import { IFormContext } from './context'; | ||
import { FieldSetModel, BasicModel, ModelRef, $FieldSetValue } from './models'; | ||
import { Validators } from './validate'; | ||
import { IValidators } from './validate'; | ||
export declare type IUseFieldSet<T extends Record<string, BasicModel<any>>> = [IFormContext, FieldSetModel<T>]; | ||
export declare function useFieldSet<T extends Record<string, BasicModel<any>>>(field: string | FieldSetModel<T> | ModelRef<$FieldSetValue<T>, any, FieldSetModel<T>>, validators?: Validators<T>): IUseFieldSet<T>; | ||
export declare function useFieldSet<T extends Record<string, BasicModel<any>>>(field: string | FieldSetModel<T> | ModelRef<$FieldSetValue<T>, any, FieldSetModel<T>>, validators?: IValidators<T>): IUseFieldSet<T>; | ||
//# sourceMappingURL=field-set.d.ts.map |
import { FieldModel, ModelRef } from './models'; | ||
import { Validators } from './validate'; | ||
import { IValidators } from './validate'; | ||
export declare function makeDefaultFieldProps<Value>(model: FieldModel<Value>): { | ||
@@ -11,4 +11,4 @@ value: Value; | ||
}; | ||
export declare function useField<Value>(field: string, defaultValue: Value | (() => Value), validators?: Validators<Value>): FieldModel<Value>; | ||
export declare function useField<Value>(field: string, defaultValue: Value | (() => Value), validators?: IValidators<Value>): FieldModel<Value>; | ||
export declare function useField<Value>(field: FieldModel<Value> | ModelRef<Value, any, FieldModel<Value>>): FieldModel<Value>; | ||
//# sourceMappingURL=field.d.ts.map |
import { Subject, BehaviorSubject } from 'rxjs'; | ||
import { ValidateOption, IMaybeError, IValidation, Validators } from '../validate'; | ||
import { ValidateOption, IMaybeError, IValidation, IValidators } from '../validate'; | ||
import { FieldSetModel } from './set'; | ||
@@ -29,3 +29,3 @@ import { ModelRef } from './ref'; | ||
/** @internal */ | ||
validators: Validators<Value>; | ||
validators: IValidators<Value>; | ||
/** @internal */ | ||
@@ -32,0 +32,0 @@ initialValue: Maybe<Value>; |
@@ -12,4 +12,4 @@ import { Observable, NextObserver } from 'rxjs'; | ||
} | ||
export declare type Validator<T> = IAsyncValidator<T> | ISyncValidator<T>; | ||
export declare type Validators<T> = readonly Validator<T>[]; | ||
export declare type IValidator<T> = IAsyncValidator<T> | ISyncValidator<T>; | ||
export declare type IValidators<T> = readonly IValidator<T>[]; | ||
export declare function isAsyncValidator<T>(validator: ISyncValidator<T> | IAsyncValidator<T>): validator is IAsyncValidator<T>; | ||
@@ -16,0 +16,0 @@ export declare function createAsyncValidator<T>(validator: () => null | Observable<IMaybeError<T>> | Promise<IMaybeError<T>>): IAsyncValidator<T>; |
{ | ||
"name": "formulr", | ||
"version": "0.2.0-beta.38", | ||
"version": "0.2.0-beta.39", | ||
"description": "Form toolkit for React", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
import { BasicModel } from '../models'; | ||
import { Validators } from '../validate'; | ||
import { IValidators } from '../validate'; | ||
import { Maybe } from '../maybe'; | ||
@@ -14,7 +14,7 @@ | ||
readonly phantomModel!: Model; | ||
protected _validators: Validators<Value> = []; | ||
protected _validators: IValidators<Value> = []; | ||
abstract build(defaultValue?: Maybe<Value>): Model; | ||
validators(...validators: Validators<Value>) { | ||
validators(...validators: IValidators<Value>) { | ||
this._validators = validators; | ||
@@ -21,0 +21,0 @@ return this; |
import { Subject, BehaviorSubject } from 'rxjs'; | ||
import { ValidateOption, IMaybeError, ErrorSubscriber, IValidation, validate, Validators } from '../validate'; | ||
import { ValidateOption, IMaybeError, ErrorSubscriber, IValidation, validate, IValidators } from '../validate'; | ||
import { switchMap } from 'rxjs/operators'; | ||
@@ -35,3 +35,3 @@ import { FieldSetModel } from './set'; | ||
/** @internal */ | ||
validators: Validators<Value> = []; | ||
validators: IValidators<Value> = []; | ||
/** @internal */ | ||
@@ -38,0 +38,0 @@ initialValue: Maybe<Value> = None(); |
@@ -17,5 +17,5 @@ import { Observable, from, NextObserver, empty, of, defer } from 'rxjs'; | ||
export type Validator<T> = IAsyncValidator<T> | ISyncValidator<T>; | ||
export type IValidator<T> = IAsyncValidator<T> | ISyncValidator<T>; | ||
export type Validators<T> = readonly Validator<T>[]; | ||
export type IValidators<T> = readonly IValidator<T>[]; | ||
@@ -22,0 +22,0 @@ export function isAsyncValidator<T>( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
190398