WXL
3 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
type TypeGuard<A, B extends A> = (payload: A) => payload is B;
/**
 * A factory function that creates a function to check if the payload is one of the given types.
 *
 * @example
 *   import { isOneOf, isNull, isUndefined } from 'is-what'
 *
 *   const isNullOrUndefined = isOneOf(isNull, isUndefined)
 *
 *   isNullOrUndefined(null) // true
 *   isNullOrUndefined(undefined) // true
 *   isNullOrUndefined(123) // false
 */
export declare function isOneOf<A, B extends A, C extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>): TypeGuard<A, B | C>;
/**
 * A factory function that creates a function to check if the payload is one of the given types.
 *
 * @example
 *   import { isOneOf, isNull, isUndefined } from 'is-what'
 *
 *   const isNullOrUndefined = isOneOf(isNull, isUndefined)
 *
 *   isNullOrUndefined(null) // true
 *   isNullOrUndefined(undefined) // true
 *   isNullOrUndefined(123) // false
 */
export declare function isOneOf<A, B extends A, C extends A, D extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>): TypeGuard<A, B | C | D>;
/**
 * A factory function that creates a function to check if the payload is one of the given types.
 *
 * @example
 *   import { isOneOf, isNull, isUndefined } from 'is-what'
 *
 *   const isNullOrUndefined = isOneOf(isNull, isUndefined)
 *
 *   isNullOrUndefined(null) // true
 *   isNullOrUndefined(undefined) // true
 *   isNullOrUndefined(123) // false
 */
export declare function isOneOf<A, B extends A, C extends A, D extends A, E extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>, d: TypeGuard<A, E>): TypeGuard<A, B | C | D | E>;
/**
 * A factory function that creates a function to check if the payload is one of the given types.
 *
 * @example
 *   import { isOneOf, isNull, isUndefined } from 'is-what'
 *
 *   const isNullOrUndefined = isOneOf(isNull, isUndefined)
 *
 *   isNullOrUndefined(null) // true
 *   isNullOrUndefined(undefined) // true
 *   isNullOrUndefined(123) // false
 */
export declare function isOneOf<A, B extends A, C extends A, D extends A, E extends A, F extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>, d: TypeGuard<A, E>, e: TypeGuard<A, F>): TypeGuard<A, B | C | D | E | F>;
export {};