All files / validator/yupTypes addMethod.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                                           
import { array, ArraySchema } from './array'
import { boolean, BooleanSchema } from './boolean'
import { date, DateSchema } from './date'
import { mixed, MixedSchema } from './mixed'
import { number, NumberSchema } from './number'
import { object, ObjectSchema } from './object'
import { string, StringSchema } from './string'
 
export declare function addMethod<
  TSchemaType extends
    | typeof mixed
    | typeof string
    | typeof number
    | typeof boolean
    | typeof date
    | typeof array
    | typeof object,
  TSchema extends TSchemaType extends typeof mixed
    ? MixedSchema
    : TSchemaType extends typeof string
    ? StringSchema
    : TSchemaType extends typeof number
    ? NumberSchema
    : TSchemaType extends typeof boolean
    ? BooleanSchema
    : TSchemaType extends typeof date
    ? DateSchema
    : TSchemaType extends typeof array
    ? ArraySchema
    : TSchemaType extends typeof object
    ? ObjectSchema
    : MixedSchema,
>(
  schemaType: TSchemaType,
  name: string,
  fn: (this: TSchema, ...args: any[]) => TSchema,
): void