1 | import { _Pick } from './Pick';
|
2 | import { Depth } from './_Internal';
|
3 | import { Key } from '../Any/Key';
|
4 | import { PatchFlat } from './Patch';
|
5 | import { BuiltIn } from '../Misc/BuiltIn';
|
6 |
|
7 |
|
8 |
|
9 | export declare type ReadonlyFlat<O> = {
|
10 | +readonly [K in keyof O]: O[K];
|
11 | } & {};
|
12 |
|
13 |
|
14 |
|
15 | export declare type ReadonlyDeep<O> = {
|
16 | +readonly [K in keyof O]: O[K] extends BuiltIn ? O[K] : ReadonlyDeep<O[K]>;
|
17 | };
|
18 |
|
19 |
|
20 |
|
21 | export declare type ReadonlyPart<O extends object, depth extends Depth> = {
|
22 | 'flat': ReadonlyFlat<O>;
|
23 | 'deep': ReadonlyDeep<O>;
|
24 | }[depth];
|
25 |
|
26 |
|
27 |
|
28 | export declare type _Readonly<O extends object, K extends Key, depth extends Depth> = PatchFlat<ReadonlyPart<_Pick<O, K>, depth>, O>;
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | export declare type Readonly<O extends object, K extends Key = Key, depth extends Depth = 'flat'> = O extends unknown ? _Readonly<O, K, depth> : never;
|