1 | import { Key } from './_Internal';
|
2 | import { NonNullable as UNonNullable } from '../Union/NonNullable';
|
3 | import { Depth } from '../Object/_Internal';
|
4 | import { BuiltIn } from '../Misc/BuiltIn';
|
5 | import { Cast } from '../Any/Cast';
|
6 | import { List } from './List';
|
7 |
|
8 |
|
9 |
|
10 | export declare type NonNullableFlat<O, K extends Key = Key> = {
|
11 | [P in keyof O]: P extends K ? UNonNullable<O[P]> : O[P];
|
12 | } & {};
|
13 |
|
14 |
|
15 |
|
16 | declare type _NonNullableDeep<O> = {
|
17 | [K in keyof O]: O[K] extends BuiltIn ? O[K] : NonNullableDeep<O[K], Key>;
|
18 | };
|
19 |
|
20 |
|
21 |
|
22 | export declare type NonNullableDeep<O, K extends Key = Key> = _NonNullableDeep<NonNullableFlat<O, K>>;
|
23 |
|
24 |
|
25 |
|
26 | export declare type NonNullablePart<O extends object, K extends Key, depth extends Depth> = {
|
27 | 'flat': NonNullableFlat<O, K>;
|
28 | 'deep': NonNullableDeep<O, K>;
|
29 | }[depth];
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | export declare type NonNullable<L extends List, K extends Key = Key, depth extends Depth = 'flat'> = Cast<NonNullablePart<L, `${K & number}` | K, depth>, List>;
|
41 | export {};
|