1 | import { Depth } from '../Object/_Internal';
|
2 | import { BuiltIn } from '../Misc/BuiltIn';
|
3 | import { Has } from '../Union/Has';
|
4 | import { If } from './If';
|
5 | import { Key } from './Key';
|
6 |
|
7 |
|
8 |
|
9 | export declare type ComputeRaw<A extends any> = A extends Function ? A : {
|
10 | [K in keyof A]: A[K];
|
11 | } & unknown;
|
12 |
|
13 |
|
14 |
|
15 | declare type ComputeFlat<A extends any> = A extends BuiltIn ? A : A extends Array<any> ? A extends Array<Record<Key, any>> ? Array<{
|
16 | [K in keyof A[number]]: A[number][K];
|
17 | } & unknown> : A : A extends ReadonlyArray<any> ? A extends ReadonlyArray<Record<Key, any>> ? ReadonlyArray<{
|
18 | [K in keyof A[number]]: A[number][K];
|
19 | } & unknown> : A : {
|
20 | [K in keyof A]: A[K];
|
21 | } & unknown;
|
22 |
|
23 |
|
24 |
|
25 | declare type ComputeDeep<A extends any, Seen = never> = A extends BuiltIn ? A : If<Has<Seen, A>, A, (A extends Array<any> ? A extends Array<Record<Key, any>> ? Array<{
|
26 | [K in keyof A[number]]: ComputeDeep<A[number][K], A | Seen>;
|
27 | } & unknown> : A : A extends ReadonlyArray<any> ? A extends ReadonlyArray<Record<Key, any>> ? ReadonlyArray<{
|
28 | [K in keyof A[number]]: ComputeDeep<A[number][K], A | Seen>;
|
29 | } & unknown> : A : {
|
30 | [K in keyof A]: ComputeDeep<A[K], A | Seen>;
|
31 | } & unknown)>;
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | export declare type Compute<A extends any, depth extends Depth = 'deep'> = {
|
45 | 'flat': ComputeFlat<A>;
|
46 | 'deep': ComputeDeep<A>;
|
47 | }[depth];
|
48 | export {};
|