Namespace: yup
Namespaces​
Classes​
References​
InferType​
Renames and re-exports Asserts
boolean​
Renames and re-exports bool
Type aliases​
AnyObjectSchema​
Ƭ AnyObjectSchema: ObjectSchema
<any
, any
, any
, any
>
AnySchema​
Ƭ AnySchema<Type
, TContext
, TOut
>: BaseSchema
<Type
, TContext
, TOut
>
Type parameters​
Name | Type |
---|---|
Type | any |
TContext | any |
TOut | any |
Asserts​
Ƭ Asserts<TSchema
>: TSchema
["__outputType"
]
Type parameters​
Name | Type |
---|---|
TSchema | extends TypedSchema |
CreateErrorOptions​
Ƭ CreateErrorOptions: Object
Type declaration​
Name | Type |
---|---|
message? | Message <any > |
params? | ExtraParams |
path? | string |
type? | string |
SchemaOf​
Ƭ SchemaOf<T
>: T
extends infer E[] ? ArraySchema
<SchemaOf
<E
> | Lazy
<SchemaOf
<E
>>> : T
extends AnyObject
? ObjectSchemaOf
<T
> : BaseSchema
<Maybe
<T
>, AnyObject
, T
>
Type parameters​
Name |
---|
T |
TestConfig​
Ƭ TestConfig<TValue
, TContext
>: Object
Type parameters​
Name | Type |
---|---|
TValue | unknown |
TContext | {} |
Type declaration​
Name | Type |
---|---|
exclusive? | boolean |
message? | Message <any > |
name? | string |
params? | ExtraParams |
test | TestFunction <TValue , TContext > |
TestContext​
Ƭ TestContext<TContext
>: Object
Type parameters​
Name | Type |
---|---|
TContext | {} |
Type declaration​
Name | Type |
---|---|
options | ValidateOptions <TContext > |
parent | any |
path | string |
schema | any |
createError | (params? : CreateErrorOptions ) => ValidationError |
resolve | <T>(value : T | default <T >) => T |
TestFunction​
Ƭ TestFunction<T
, TContext
>: (this
: TestContext
<TContext
>, value
: T
, context
: TestContext
<TContext
>) => boolean
| ValidationError
| Promise
<boolean
| ValidationError
>
Type parameters​
Name | Type |
---|---|
T | unknown |
TContext | {} |
Type declaration​
â–¸ (this
, value
, context
): boolean
| ValidationError
| Promise
<boolean
| ValidationError
>
Parameters​
Name | Type |
---|---|
this | TestContext <TContext > |
value | T |
context | TestContext <TContext > |
Returns​
boolean
| ValidationError
| Promise
<boolean
| ValidationError
>
TestOptions​
Ƭ TestOptions<TSchema
>: Object
Type parameters​
Name | Type |
---|---|
TSchema | extends AnySchema = AnySchema |
Type declaration​
Name | Type |
---|---|
label? | string |
options | InternalOptions |
originalValue | any |
path? | string |
schema | TSchema |
sync? | boolean |
value | any |
TypeOf​
Ƭ TypeOf<TSchema
>: TSchema
["__inputType"
]
Type parameters​
Name | Type |
---|---|
TSchema | extends TypedSchema |
Variables​
MixedSchema​
• MixedSchema: typeof MixedSchema
Functions​
addMethod​
â–¸ addMethod<T
>(schemaType
, name
, fn
): void
Type parameters​
Name | Type |
---|---|
T | extends BaseSchema <any , any , any , T > |
Parameters​
Name | Type |
---|---|
schemaType | (...arg : any []) => T |
name | string |
fn | (...args : any []) => T |
Returns​
void
â–¸ addMethod<T
>(schemaType
, name
, fn
): void
Type parameters​
Name | Type |
---|---|
T | extends (...args : any ) => AnySchema <any , any , any > |
Parameters​
Name | Type |
---|---|
schemaType | T |
name | string |
fn | (...args : any []) => InstanceType <T > |
Returns​
void
array​
â–¸ array<C
, T
>(type?
): OptionalArraySchema
<T
, C
, TypeOf
<T
>[] | undefined
>
Type parameters​
Name | Type |
---|---|
C | extends AnyObject = AnyObject |
T | extends AnySchema <any , any , any > | Lazy <any , any > = AnySchema <any , any , any > |
Parameters​
Name | Type |
---|---|
type? | T |
Returns​
OptionalArraySchema
<T
, C
, TypeOf
<T
>[] | undefined
>
bool​
â–¸ bool(): BooleanSchema
<boolean
| undefined
, Record
<string
, any
>, boolean
| undefined
>
Returns​
BooleanSchema
<boolean
| undefined
, Record
<string
, any
>, boolean
| undefined
>
date​
â–¸ date(): DateSchema
<Date
| undefined
, Record
<string
, any
>, Date
| undefined
>
Returns​
DateSchema
<Date
| undefined
, Record
<string
, any
>, Date
| undefined
>
isSchema​
â–¸ Const
isSchema(obj
): obj is SchemaLike
Parameters​
Name | Type |
---|---|
obj | any |
Returns​
obj is SchemaLike
lazy​
â–¸ lazy<T
>(builder
): Lazy
<T
, ContextOf
<T
>>
Type parameters​
Name | Type |
---|---|
T | extends BaseSchema <any , any , any , T > |
Parameters​
Name | Type |
---|---|
builder | LazyBuilder <T > |
Returns​
Lazy
<T
, ContextOf
<T
>>
mixed​
â–¸ mixed<TType
>(): MixedSchema
<TType
| undefined
, Record
<string
, any
>, TType
| undefined
>
Type parameters​
Name | Type |
---|---|
TType | any |
Returns​
MixedSchema
<TType
| undefined
, Record
<string
, any
>, TType
| undefined
>
number​
â–¸ number(): default
<number
| undefined
, Record
<string
, any
>, number
| undefined
>
Returns​
default
<number
| undefined
, Record
<string
, any
>, number
| undefined
>
object​
â–¸ object<TShape
>(spec?
): OptionalObjectSchema
<TShape
, Record
<string
, any
>, TypeOfShape
<TShape
>>
Type parameters​
Name | Type |
---|---|
TShape | extends ObjectShape |
Parameters​
Name | Type |
---|---|
spec? | TShape |
Returns​
OptionalObjectSchema
<TShape
, Record
<string
, any
>, TypeOfShape
<TShape
>>
reach​
â–¸ Const
reach(obj
, path
, value?
, context?
): any
Parameters​
Name | Type |
---|---|
obj | Object |
path | string |
value? | any |
context? | any |
Returns​
any
ref​
â–¸ ref<TValue
>(key
, options?
): Reference
<TValue
>
Type parameters​
Name | Type |
---|---|
TValue | unknown |
Parameters​
Name | Type |
---|---|
key | string |
options? | ReferenceOptions <TValue > |
Returns​
Reference
<TValue
>
setLocale​
â–¸ setLocale(custom
): void
Parameters​
Name | Type |
---|---|
custom | any |
Returns​
void
string​
â–¸ string(): default
<string
| undefined
, Record
<string
, any
>, string
| undefined
>
Returns​
default
<string
| undefined
, Record
<string
, any
>, string
| undefined
>