Interface: IUnionSchema<TType, TContext, TDefault, TFlags>

Extends

  • Schema<TType, TContext, TDefault, TFlags>

Type Parameters

TType = any

TContext = AnyObject

TDefault = undefined

TFlags extends Flags = ""

Properties

__context

readonly __context: TContext

Inherited from

Schema.__context

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:162


__default

readonly __default: TDefault

Inherited from

Schema.__default

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:165


__flags

readonly __flags: TFlags

Inherited from

Schema.__flags

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:163


__isYupSchema__

readonly __isYupSchema__: boolean

Inherited from

Schema.__isYupSchema__

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:164


__outputType

readonly __outputType: ResolveFlags<TType, TFlags, TDefault>

Inherited from

Schema.__outputType

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:161


_blacklist

protected _blacklist: ReferenceSet

Inherited from

Schema._blacklist

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:173


_typeCheck()

protected _typeCheck: (value) => value is NonNullable<TType>

Parameters

value: any

Returns

value is NonNullable<TType>

Inherited from

Schema._typeCheck

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:175


_whitelist

protected _whitelist: ReferenceSet

Inherited from

Schema._whitelist

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:172


deps

readonly deps: readonly string[]

Inherited from

Schema.deps

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:166


equals()

equals: <U>(enums, message?) => this(enums, message) => any

Type Parameters

U extends any

Parameters

enums: readonly (Reference<unknown> | U)[]

message?: Message<object>

Returns

this

Parameters

enums: readonly any[]

message: Message<object>

Returns

any

Inherited from

Schema.equals

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:261


exclusiveTests

protected exclusiveTests: Record<string, boolean>

Inherited from

Schema.exclusiveTests

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:174


is()

is: <U>(enums, message?) => this(enums, message) => any

Type Parameters

U extends any

Parameters

enums: readonly (Reference<unknown> | U)[]

message?: Message<object>

Returns

this

Parameters

enums: readonly any[]

message: Message<object>

Returns

any

Inherited from

Schema.is

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:262


nope()

nope: <U>(enums, message?) => this

Type Parameters

U extends any

Parameters

enums: readonly (Reference<unknown> | Maybe<U>)[]

message?: Message<object>

Returns

this

Inherited from

Schema.nope

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:264


not()

not: <U>(enums, message?) => this

Type Parameters

U extends any

Parameters

enums: readonly (Reference<unknown> | Maybe<U>)[]

message?: Message<object>

Returns

this

Inherited from

Schema.not

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:263


spec

spec: UnionSchemaSpec

Overrides

Schema.spec

Defined in

packages/yup/src/union.ts:128


tests

tests: Test[]

Inherited from

Schema.tests

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:167


transforms

transforms: TransformFunction<AnySchema<any, any, any, Flags>>[]

Inherited from

Schema.transforms

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:168


type

readonly type: string

Inherited from

Schema.type

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:160

Accessors

_type

get _type(): string

Returns

string

Inherited from

Schema._type

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:178

Methods

_cast()

protected _cast(rawValue, options): any

Parameters

rawValue: any

options: CastOptions$1<TContext>

Returns

any

Inherited from

Schema._cast

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:194


_getDefault()

protected _getDefault(options?): any

Parameters

options?: ResolveOptions<TContext>

Returns

any

Inherited from

Schema._getDefault

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:206


_validate()

protected _validate(_value, options, panic, next): void

Parameters

_value: any

options: undefined | InternalOptions<TContext>

panic

next

Returns

void

Inherited from

Schema._validate

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:195


asNestedTest()

asNestedTest(__namedParameters): RunTest

Parameters

__namedParameters: NestedTestConfig

Returns

RunTest

Inherited from

Schema.asNestedTest

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:201


cast()

cast(value, options)

cast(value, options?): ResolveFlags<TType, TFlags, TDefault>

Run the configured transform pipeline over an input value.

Parameters

value: any

options?: CastOptions$1<TContext>

Returns

ResolveFlags<TType, TFlags, TDefault>

Inherited from

Schema.cast

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:192

cast(value, options)

cast(value, options): undefined | null | ResolveFlags<TType, TFlags, TDefault>

Parameters

value: any

options: CastOptionalityOptions<TContext>

Returns

undefined | null | ResolveFlags<TType, TFlags, TDefault>

Inherited from

Schema.cast

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:193


clone()

clone(spec?): this

Parameters

spec?: Partial<SchemaSpec<any>>

Returns

this

Inherited from

Schema.clone

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:179


concat()

concat(schema)

concat(schema): this

Parameters

schema: this

Returns

this

Inherited from

Schema.concat

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:184

concat(schema)

concat(schema): AnySchema<any, any, any, Flags>

Parameters

schema: AnySchema<any, any, any, Flags>

Returns

AnySchema<any, any, any, Flags>

Inherited from

Schema.concat

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:185


default()

default<D>(def): IUnionSchema<TType, TContext, D, ToggleDefault<TFlags, D>>

Type Parameters

D

Parameters

def: DefaultThunk<D, TContext>

Returns

IUnionSchema<TType, TContext, D, ToggleDefault<TFlags, D>>

Overrides

Schema.default

Defined in

packages/yup/src/union.ts:133


defined()

defined(msg?): IUnionSchema<Defined<TType>, TContext, TDefault, TFlags>

Parameters

msg?: Message

Returns

IUnionSchema<Defined<TType>, TContext, TDefault, TFlags>

Overrides

Schema.defined

Defined in

packages/yup/src/union.ts:137


describe()

describe(options?): SchemaDescription

Return a serialized description of the schema including validations, flags, types etc.

Parameters

options?: ResolveOptions<TContext>

Provide any needed context for resolving runtime schema alterations (lazy, when conditions, etc).

Returns

SchemaDescription

Inherited from

Schema.describe

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:256


findTargetSchema()

findTargetSchema(value): Promise<undefined | Schema<any, any, any, "">>

Parameters

value: any

Returns

Promise<undefined | Schema<any, any, any, "">>

Defined in

packages/yup/src/union.ts:130


findTargetSchemaSync()

findTargetSchemaSync(value): undefined | Schema<any, any, any, "">

Parameters

value: any

Returns

undefined | Schema<any, any, any, "">

Defined in

packages/yup/src/union.ts:131


getDefault()

getDefault(options?): TDefault

Parameters

options?: ResolveOptions<TContext>

Returns

TDefault

Inherited from

Schema.getDefault

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:207


isType()

isType(v): v is TType

Parameters

v: unknown

Returns

v is TType

Inherited from

Schema.isType

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:186


isValid()

isValid(value, options?): Promise<boolean>

Parameters

value: any

options?: ValidateOptions<TContext>

Returns

Promise<boolean>

Inherited from

Schema.isValid

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:204


isValidSync()

isValidSync(value, options?): value is ResolveFlags<TType, TFlags, TDefault>

Parameters

value: any

options?: ValidateOptions<TContext>

Returns

value is ResolveFlags<TType, TFlags, TDefault>

Inherited from

Schema.isValidSync

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:205


label()

label(label): this

Parameters

label: string

Returns

this

Inherited from

Schema.label

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:180


meta()

meta(undefined)

meta(): undefined | CustomSchemaMetadata

Returns

undefined | CustomSchemaMetadata

Inherited from

Schema.meta

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:181

meta(obj)

meta(obj): this

Parameters

obj: CustomSchemaMetadata

Returns

this

Inherited from

Schema.meta

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:182


nonNullable()

nonNullable(msg?): IUnionSchema<NotNull<TType>, TContext, TDefault, TFlags>

Parameters

msg?: Message

Returns

IUnionSchema<NotNull<TType>, TContext, TDefault, TFlags>

Overrides

Schema.nonNullable

Defined in

packages/yup/src/union.ts:150


notOneOf()

notOneOf<U>(enums, message?): this

Type Parameters

U

Parameters

enums: readonly (Reference<unknown> | Maybe<U>)[]

message?: Message<object>

Returns

this

Inherited from

Schema.notOneOf

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:247


notRequired()

notRequired(): IUnionSchema<Maybe<TType>, TContext, TDefault, TFlags>

Returns

IUnionSchema<Maybe<TType>, TContext, TDefault, TFlags>

Overrides

Schema.notRequired

Defined in

packages/yup/src/union.ts:145


nullability()

protected nullability(nullable, message?): this

Parameters

nullable: boolean

message?: Message<any>

Returns

this

Inherited from

Schema.nullability

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:210


nullable()

nullable(msg?): IUnionSchema<null | TType, TContext, TDefault, TFlags>

Parameters

msg?: Message

Returns

IUnionSchema<null | TType, TContext, TDefault, TFlags>

Overrides

Schema.nullable

Defined in

packages/yup/src/union.ts:147


oneOf()

oneOf(enums, message)

oneOf<U>(enums, message?): this

Type Parameters

U

Parameters

enums: readonly (Reference<unknown> | U)[]

message?: Message<object>

Returns

this

Inherited from

Schema.oneOf

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:241

oneOf(enums, message)

oneOf(enums, message): any

Parameters

enums: readonly (TType | Reference<unknown>)[]

message: Message<object>

Returns

any

Inherited from

Schema.oneOf

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:244


optional()

optional(): IUnionSchema<undefined | TType, TContext, TDefault, TFlags>

Returns

IUnionSchema<undefined | TType, TContext, TDefault, TFlags>

Overrides

Schema.optional

Defined in

packages/yup/src/union.ts:140


optionality()

protected optionality(optional, message?): this

Parameters

optional: boolean

message?: Message<any>

Returns

this

Inherited from

Schema.optionality

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:211


required()

required(msg?): IUnionSchema<NonNullable<TType>, TContext, TDefault, TFlags>

Parameters

msg?: Message

Returns

IUnionSchema<NonNullable<TType>, TContext, TDefault, TFlags>

Overrides

Schema.required

Defined in

packages/yup/src/union.ts:142


resolve()

resolve(options): this

Parameters

options: ResolveOptions<TContext>

Returns

this

Inherited from

Schema.resolve

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:187


resolveOptions()

protected resolveOptions<T>(options): T

Type Parameters

T extends InternalOptions<any>

Parameters

options: T

Returns

T

Inherited from

Schema.resolveOptions

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:188


runTests()

protected runTests(runOptions, panic, next): void

Executes a set of validations, either schema, produced Tests or a nested schema validate result.

Parameters

runOptions: TestRunOptions

panic

next

Returns

void

Inherited from

Schema.runTests

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:200


strict()

strict(isStrict?): this

Parameters

isStrict?: boolean

Returns

this

Inherited from

Schema.strict

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:209


strip()

strip(enabled)

strip(enabled): IUnionSchema<TType, TContext, TDefault, UnsetFlag<TFlags, "s">>

Parameters

enabled: false

Returns

IUnionSchema<TType, TContext, TDefault, UnsetFlag<TFlags, "s">>

Overrides

Schema.strip

Defined in

packages/yup/src/union.ts:154

strip(enabled)

strip(enabled?): IUnionSchema<TType, TContext, TDefault, SetFlag<TFlags, "s">>

Parameters

enabled?: true

Returns

IUnionSchema<TType, TContext, TDefault, SetFlag<TFlags, "s">>

Overrides

Schema.strip

Defined in

packages/yup/src/union.ts:157


test()

test(options)

test(options): this

Adds a test function to the schema's queue of tests. tests can be exclusive or non-exclusive.

  • exclusive tests, will replace any existing tests of the same name.
  • non-exclusive: can be stacked

If a non-exclusive test is added to a schema with an exclusive test of the same name the exclusive test is removed and further tests of the same name will be stacked.

If an exclusive test is added to a schema with non-exclusive tests of the same name the previous tests are removed and further tests of the same name will replace each other.

Parameters

options: TestConfig<ResolveFlags<TType, TFlags, TDefault>, TContext>

Returns

this

Inherited from

Schema.test

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:232

test(test)

test(test): this

Parameters

test: TestFunction<ResolveFlags<TType, TFlags, TDefault>, TContext>

Returns

this

Inherited from

Schema.test

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:233

test(name, test)

test(name, test): this

Parameters

name: string

test: TestFunction<ResolveFlags<TType, TFlags, TDefault>, TContext>

Returns

this

Inherited from

Schema.test

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:234

test(name, message, test)

test(name, message, test): this

Parameters

name: string

message: Message<any>

test: TestFunction<ResolveFlags<TType, TFlags, TDefault>, TContext>

Returns

this

Inherited from

Schema.test

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:235


transform()

transform(fn): this

Parameters

fn: TransformFunction<IUnionSchema<TType, TContext, TDefault, TFlags>>

Returns

this

Inherited from

Schema.transform

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:218


typeError()

typeError(message): this

Parameters

message: Message<any>

Returns

this

Inherited from

Schema.typeError

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:240


validate()

validate(value, options?): Promise<ResolveFlags<TType, TFlags, TDefault>>

Parameters

value: any

options?: ValidateOptions<TContext>

Returns

Promise<ResolveFlags<TType, TFlags, TDefault>>

Inherited from

Schema.validate

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:202


validateAt()

validateAt(path, value, options?): Promise<any>

Parameters

path: string

value: any

options?: ValidateOptions<TContext>

Returns

Promise<any>

Inherited from

Schema.validateAt

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:259


validateSync()

validateSync(value, options?): ResolveFlags<TType, TFlags, TDefault>

Parameters

value: any

options?: ValidateOptions<TContext>

Returns

ResolveFlags<TType, TFlags, TDefault>

Inherited from

Schema.validateSync

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:203


validateSyncAt()

validateSyncAt(path, value, options?): any

Parameters

path: string

value: any

options?: ValidateOptions<TContext>

Returns

any

Inherited from

Schema.validateSyncAt

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:260


when()

when(builder)

when(builder): this

Parameters

builder: ConditionBuilder<IUnionSchema<TType, TContext, TDefault, TFlags>>

Returns

this

Inherited from

Schema.when

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:236

when(keys, builder)

when(keys, builder): this

Parameters

keys: string | string[]

builder: ConditionBuilder<IUnionSchema<TType, TContext, TDefault, TFlags>>

Returns

this

Inherited from

Schema.when

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:237

when(options)

when(options): this

Parameters

options: ConditionConfig<IUnionSchema<TType, TContext, TDefault, TFlags>>

Returns

this

Inherited from

Schema.when

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:238

when(keys, options)

when(keys, options): this

Parameters

keys: string | string[]

options: ConditionConfig<IUnionSchema<TType, TContext, TDefault, TFlags>>

Returns

this

Inherited from

Schema.when

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:239


withMutation()

withMutation<T>(fn): T

Type Parameters

T

Parameters

fn

Returns

T

Inherited from

Schema.withMutation

Defined in

node_modules/.pnpm/yup@1.4.0/node_modules/yup/index.d.ts:183

ON THIS PAGE