1 | import { _Omit } from './Omit';
|
2 | import { _Pick } from './Pick';
|
3 | import { Key } from '../Any/Key';
|
4 | import { Strict } from '../Union/Strict';
|
5 | import { Boolean } from '../Boolean/_Internal';
|
6 | import { ComputeRaw } from '../Any/Compute';
|
7 |
|
8 |
|
9 |
|
10 | declare type __Either<O extends object, K extends Key> = _Omit<O, K> & ({
|
11 | [P in K]: _Pick<O, P>;
|
12 | }[K]);
|
13 |
|
14 |
|
15 |
|
16 | declare type EitherStrict<O extends object, K extends Key> = Strict<__Either<O, K>>;
|
17 |
|
18 |
|
19 |
|
20 | declare type EitherLoose<O extends object, K extends Key> = ComputeRaw<__Either<O, K>>;
|
21 |
|
22 |
|
23 |
|
24 | export declare type _Either<O extends object, K extends Key, strict extends Boolean> = {
|
25 | 1: EitherStrict<O, K>;
|
26 | 0: EitherLoose<O, K>;
|
27 | }[strict];
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | export declare type Either<O extends object, K extends Key, strict extends Boolean = 1> = O extends unknown ? _Either<O, K, strict> : never;
|
40 | export {};
|