@types/yup

  • Version 0.29.11
  • Published
  • 35.4 kB
  • No dependencies
  • MIT license

Install

npm i @types/yup
yarn add @types/yup
pnpm add @types/yup

Overview

TypeScript definitions for yup

Index

Variables

Functions

Classes

Interfaces

Type Aliases

Variables

variable array

const array: ArraySchemaConstructor;

    variable bool

    const bool: BooleanSchemaConstructor;

      variable boolean

      const boolean: BooleanSchemaConstructor;

        variable date

        const date: DateSchemaConstructor;

          variable mixed

          const mixed: MixedSchemaConstructor;

            variable number

            const number: NumberSchemaConstructor;

              variable object

              const object: ObjectSchemaConstructor;

                variable string

                const string: StringSchemaConstructor;

                  Functions

                  function addMethod

                  addMethod: <T extends Schema<any, object>>(
                  schemaCtor: AnySchemaConstructor,
                  name: string,
                  method: (this: T, ...args: any[]) => T
                  ) => void;

                    function isSchema

                    isSchema: (obj: any) => obj is Schema<any, object>;

                      function lazy

                      lazy: <T>(fn: (value: T) => Schema<T>) => Lazy;

                        function reach

                        reach: <T, C = object>(
                        schema: Schema<T, C>,
                        path: string,
                        value?: any,
                        context?: any
                        ) => Schema<T, C>;

                          function ref

                          ref: (path: string, options?: { contextPrefix: string }) => Ref;

                            function setLocale

                            setLocale: (customLocale: LocaleObject) => void;

                              Classes

                              class Ref

                              class Ref {}
                              • Ref is an opaque type that is internal to yup. Creating a Ref instance is accomplished via the ref() factory function.

                              class ValidationError

                              class ValidationError extends Error {}

                                constructor

                                constructor(errors: string | string[], value: any, path: string, type?: any);

                                  property errors

                                  errors: string[];
                                  • array of error messages

                                  property inner

                                  inner: ValidationError[];
                                  • In the case of aggregate errors, inner is an array of ValidationErrors throw earlier in the validation chain.

                                  property message

                                  message: string;

                                    property name

                                    name: string;

                                      property params

                                      params?: {};

                                        property path

                                        path: string;
                                        • A string, indicating where there error was thrown. path is empty at the root level.

                                        property type

                                        type: any;

                                          property value

                                          value: any;

                                            method formatError

                                            static formatError: (
                                            message: string | ((params?: any) => string),
                                            params?: any
                                            ) => string | ((params?: any) => string);

                                              method isError

                                              static isError: (err: any) => err is ValidationError;

                                                Interfaces

                                                interface ArrayLocale

                                                interface ArrayLocale {}

                                                  property max

                                                  max?: TestOptionsMessage<{ max: number }>;

                                                    property min

                                                    min?: TestOptionsMessage<{ min: number }>;

                                                      interface ArraySchema

                                                      interface ArraySchema<T, C = object> extends BasicArraySchema<T, T[], C> {}

                                                        method defined

                                                        defined: () => ArraySchema<T, C>;

                                                          method notRequired

                                                          notRequired: () => NotRequiredArraySchema<T, C>;

                                                            method nullable

                                                            nullable: {
                                                            (isNullable?: true): NullableArraySchema<T, C>;
                                                            (isNullable: boolean): ArraySchema<T, C>;
                                                            };

                                                              method of

                                                              of: <U>(type: Schema<U, C>) => ArraySchema<U, C>;

                                                                method optional

                                                                optional: () => NotRequiredArraySchema<T, C>;

                                                                  method required

                                                                  required: (message?: TestOptionsMessage) => ArraySchema<T, C>;

                                                                    interface ArraySchemaConstructor

                                                                    interface ArraySchemaConstructor {}

                                                                      construct signature

                                                                      new <C = object>(): NotRequiredArraySchema<{}, C>;

                                                                        call signature

                                                                        <T, C = object>(schema?: Schema<T, C>): NotRequiredArraySchema<T, C>;

                                                                          interface BasicArraySchema

                                                                          interface BasicArraySchema<E, T extends E[] | null | undefined, C = object>
                                                                          extends Schema<T, C> {}

                                                                            property innerType

                                                                            innerType: Schema<E, C>;

                                                                              method compact

                                                                              compact: (
                                                                              rejector?: (
                                                                              value: InferredArrayType<T>,
                                                                              index: number,
                                                                              array: Array<InferredArrayType<T>>
                                                                              ) => boolean
                                                                              ) => this;

                                                                                method ensure

                                                                                ensure: () => this;

                                                                                  method equals

                                                                                  equals: (
                                                                                  arrayOfValues: ReadonlyArray<T | Ref | null>,
                                                                                  message?: MixedLocale['oneOf']
                                                                                  ) => this;

                                                                                    method max

                                                                                    max: (limit: number | Ref, message?: ArrayLocale['max']) => this;

                                                                                      method min

                                                                                      min: (limit: number | Ref, message?: ArrayLocale['min']) => this;

                                                                                        method oneOf

                                                                                        oneOf: (
                                                                                        arrayOfValues: ReadonlyArray<T | Ref | null>,
                                                                                        message?: MixedLocale['oneOf']
                                                                                        ) => this;

                                                                                          method test

                                                                                          test: {
                                                                                          (
                                                                                          name: string,
                                                                                          message: TestOptionsMessage,
                                                                                          test: TestFunction<T | undefined | null, C>
                                                                                          ): this;
                                                                                          (options: TestOptions<Record<string, any>, C>): this;
                                                                                          };

                                                                                            interface BooleanSchema

                                                                                            interface BooleanSchema<
                                                                                            T extends boolean | null | undefined = boolean | undefined,
                                                                                            C = object
                                                                                            > extends Schema<T, C> {}

                                                                                              method defined

                                                                                              defined: () => BooleanSchema<Exclude<T, undefined>, C>;

                                                                                                method equals

                                                                                                equals: <U extends T>(
                                                                                                arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                message?: MixedLocale['oneOf']
                                                                                                ) => BooleanSchema<MaintainOptionality<T, U>, C>;

                                                                                                  method notRequired

                                                                                                  notRequired: () => BooleanSchema<T | undefined, C>;

                                                                                                    method nullable

                                                                                                    nullable: {
                                                                                                    (isNullable?: true): BooleanSchema<T | null, C>;
                                                                                                    (isNullable: false): BooleanSchema<Exclude<T, null>, C>;
                                                                                                    (isNullable?: boolean): BooleanSchema<T, C>;
                                                                                                    };

                                                                                                      method oneOf

                                                                                                      oneOf: <U extends T>(
                                                                                                      arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                      message?: MixedLocale['oneOf']
                                                                                                      ) => BooleanSchema<MaintainOptionality<T, U>, C>;

                                                                                                        method optional

                                                                                                        optional: () => BooleanSchema<T | undefined, C>;

                                                                                                          method required

                                                                                                          required: (
                                                                                                          message?: TestOptionsMessage
                                                                                                          ) => BooleanSchema<Exclude<T, undefined | null>, C>;

                                                                                                            method test

                                                                                                            test: {
                                                                                                            (
                                                                                                            name: string,
                                                                                                            message: TestOptionsMessage,
                                                                                                            test: TestFunction<T | undefined | null, C>
                                                                                                            ): this;
                                                                                                            <U extends T = T>(
                                                                                                            name: string,
                                                                                                            message: TestOptionsMessage<{}, any>,
                                                                                                            test: AssertingTestFunction<U, C>
                                                                                                            ): BooleanSchema<U, C>;
                                                                                                            <U extends T = T>(
                                                                                                            options: AssertingTestOptions<U, Record<string, any>, C>
                                                                                                            ): BooleanSchema<U, C>;
                                                                                                            (options: TestOptions<Record<string, any>, C>): this;
                                                                                                            };

                                                                                                              interface BooleanSchemaConstructor

                                                                                                              interface BooleanSchemaConstructor {}

                                                                                                                construct signature

                                                                                                                new <
                                                                                                                T extends boolean | null | undefined = boolean | undefined,
                                                                                                                C = object
                                                                                                                >(): BooleanSchema<T, C>;

                                                                                                                  call signature

                                                                                                                  <
                                                                                                                  T extends boolean | null | undefined = boolean | undefined,
                                                                                                                  C = object
                                                                                                                  >(): BooleanSchema<T, C>;

                                                                                                                    interface DateLocale

                                                                                                                    interface DateLocale {}

                                                                                                                      property max

                                                                                                                      max?: TestOptionsMessage<{ max: Date | string }>;

                                                                                                                        property min

                                                                                                                        min?: TestOptionsMessage<{ min: Date | string }>;

                                                                                                                          interface DateSchema

                                                                                                                          interface DateSchema<
                                                                                                                          T extends Date | string | null | undefined = Date | undefined,
                                                                                                                          C = object
                                                                                                                          > extends Schema<T, C> {}

                                                                                                                            method defined

                                                                                                                            defined: () => DateSchema<Exclude<T, undefined>, C>;

                                                                                                                              method equals

                                                                                                                              equals: <U extends T>(
                                                                                                                              arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                              message?: MixedLocale['oneOf']
                                                                                                                              ) => DateSchema<MaintainOptionality<T, U>, C>;

                                                                                                                                method max

                                                                                                                                max: (
                                                                                                                                limit: Date | string | Ref,
                                                                                                                                message?: DateLocale['max']
                                                                                                                                ) => DateSchema<T, C>;

                                                                                                                                  method min

                                                                                                                                  min: (
                                                                                                                                  limit: Date | string | Ref,
                                                                                                                                  message?: DateLocale['min']
                                                                                                                                  ) => DateSchema<T, C>;

                                                                                                                                    method notRequired

                                                                                                                                    notRequired: () => DateSchema<T | undefined, C>;

                                                                                                                                      method nullable

                                                                                                                                      nullable: {
                                                                                                                                      (isNullable?: true): DateSchema<T | null, C>;
                                                                                                                                      (isNullable: false): DateSchema<Exclude<T, null>, C>;
                                                                                                                                      (isNullable?: boolean): DateSchema<T, C>;
                                                                                                                                      };

                                                                                                                                        method oneOf

                                                                                                                                        oneOf: <U extends T>(
                                                                                                                                        arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                        message?: MixedLocale['oneOf']
                                                                                                                                        ) => DateSchema<MaintainOptionality<T, U>, C>;

                                                                                                                                          method optional

                                                                                                                                          optional: () => DateSchema<T | undefined, C>;

                                                                                                                                            method required

                                                                                                                                            required: (
                                                                                                                                            message?: TestOptionsMessage
                                                                                                                                            ) => DateSchema<Exclude<T, undefined | null>, C>;

                                                                                                                                              method test

                                                                                                                                              test: {
                                                                                                                                              (
                                                                                                                                              name: string,
                                                                                                                                              message: TestOptionsMessage,
                                                                                                                                              test: TestFunction<T | undefined | null, C>
                                                                                                                                              ): this;
                                                                                                                                              <U extends T = T>(
                                                                                                                                              name: string,
                                                                                                                                              message: TestOptionsMessage<{}, any>,
                                                                                                                                              test: AssertingTestFunction<U, C>
                                                                                                                                              ): DateSchema<U, C>;
                                                                                                                                              <U extends T = T>(
                                                                                                                                              options: AssertingTestOptions<U, Record<string, any>, C>
                                                                                                                                              ): DateSchema<U, C>;
                                                                                                                                              (options: TestOptions<Record<string, any>, C>): this;
                                                                                                                                              };

                                                                                                                                                interface DateSchemaConstructor

                                                                                                                                                interface DateSchemaConstructor {}

                                                                                                                                                  construct signature

                                                                                                                                                  new <
                                                                                                                                                  T extends Date | string | null | undefined = Date | undefined,
                                                                                                                                                  C = object
                                                                                                                                                  >(): DateSchema<T, C>;

                                                                                                                                                    call signature

                                                                                                                                                    <
                                                                                                                                                    T extends Date | string | null | undefined = Date | undefined,
                                                                                                                                                    C = object
                                                                                                                                                    >(): DateSchema<T, C>;

                                                                                                                                                      interface FormatErrorParams

                                                                                                                                                      interface FormatErrorParams {}

                                                                                                                                                        property originalValue

                                                                                                                                                        originalValue?: any;

                                                                                                                                                          property path

                                                                                                                                                          path: string;

                                                                                                                                                            property type

                                                                                                                                                            type: string;

                                                                                                                                                              property value

                                                                                                                                                              value?: any;

                                                                                                                                                                interface Lazy

                                                                                                                                                                interface Lazy extends Schema<any> {}

                                                                                                                                                                  interface LocaleObject

                                                                                                                                                                  interface LocaleObject {}

                                                                                                                                                                    property array

                                                                                                                                                                    array?: ArrayLocale;

                                                                                                                                                                      property boolean

                                                                                                                                                                      boolean?: {};

                                                                                                                                                                        property date

                                                                                                                                                                        date?: DateLocale;

                                                                                                                                                                          property mixed

                                                                                                                                                                          mixed?: MixedLocale;

                                                                                                                                                                            property number

                                                                                                                                                                            number?: NumberLocale;

                                                                                                                                                                              property object

                                                                                                                                                                              object?: ObjectLocale;

                                                                                                                                                                                property string

                                                                                                                                                                                string?: StringLocale;

                                                                                                                                                                                  interface MixedLocale

                                                                                                                                                                                  interface MixedLocale {}

                                                                                                                                                                                    property default

                                                                                                                                                                                    default?: TestOptionsMessage;

                                                                                                                                                                                      property defined

                                                                                                                                                                                      defined?: TestOptionsMessage;

                                                                                                                                                                                        property notOneOf

                                                                                                                                                                                        notOneOf?: TestOptionsMessage<{ values: any }>;

                                                                                                                                                                                          property notType

                                                                                                                                                                                          notType?: LocaleValue;

                                                                                                                                                                                            property oneOf

                                                                                                                                                                                            oneOf?: TestOptionsMessage<{ values: any }>;

                                                                                                                                                                                              property required

                                                                                                                                                                                              required?: TestOptionsMessage;

                                                                                                                                                                                                interface MixedSchema

                                                                                                                                                                                                interface MixedSchema<T extends any = {} | null | undefined, C = object>
                                                                                                                                                                                                extends Schema<T, C> {}

                                                                                                                                                                                                  method concat

                                                                                                                                                                                                  concat: {
                                                                                                                                                                                                  (schema: this): this;
                                                                                                                                                                                                  <U>(schema: Schema<U, C>): MixedSchema<T | U, C>;
                                                                                                                                                                                                  };

                                                                                                                                                                                                    method defined

                                                                                                                                                                                                    defined: () => MixedSchema<Exclude<T, undefined>, C>;

                                                                                                                                                                                                      method equals

                                                                                                                                                                                                      equals: <U extends T>(
                                                                                                                                                                                                      arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                                                                                      message?: MixedLocale['oneOf']
                                                                                                                                                                                                      ) => MixedSchema<MaintainOptionality<T, U>, C>;

                                                                                                                                                                                                        method notRequired

                                                                                                                                                                                                        notRequired: () => MixedSchema<T | undefined, C>;

                                                                                                                                                                                                          method nullable

                                                                                                                                                                                                          nullable: {
                                                                                                                                                                                                          (isNullable?: true): MixedSchema<T | null, C>;
                                                                                                                                                                                                          (isNullable: false): MixedSchema<Exclude<T, null>, C>;
                                                                                                                                                                                                          (isNullable?: boolean): MixedSchema<T, C>;
                                                                                                                                                                                                          };

                                                                                                                                                                                                            method oneOf

                                                                                                                                                                                                            oneOf: <U extends T>(
                                                                                                                                                                                                            arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                                                                                            message?: MixedLocale['oneOf']
                                                                                                                                                                                                            ) => MixedSchema<MaintainOptionality<T, U>, C>;

                                                                                                                                                                                                              method optional

                                                                                                                                                                                                              optional: () => MixedSchema<T | undefined, C>;

                                                                                                                                                                                                                method required

                                                                                                                                                                                                                required: (
                                                                                                                                                                                                                message?: TestOptionsMessage
                                                                                                                                                                                                                ) => MixedSchema<Exclude<T, undefined | null>, C>;

                                                                                                                                                                                                                  method test

                                                                                                                                                                                                                  test: {
                                                                                                                                                                                                                  <U extends T = T>(
                                                                                                                                                                                                                  name: string,
                                                                                                                                                                                                                  message: TestOptionsMessage,
                                                                                                                                                                                                                  test: AssertingTestFunction<U, C>
                                                                                                                                                                                                                  ): MixedSchema<U, C>;
                                                                                                                                                                                                                  (
                                                                                                                                                                                                                  name: string,
                                                                                                                                                                                                                  message: TestOptionsMessage<{}, any>,
                                                                                                                                                                                                                  test: TestFunction<unknown, C>
                                                                                                                                                                                                                  ): this;
                                                                                                                                                                                                                  <U extends T = T>(
                                                                                                                                                                                                                  options: AssertingTestOptions<U, Record<string, any>, C>
                                                                                                                                                                                                                  ): MixedSchema<U, C>;
                                                                                                                                                                                                                  (options: TestOptions<Record<string, any>, C>): this;
                                                                                                                                                                                                                  };

                                                                                                                                                                                                                    interface MixedSchemaConstructor

                                                                                                                                                                                                                    interface MixedSchemaConstructor {}

                                                                                                                                                                                                                      construct signature

                                                                                                                                                                                                                      new <T = {} | null | undefined, C = object>(options?: {
                                                                                                                                                                                                                      type?: string;
                                                                                                                                                                                                                      [key: string]: any;
                                                                                                                                                                                                                      }): MixedSchema<T, C>;

                                                                                                                                                                                                                        call signature

                                                                                                                                                                                                                        <T = {} | null | undefined, C = object>(): MixedSchema<T, C>;

                                                                                                                                                                                                                          interface NotRequiredArraySchema

                                                                                                                                                                                                                          interface NotRequiredArraySchema<T, C = object>
                                                                                                                                                                                                                          extends BasicArraySchema<T, T[] | undefined, C> {}

                                                                                                                                                                                                                            method defined

                                                                                                                                                                                                                            defined: () => ArraySchema<T, C>;

                                                                                                                                                                                                                              method notRequired

                                                                                                                                                                                                                              notRequired: () => NotRequiredArraySchema<T, C>;

                                                                                                                                                                                                                                method nullable

                                                                                                                                                                                                                                nullable: {
                                                                                                                                                                                                                                (isNullable?: true): NotRequiredNullableArraySchema<T, C>;
                                                                                                                                                                                                                                (isNullable: false): NotRequiredArraySchema<T, C>;
                                                                                                                                                                                                                                (isNullable: boolean): ArraySchema<T, C>;
                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                  method of

                                                                                                                                                                                                                                  of: <U>(type: Schema<U, C>) => NotRequiredArraySchema<U, C>;

                                                                                                                                                                                                                                    method optional

                                                                                                                                                                                                                                    optional: () => NotRequiredArraySchema<T, C>;

                                                                                                                                                                                                                                      method required

                                                                                                                                                                                                                                      required: (message?: TestOptionsMessage) => ArraySchema<T, C>;

                                                                                                                                                                                                                                        interface NotRequiredNullableArraySchema

                                                                                                                                                                                                                                        interface NotRequiredNullableArraySchema<T, C = object>
                                                                                                                                                                                                                                        extends BasicArraySchema<T, T[] | null | undefined, C> {}

                                                                                                                                                                                                                                          method defined

                                                                                                                                                                                                                                          defined: () => NullableArraySchema<T, C>;

                                                                                                                                                                                                                                            method notRequired

                                                                                                                                                                                                                                            notRequired: () => NotRequiredNullableArraySchema<T, C>;

                                                                                                                                                                                                                                              method nullable

                                                                                                                                                                                                                                              nullable: {
                                                                                                                                                                                                                                              (isNullable?: true): NotRequiredNullableArraySchema<T, C>;
                                                                                                                                                                                                                                              (isNullable: false): NotRequiredArraySchema<T, C>;
                                                                                                                                                                                                                                              (isNullable?: boolean): ArraySchema<T, C>;
                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                method of

                                                                                                                                                                                                                                                of: <U>(type: Schema<U, C>) => NotRequiredNullableArraySchema<U, C>;

                                                                                                                                                                                                                                                  method optional

                                                                                                                                                                                                                                                  optional: () => NotRequiredNullableArraySchema<T, C>;

                                                                                                                                                                                                                                                    method required

                                                                                                                                                                                                                                                    required: (message?: TestOptionsMessage) => ArraySchema<T, C>;

                                                                                                                                                                                                                                                      interface NullableArraySchema

                                                                                                                                                                                                                                                      interface NullableArraySchema<T, C = object>
                                                                                                                                                                                                                                                      extends BasicArraySchema<T, T[] | null, C> {}

                                                                                                                                                                                                                                                        method defined

                                                                                                                                                                                                                                                        defined: () => NullableArraySchema<T, C>;

                                                                                                                                                                                                                                                          method notRequired

                                                                                                                                                                                                                                                          notRequired: () => NotRequiredNullableArraySchema<T, C>;

                                                                                                                                                                                                                                                            method nullable

                                                                                                                                                                                                                                                            nullable: {
                                                                                                                                                                                                                                                            (isNullable?: true): NullableArraySchema<T, C>;
                                                                                                                                                                                                                                                            (isNullable: false): ArraySchema<T, C>;
                                                                                                                                                                                                                                                            (isNullable?: boolean): ArraySchema<T, C>;
                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                              method of

                                                                                                                                                                                                                                                              of: <U>(type: Schema<U, C>) => NullableArraySchema<U, C>;

                                                                                                                                                                                                                                                                method optional

                                                                                                                                                                                                                                                                optional: () => NotRequiredNullableArraySchema<T, C>;

                                                                                                                                                                                                                                                                  method required

                                                                                                                                                                                                                                                                  required: (message?: TestOptionsMessage) => ArraySchema<T, C>;

                                                                                                                                                                                                                                                                    interface NumberLocale

                                                                                                                                                                                                                                                                    interface NumberLocale {}

                                                                                                                                                                                                                                                                      property integer

                                                                                                                                                                                                                                                                      integer?: TestOptionsMessage;

                                                                                                                                                                                                                                                                        property lessThan

                                                                                                                                                                                                                                                                        lessThan?: TestOptionsMessage<{ less: number }>;

                                                                                                                                                                                                                                                                          property max

                                                                                                                                                                                                                                                                          max?: TestOptionsMessage<{ max: number }>;

                                                                                                                                                                                                                                                                            property min

                                                                                                                                                                                                                                                                            min?: TestOptionsMessage<{ min: number }>;

                                                                                                                                                                                                                                                                              property moreThan

                                                                                                                                                                                                                                                                              moreThan?: TestOptionsMessage<{ more: number }>;

                                                                                                                                                                                                                                                                                property negative

                                                                                                                                                                                                                                                                                negative?: TestOptionsMessage<{ less: number }>;

                                                                                                                                                                                                                                                                                  property notEqual

                                                                                                                                                                                                                                                                                  notEqual?: TestOptionsMessage<{ notEqual: number }>;

                                                                                                                                                                                                                                                                                    property positive

                                                                                                                                                                                                                                                                                    positive?: TestOptionsMessage<{ more: number }>;

                                                                                                                                                                                                                                                                                      interface NumberSchema

                                                                                                                                                                                                                                                                                      interface NumberSchema<
                                                                                                                                                                                                                                                                                      T extends number | null | undefined = number | undefined,
                                                                                                                                                                                                                                                                                      C = object
                                                                                                                                                                                                                                                                                      > extends Schema<T, C> {}

                                                                                                                                                                                                                                                                                        method defined

                                                                                                                                                                                                                                                                                        defined: () => NumberSchema<Exclude<T, undefined>, C>;

                                                                                                                                                                                                                                                                                          method equals

                                                                                                                                                                                                                                                                                          equals: <U extends T>(
                                                                                                                                                                                                                                                                                          arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                                                                                                                                                                          message?: MixedLocale['oneOf']
                                                                                                                                                                                                                                                                                          ) => NumberSchema<MaintainOptionality<T, U>, C>;

                                                                                                                                                                                                                                                                                            method integer

                                                                                                                                                                                                                                                                                            integer: (message?: NumberLocale['integer']) => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                              method lessThan

                                                                                                                                                                                                                                                                                              lessThan: (
                                                                                                                                                                                                                                                                                              limit: number | Ref,
                                                                                                                                                                                                                                                                                              message?: NumberLocale['lessThan']
                                                                                                                                                                                                                                                                                              ) => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                method max

                                                                                                                                                                                                                                                                                                max: (limit: number | Ref, message?: NumberLocale['max']) => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                  method min

                                                                                                                                                                                                                                                                                                  min: (limit: number | Ref, message?: NumberLocale['min']) => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                    method moreThan

                                                                                                                                                                                                                                                                                                    moreThan: (
                                                                                                                                                                                                                                                                                                    limit: number | Ref,
                                                                                                                                                                                                                                                                                                    message?: NumberLocale['moreThan']
                                                                                                                                                                                                                                                                                                    ) => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                      method negative

                                                                                                                                                                                                                                                                                                      negative: (message?: NumberLocale['negative']) => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                        method notRequired

                                                                                                                                                                                                                                                                                                        notRequired: () => NumberSchema<T | undefined, C>;

                                                                                                                                                                                                                                                                                                          method nullable

                                                                                                                                                                                                                                                                                                          nullable: {
                                                                                                                                                                                                                                                                                                          (isNullable?: true): NumberSchema<T | null, C>;
                                                                                                                                                                                                                                                                                                          (isNullable: false): NumberSchema<Exclude<T, null>, C>;
                                                                                                                                                                                                                                                                                                          (isNullable?: boolean): NumberSchema<T, C>;
                                                                                                                                                                                                                                                                                                          };

                                                                                                                                                                                                                                                                                                            method oneOf

                                                                                                                                                                                                                                                                                                            oneOf: <U extends T>(
                                                                                                                                                                                                                                                                                                            arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                                                                                                                                                                                            message?: MixedLocale['oneOf']
                                                                                                                                                                                                                                                                                                            ) => NumberSchema<MaintainOptionality<T, U>, C>;

                                                                                                                                                                                                                                                                                                              method optional

                                                                                                                                                                                                                                                                                                              optional: () => NumberSchema<T | undefined, C>;

                                                                                                                                                                                                                                                                                                                method positive

                                                                                                                                                                                                                                                                                                                positive: (message?: NumberLocale['positive']) => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                                  method required

                                                                                                                                                                                                                                                                                                                  required: (
                                                                                                                                                                                                                                                                                                                  message?: TestOptionsMessage
                                                                                                                                                                                                                                                                                                                  ) => NumberSchema<Exclude<T, undefined | null>, C>;

                                                                                                                                                                                                                                                                                                                    method round

                                                                                                                                                                                                                                                                                                                    round: (type: 'floor' | 'ceil' | 'trunc' | 'round') => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                                      method test

                                                                                                                                                                                                                                                                                                                      test: {
                                                                                                                                                                                                                                                                                                                      (
                                                                                                                                                                                                                                                                                                                      name: string,
                                                                                                                                                                                                                                                                                                                      message: TestOptionsMessage,
                                                                                                                                                                                                                                                                                                                      test: TestFunction<T | undefined | null, C>
                                                                                                                                                                                                                                                                                                                      ): this;
                                                                                                                                                                                                                                                                                                                      <U extends T = T>(
                                                                                                                                                                                                                                                                                                                      name: string,
                                                                                                                                                                                                                                                                                                                      message: TestOptionsMessage<{}, any>,
                                                                                                                                                                                                                                                                                                                      test: AssertingTestFunction<U, C>
                                                                                                                                                                                                                                                                                                                      ): NumberSchema<U, C>;
                                                                                                                                                                                                                                                                                                                      <U extends T = T>(
                                                                                                                                                                                                                                                                                                                      options: AssertingTestOptions<U, Record<string, any>, C>
                                                                                                                                                                                                                                                                                                                      ): NumberSchema<U, C>;
                                                                                                                                                                                                                                                                                                                      (options: TestOptions<Record<string, any>, C>): this;
                                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                                        method truncate

                                                                                                                                                                                                                                                                                                                        truncate: () => NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                                          interface NumberSchemaConstructor

                                                                                                                                                                                                                                                                                                                          interface NumberSchemaConstructor {}

                                                                                                                                                                                                                                                                                                                            construct signature

                                                                                                                                                                                                                                                                                                                            new <
                                                                                                                                                                                                                                                                                                                            T extends number | null | undefined = number | undefined,
                                                                                                                                                                                                                                                                                                                            C = object
                                                                                                                                                                                                                                                                                                                            >(): NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                                              call signature

                                                                                                                                                                                                                                                                                                                              <
                                                                                                                                                                                                                                                                                                                              T extends number | null | undefined = number | undefined,
                                                                                                                                                                                                                                                                                                                              C = object
                                                                                                                                                                                                                                                                                                                              >(): NumberSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                interface ObjectLocale

                                                                                                                                                                                                                                                                                                                                interface ObjectLocale {}

                                                                                                                                                                                                                                                                                                                                  property noUnknown

                                                                                                                                                                                                                                                                                                                                  noUnknown?: TestOptionsMessage<{ unknown: string }>;

                                                                                                                                                                                                                                                                                                                                    interface ObjectSchema

                                                                                                                                                                                                                                                                                                                                    interface ObjectSchema<
                                                                                                                                                                                                                                                                                                                                    T extends object | null | undefined = object | undefined,
                                                                                                                                                                                                                                                                                                                                    C = object
                                                                                                                                                                                                                                                                                                                                    > extends Schema<T, C> {}

                                                                                                                                                                                                                                                                                                                                      property fields

                                                                                                                                                                                                                                                                                                                                      fields: {
                                                                                                                                                                                                                                                                                                                                      [k in keyof T]: Schema<T[k], C>;
                                                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                                                        method camelCase

                                                                                                                                                                                                                                                                                                                                        camelCase: () => ObjectSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                          method concat

                                                                                                                                                                                                                                                                                                                                          concat: {
                                                                                                                                                                                                                                                                                                                                          (schema: this): this;
                                                                                                                                                                                                                                                                                                                                          <U extends object>(schema: ObjectSchema<U, C>): ObjectSchema<T & U, C>;
                                                                                                                                                                                                                                                                                                                                          };

                                                                                                                                                                                                                                                                                                                                            method constantCase

                                                                                                                                                                                                                                                                                                                                            constantCase: () => ObjectSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                              method defined

                                                                                                                                                                                                                                                                                                                                              defined: () => ObjectSchema<Exclude<T, undefined>, C>;

                                                                                                                                                                                                                                                                                                                                                method equals

                                                                                                                                                                                                                                                                                                                                                equals: <U extends T>(
                                                                                                                                                                                                                                                                                                                                                arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                                                                                                                                                                                                                                message?: MixedLocale['oneOf']
                                                                                                                                                                                                                                                                                                                                                ) => ObjectSchema<U, C>;

                                                                                                                                                                                                                                                                                                                                                  method from

                                                                                                                                                                                                                                                                                                                                                  from: (fromKey: string, toKey: string, alias?: boolean) => ObjectSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                    method notRequired

                                                                                                                                                                                                                                                                                                                                                    notRequired: () => ObjectSchema<T | undefined, C>;

                                                                                                                                                                                                                                                                                                                                                      method noUnknown

                                                                                                                                                                                                                                                                                                                                                      noUnknown: (
                                                                                                                                                                                                                                                                                                                                                      onlyKnownKeys?: boolean,
                                                                                                                                                                                                                                                                                                                                                      message?: ObjectLocale['noUnknown']
                                                                                                                                                                                                                                                                                                                                                      ) => ObjectSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                        method nullable

                                                                                                                                                                                                                                                                                                                                                        nullable: {
                                                                                                                                                                                                                                                                                                                                                        (isNullable?: true): ObjectSchema<T | null, C>;
                                                                                                                                                                                                                                                                                                                                                        (isNullable: false): ObjectSchema<Exclude<T, null>, C>;
                                                                                                                                                                                                                                                                                                                                                        (isNullable?: boolean): ObjectSchema<T, C>;
                                                                                                                                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                                                                                                                                          method oneOf

                                                                                                                                                                                                                                                                                                                                                          oneOf: <U extends T>(
                                                                                                                                                                                                                                                                                                                                                          arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                                                                                                                                                                                                                                          message?: MixedLocale['oneOf']
                                                                                                                                                                                                                                                                                                                                                          ) => ObjectSchema<U, C>;

                                                                                                                                                                                                                                                                                                                                                            method optional

                                                                                                                                                                                                                                                                                                                                                            optional: () => ObjectSchema<T | undefined, C>;

                                                                                                                                                                                                                                                                                                                                                              method required

                                                                                                                                                                                                                                                                                                                                                              required: (
                                                                                                                                                                                                                                                                                                                                                              message?: TestOptionsMessage
                                                                                                                                                                                                                                                                                                                                                              ) => ObjectSchema<Exclude<T, undefined | null>, C>;

                                                                                                                                                                                                                                                                                                                                                                method shape

                                                                                                                                                                                                                                                                                                                                                                shape: <U extends object>(
                                                                                                                                                                                                                                                                                                                                                                fields: ObjectSchemaDefinition<U, C>,
                                                                                                                                                                                                                                                                                                                                                                noSortEdges?: Array<[string, string]>
                                                                                                                                                                                                                                                                                                                                                                ) => ObjectSchema<Shape<T, U>, C>;

                                                                                                                                                                                                                                                                                                                                                                  method snakeCase

                                                                                                                                                                                                                                                                                                                                                                  snakeCase: () => ObjectSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                    method test

                                                                                                                                                                                                                                                                                                                                                                    test: {
                                                                                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                                                                                    name: string,
                                                                                                                                                                                                                                                                                                                                                                    message: TestOptionsMessage,
                                                                                                                                                                                                                                                                                                                                                                    test: TestFunction<T | undefined | null, C>
                                                                                                                                                                                                                                                                                                                                                                    ): this;
                                                                                                                                                                                                                                                                                                                                                                    <U extends T = T>(
                                                                                                                                                                                                                                                                                                                                                                    name: string,
                                                                                                                                                                                                                                                                                                                                                                    message: TestOptionsMessage<{}, any>,
                                                                                                                                                                                                                                                                                                                                                                    test: AssertingTestFunction<U, C>
                                                                                                                                                                                                                                                                                                                                                                    ): ObjectSchema<U, C>;
                                                                                                                                                                                                                                                                                                                                                                    <U extends T = T>(
                                                                                                                                                                                                                                                                                                                                                                    options: AssertingTestOptions<U, Record<string, any>, C>
                                                                                                                                                                                                                                                                                                                                                                    ): ObjectSchema<U, C>;
                                                                                                                                                                                                                                                                                                                                                                    (options: TestOptions<Record<string, any>, C>): this;
                                                                                                                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                                                                                                                      method transformKeys

                                                                                                                                                                                                                                                                                                                                                                      transformKeys: (callback: (key: any) => any) => void;

                                                                                                                                                                                                                                                                                                                                                                        method unknown

                                                                                                                                                                                                                                                                                                                                                                        unknown: (
                                                                                                                                                                                                                                                                                                                                                                        allow?: boolean,
                                                                                                                                                                                                                                                                                                                                                                        message?: ObjectLocale['noUnknown']
                                                                                                                                                                                                                                                                                                                                                                        ) => ObjectSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                          interface ObjectSchemaConstructor

                                                                                                                                                                                                                                                                                                                                                                          interface ObjectSchemaConstructor {}

                                                                                                                                                                                                                                                                                                                                                                            construct signature

                                                                                                                                                                                                                                                                                                                                                                            new <C = object>(): ObjectSchema<{}, C>;

                                                                                                                                                                                                                                                                                                                                                                              call signature

                                                                                                                                                                                                                                                                                                                                                                              <T extends object, C = object>(
                                                                                                                                                                                                                                                                                                                                                                              fields?: ObjectSchemaDefinition<T, C>
                                                                                                                                                                                                                                                                                                                                                                              ): ObjectSchema<T | undefined, C>;

                                                                                                                                                                                                                                                                                                                                                                                interface Schema

                                                                                                                                                                                                                                                                                                                                                                                interface Schema<T, C = object> {}

                                                                                                                                                                                                                                                                                                                                                                                  property type

                                                                                                                                                                                                                                                                                                                                                                                  type: string;

                                                                                                                                                                                                                                                                                                                                                                                    method cast

                                                                                                                                                                                                                                                                                                                                                                                    cast: (value?: any, options?: any) => T;

                                                                                                                                                                                                                                                                                                                                                                                      method clone

                                                                                                                                                                                                                                                                                                                                                                                      clone: () => this;

                                                                                                                                                                                                                                                                                                                                                                                        method concat

                                                                                                                                                                                                                                                                                                                                                                                        concat: (schema: this) => this;

                                                                                                                                                                                                                                                                                                                                                                                          method default

                                                                                                                                                                                                                                                                                                                                                                                          default: { (value: any): this; (): T };

                                                                                                                                                                                                                                                                                                                                                                                            method describe

                                                                                                                                                                                                                                                                                                                                                                                            describe: () => SchemaDescription;

                                                                                                                                                                                                                                                                                                                                                                                              method isType

                                                                                                                                                                                                                                                                                                                                                                                              isType: (value: any) => value is T;

                                                                                                                                                                                                                                                                                                                                                                                                method isValid

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

                                                                                                                                                                                                                                                                                                                                                                                                  method isValidSync

                                                                                                                                                                                                                                                                                                                                                                                                  isValidSync: (value: any, options?: any) => value is T;

                                                                                                                                                                                                                                                                                                                                                                                                    method label

                                                                                                                                                                                                                                                                                                                                                                                                    label: (label: string) => this;

                                                                                                                                                                                                                                                                                                                                                                                                      method meta

                                                                                                                                                                                                                                                                                                                                                                                                      meta: { (metadata: any): this; (): any };

                                                                                                                                                                                                                                                                                                                                                                                                        method notOneOf

                                                                                                                                                                                                                                                                                                                                                                                                        notOneOf: (arrayOfValues: any[], message?: MixedLocale['notOneOf']) => this;

                                                                                                                                                                                                                                                                                                                                                                                                          method strict

                                                                                                                                                                                                                                                                                                                                                                                                          strict: (isStrict: boolean) => this;

                                                                                                                                                                                                                                                                                                                                                                                                            method strip

                                                                                                                                                                                                                                                                                                                                                                                                            strip: (strip: boolean) => this;

                                                                                                                                                                                                                                                                                                                                                                                                              method transform

                                                                                                                                                                                                                                                                                                                                                                                                              transform: (fn: TransformFunction<this>) => this;

                                                                                                                                                                                                                                                                                                                                                                                                                method typeError

                                                                                                                                                                                                                                                                                                                                                                                                                typeError: (message?: TestOptionsMessage) => this;

                                                                                                                                                                                                                                                                                                                                                                                                                  method validate

                                                                                                                                                                                                                                                                                                                                                                                                                  validate: (value: any, options?: ValidateOptions<C>) => Promise<T>;

                                                                                                                                                                                                                                                                                                                                                                                                                    method validateAt

                                                                                                                                                                                                                                                                                                                                                                                                                    validateAt: (path: string, value: T, options?: ValidateOptions<C>) => Promise<T>;

                                                                                                                                                                                                                                                                                                                                                                                                                      method validateSync

                                                                                                                                                                                                                                                                                                                                                                                                                      validateSync: (value: any, options?: ValidateOptions<C>) => T;

                                                                                                                                                                                                                                                                                                                                                                                                                        method validateSyncAt

                                                                                                                                                                                                                                                                                                                                                                                                                        validateSyncAt: (path: string, value: T, options?: ValidateOptions<C>) => T;

                                                                                                                                                                                                                                                                                                                                                                                                                          method when

                                                                                                                                                                                                                                                                                                                                                                                                                          when: (keys: string | any[], builder: WhenOptions<this>) => this;

                                                                                                                                                                                                                                                                                                                                                                                                                            method withMutation

                                                                                                                                                                                                                                                                                                                                                                                                                            withMutation: (fn: (current: this) => void) => void;

                                                                                                                                                                                                                                                                                                                                                                                                                              interface SchemaDescription

                                                                                                                                                                                                                                                                                                                                                                                                                              interface SchemaDescription {}

                                                                                                                                                                                                                                                                                                                                                                                                                                property fields

                                                                                                                                                                                                                                                                                                                                                                                                                                fields: Record<string, SchemaFieldDescription>;

                                                                                                                                                                                                                                                                                                                                                                                                                                  property label

                                                                                                                                                                                                                                                                                                                                                                                                                                  label: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                    property meta

                                                                                                                                                                                                                                                                                                                                                                                                                                    meta: object;

                                                                                                                                                                                                                                                                                                                                                                                                                                      property tests

                                                                                                                                                                                                                                                                                                                                                                                                                                      tests: Array<{ name: string; params: { [k: string]: any } }>;

                                                                                                                                                                                                                                                                                                                                                                                                                                        property type

                                                                                                                                                                                                                                                                                                                                                                                                                                        type: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                          interface SchemaFieldInnerTypeDescription

                                                                                                                                                                                                                                                                                                                                                                                                                                          interface SchemaFieldInnerTypeDescription
                                                                                                                                                                                                                                                                                                                                                                                                                                          extends Pick<SchemaDescription, Exclude<keyof SchemaDescription, 'fields'>> {}

                                                                                                                                                                                                                                                                                                                                                                                                                                            property innerType

                                                                                                                                                                                                                                                                                                                                                                                                                                            innerType?: SchemaFieldDescription;

                                                                                                                                                                                                                                                                                                                                                                                                                                              interface SchemaFieldRefDescription

                                                                                                                                                                                                                                                                                                                                                                                                                                              interface SchemaFieldRefDescription {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                property key

                                                                                                                                                                                                                                                                                                                                                                                                                                                key: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                  property type

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type: 'ref';

                                                                                                                                                                                                                                                                                                                                                                                                                                                    interface StringLocale

                                                                                                                                                                                                                                                                                                                                                                                                                                                    interface StringLocale {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                      property email

                                                                                                                                                                                                                                                                                                                                                                                                                                                      email?: TestOptionsMessage<{ regex: RegExp }>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                        property length

                                                                                                                                                                                                                                                                                                                                                                                                                                                        length?: TestOptionsMessage<{ length: number }>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                          property lowercase

                                                                                                                                                                                                                                                                                                                                                                                                                                                          lowercase?: TestOptionsMessage;

                                                                                                                                                                                                                                                                                                                                                                                                                                                            property matches

                                                                                                                                                                                                                                                                                                                                                                                                                                                            matches?: TestOptionsMessage<{ regex: RegExp }>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                              property max

                                                                                                                                                                                                                                                                                                                                                                                                                                                              max?: TestOptionsMessage<{ max: number }>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                property min

                                                                                                                                                                                                                                                                                                                                                                                                                                                                min?: TestOptionsMessage<{ min: number }>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  property trim

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  trim?: TestOptionsMessage;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property uppercase

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    uppercase?: TestOptionsMessage;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      property url

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      url?: TestOptionsMessage<{ regex: RegExp }>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        property uuid

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        uuid?: TestOptionsMessage<{ regex: RegExp }>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          interface StringSchema

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          interface StringSchema<
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          T extends string | null | undefined = string | undefined,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C = object
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          > extends Schema<T, C> {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            method defined

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            defined: () => StringSchema<Exclude<T, undefined>, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              method email

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              email: (message?: StringLocale['email']) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                method ensure

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ensure: () => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  method equals

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  equals: <U extends T>(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  message?: MixedLocale['oneOf']
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ) => StringSchema<MaintainOptionality<T, U>, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    method length

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    length: (
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    limit: number | Ref,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    message?: StringLocale['length']
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      method lowercase

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      lowercase: (message?: StringLocale['lowercase']) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        method matches

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        matches: (
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        regex: RegExp,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        messageOrOptions?:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | StringLocale['matches']
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | { message?: StringLocale['matches']; excludeEmptyString?: boolean }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          method max

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          max: (limit: number | Ref, message?: StringLocale['max']) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            method min

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            min: (limit: number | Ref, message?: StringLocale['min']) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              method notRequired

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              notRequired: () => StringSchema<T | undefined, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                method nullable

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                nullable: {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (isNullable?: true): StringSchema<T | null, C>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (isNullable: false): StringSchema<Exclude<T, null>, C>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (isNullable?: boolean): StringSchema<T, C>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  method oneOf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  oneOf: <U extends T>(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  arrayOfValues: ReadonlyArray<U | Ref>,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  message?: MixedLocale['oneOf']
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ) => StringSchema<MaintainOptionality<T, U>, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    method optional

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    optional: () => StringSchema<T | undefined, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      method required

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      required: (
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      message?: TestOptionsMessage
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ) => StringSchema<Exclude<T, undefined | null>, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        method test

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        test: {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        name: string,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        message: TestOptionsMessage,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        test: TestFunction<T | undefined | null, C>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ): this;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <U extends T = T>(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        name: string,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        message: TestOptionsMessage<{}, any>,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        test: AssertingTestFunction<U, C>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ): StringSchema<U, C>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <U extends T = T>(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        options: AssertingTestOptions<U, Record<string, any>, C>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ): StringSchema<U, C>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (options: TestOptions<Record<string, any>, C>): this;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          method trim

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          trim: (message?: StringLocale['trim']) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            method uppercase

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            uppercase: (message?: StringLocale['uppercase']) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              method url

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              url: (message?: StringLocale['url']) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                method uuid

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                uuid: (message?: StringLocale['uuid']) => StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  interface StringSchemaConstructor

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  interface StringSchemaConstructor {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    construct signature

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    new <
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    T extends string | null | undefined = string | undefined,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    C = object
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    >(): StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      call signature

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      <
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      T extends string | null | undefined = string | undefined,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C = object
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      >(): StringSchema<T, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        interface TestContext

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        interface TestContext<C = object> {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          property createError

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          createError: (params?: {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          path?: string;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          message?: string;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          params?: object;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          }) => ValidationError;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            property options

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            options: ValidateOptions<C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              property originalValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              originalValue: any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                property parent

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                parent: any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  property path

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  path: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property resolve

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    resolve: (value: any) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      property schema

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      schema: Schema<any, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        interface TestMessageParams

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        interface TestMessageParams {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          property label

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          label: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            property originalValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            originalValue: any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              property path

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              path: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                property value

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                value: any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  interface ValidateOptions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  interface ValidateOptions<C = object> {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property abortEarly

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    abortEarly?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Return from validation methods on the first error rather than after all validations run. Default - true

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property context

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    context?: C;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Any context needed for validating schema conditions (see: when())

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property recursive

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    recursive?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • When false validations will not descend into nested schema (relevant for objects or arrays). Default - true

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property strict

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    strict?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Only validate the input, and skip and coercion or transformation. Default - false

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property stripUnknown

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    stripUnknown?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Remove unspecified keys from objects. Default - false

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    interface WhenOptionsBuilderFunction

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    interface WhenOptionsBuilderFunction<T> {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      call signature

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (value: any, schema: T): T;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        call signature

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (v1: any, v2: any, schema: T): T;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          call signature

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (v1: any, v2: any, v3: any, schema: T): T;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            call signature

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (v1: any, v2: any, v3: any, v4: any, schema: T): T;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Type Aliases

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type AnySchemaConstructor

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type AnySchemaConstructor =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | MixedSchemaConstructor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | StringSchemaConstructor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | NumberSchemaConstructor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | BooleanSchemaConstructor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | DateSchemaConstructor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | ArraySchemaConstructor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | ObjectSchemaConstructor;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type AssertingTestFunction

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type AssertingTestFunction<T, C> = (
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                this: TestContext<C>,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                value: any,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                context: TestContext<C>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ) => value is T;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type AssertingTestOptions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type AssertingTestOptions<U, P extends Record<string, any> = {}, C = object> =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | NonExclusiveAssertingTestOptions<U, P, C>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | ExclusiveAssertingTestOptions<U, P, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type InferType

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type InferType<T> = T extends Schema<infer P> ? InnerInferType<P> : never;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type LocaleValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type LocaleValue = string | ((params: FormatErrorParams) => string);

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type ObjectSchemaDefinition

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type ObjectSchemaDefinition<T extends object | null | undefined, C = object> = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        // This shouldn't be necessary because MixedSchema extends Schema, but type
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        // inference only works with it this way - otherwise when you use a mixed
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        // field in object schema, it will type as `unknown`. Not sure why that is -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        // maybe some sort of inference depth limit?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [field in keyof T]: Schema<T[field], C> | MixedSchema<T[field], C> | Ref;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type SchemaFieldDescription

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type SchemaFieldDescription =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | SchemaDescription
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | SchemaFieldRefDescription
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | SchemaFieldInnerTypeDescription;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type Shape

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type Shape<T extends object | null | undefined, U extends object> =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | ({ [P in keyof T]: P extends keyof U ? U[P] : T[P] } & U)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | PreserveOptionals<T>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Merges two interfaces. For properties in common, property types from U trump those of T. This is conducive to the functionality of [yup's object.shape() method](https://www.npmjs.com/package/yup#objectshapefields-object-nosortedges-arraystring-string-schema).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type TestFunction

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type TestFunction<T = unknown, C = object> = (
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            this: TestContext<C>,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            value: T,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            context: TestContext<C>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ) => boolean | ValidationError | Promise<boolean | ValidationError>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type TestOptions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type TestOptions<P extends Record<string, any> = {}, C = object> =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | NonExclusiveTestOptions<P, C>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | ExclusiveTestOptions<P, C>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type TestOptionsMessage

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type TestOptionsMessage<Extra extends Record<string, any> = {}, R = any> =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | string
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | ((params: Extra & Partial<TestMessageParams>) => R);

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type TransformFunction

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type TransformFunction<T> = (this: T, value: any, originalValue: any) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type WhenOptions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type WhenOptions<T> = WhenOptionsBuilderFunction<T> | WhenOptionsBuilderObject;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type WhenOptionsBuilderObject

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type WhenOptionsBuilderObject =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      is: WhenOptionsBuilderObjectIs;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      then: any;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      otherwise: any;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | object;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type WhenOptionsBuilderObjectIs

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type WhenOptionsBuilderObjectIs =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | ((...values: any[]) => boolean)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | number
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | null
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | object
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Package Files (1)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          No dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Dev Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          No dev dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          No peer dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Badge

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/yup.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • Markdown
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/yup)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <a href="https://www.jsdocs.io/package/@types/yup"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>