Skip to main content

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​

NameType
Typeany
TContextany
TOutany

Asserts​

Ƭ Asserts<TSchema>: TSchema["__outputType"]

Type parameters​

NameType
TSchemaextends TypedSchema

CreateErrorOptions​

Ƭ CreateErrorOptions: Object

Type declaration​

NameType
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​

NameType
TValueunknown
TContext{}

Type declaration​

NameType
exclusive?boolean
message?Message<any>
name?string
params?ExtraParams
testTestFunction<TValue, TContext>

TestContext​

Ƭ TestContext<TContext>: Object

Type parameters​

NameType
TContext{}

Type declaration​

NameType
optionsValidateOptions<TContext>
parentany
pathstring
schemaany
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​

NameType
Tunknown
TContext{}

Type declaration​

â–¸ (this, value, context): boolean | ValidationError | Promise<boolean | ValidationError>

Parameters​
NameType
thisTestContext<TContext>
valueT
contextTestContext<TContext>
Returns​

boolean | ValidationError | Promise<boolean | ValidationError>


TestOptions​

Ƭ TestOptions<TSchema>: Object

Type parameters​

NameType
TSchemaextends AnySchema = AnySchema

Type declaration​

NameType
label?string
optionsInternalOptions
originalValueany
path?string
schemaTSchema
sync?boolean
valueany

TypeOf​

Ƭ TypeOf<TSchema>: TSchema["__inputType"]

Type parameters​

NameType
TSchemaextends TypedSchema

Variables​

MixedSchema​

• MixedSchema: typeof MixedSchema

Functions​

addMethod​

â–¸ addMethod<T>(schemaType, name, fn): void

Type parameters​

NameType
Textends BaseSchema<any, any, any, T>

Parameters​

NameType
schemaType(...arg: any[]) => T
namestring
fn(...args: any[]) => T

Returns​

void

â–¸ addMethod<T>(schemaType, name, fn): void

Type parameters​

NameType
Textends (...args: any) => AnySchema<any, any, any>

Parameters​

NameType
schemaTypeT
namestring
fn(...args: any[]) => InstanceType<T>

Returns​

void


array​

â–¸ array<C, T>(type?): OptionalArraySchema<T, C, TypeOf<T>[] | undefined>

Type parameters​

NameType
Cextends AnyObject = AnyObject
Textends AnySchema<any, any, any> | Lazy<any, any> = AnySchema<any, any, any>

Parameters​

NameType
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​

NameType
objany

Returns​

obj is SchemaLike


lazy​

â–¸ lazy<T>(builder): Lazy<T, ContextOf<T>>

Type parameters​

NameType
Textends BaseSchema<any, any, any, T>

Parameters​

NameType
builderLazyBuilder<T>

Returns​

Lazy<T, ContextOf<T>>


mixed​

â–¸ mixed<TType>(): MixedSchema<TType | undefined, Record<string, any>, TType | undefined>

Type parameters​

NameType
TTypeany

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​

NameType
TShapeextends ObjectShape

Parameters​

NameType
spec?TShape

Returns​

OptionalObjectSchema<TShape, Record<string, any>, TypeOfShape<TShape>>


reach​

â–¸ Const reach(obj, path, value?, context?): any

Parameters​

NameType
objObject
pathstring
value?any
context?any

Returns​

any


ref​

â–¸ ref<TValue>(key, options?): Reference<TValue>

Type parameters​

NameType
TValueunknown

Parameters​

NameType
keystring
options?ReferenceOptions<TValue>

Returns​

Reference<TValue>


setLocale​

â–¸ setLocale(custom): void

Parameters​

NameType
customany

Returns​

void


string​

â–¸ string(): default<string | undefined, Record<string, any>, string | undefined>

Returns​

default<string | undefined, Record<string, any>, string | undefined>