UNPKG

567 BTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8export type DeepReadonly<T> = T extends (infer R)[] ? DeepReadonlyArray<R> : T extends Function ? T : T extends object ? DeepReadonlyObject<T> : T;
9export type DeepReadonlyArray<T> = Array<DeepReadonly<T>>;
10export type DeepReadonlyObject<T> = {
11 readonly [P in keyof T]: DeepReadonly<T[P]>;
12};
13export type Readwrite<T> = {
14 -readonly [P in keyof T]: T[P];
15};