Browse Source

Merge branch 'master' into engine-splitting

David Catuhe 6 năm trước cách đây
mục cha
commit
be8d8658c2
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      src/types.ts

+ 5 - 2
src/types.ts

@@ -52,9 +52,12 @@ export type DeepImmutable<T> = T extends Primitive
   : /* T extends Map<infer K, infer V> ? DeepImmutableMap<K, V> : // es2015+ only */
   DeepImmutableObject<T>;
 
+/**
+ * Type modifier to make object properties readonly.
+ */
+export type DeepImmutableObject<T> = { readonly [K in keyof T]: DeepImmutable<T[K]> };
+
 /** @hidden */
 interface DeepImmutableArray<T> extends ReadonlyArray<DeepImmutable<T>> { }
 /** @hidden */
 /* interface DeepImmutableMap<K, V> extends ReadonlyMap<DeepImmutable<K>, DeepImmutable<V>> {} // es2015+ only */
-/** @hidden */
-type DeepImmutableObject<T> = { readonly [K in keyof T]: DeepImmutable<T[K]> };