]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(types): expose DeepReadonly type (#1606)
authorPick <pickchen@tencent.com>
Fri, 17 Jul 2020 13:28:50 +0000 (21:28 +0800)
committerGitHub <noreply@github.com>
Fri, 17 Jul 2020 13:28:50 +0000 (09:28 -0400)
packages/reactivity/src/index.ts
packages/reactivity/src/reactive.ts

index bbab3118a837a0077634e7abd2abd8d37c8aaacd..aaf53242592b899907586eff794209fa56dd0551 100644 (file)
@@ -22,7 +22,8 @@ export {
   shallowReadonly,
   markRaw,
   toRaw,
-  ReactiveFlags
+  ReactiveFlags,
+  DeepReadonly
 } from './reactive'
 export {
   computed,
index 1f01c393d0f4bc24570c3bf80bd956f2f35cb88b..383701521e5ed15bae2f3772e89fae9caf917b85 100644 (file)
@@ -74,7 +74,7 @@ export function shallowReactive<T extends object>(target: T): T {
 
 type Primitive = string | number | boolean | bigint | symbol | undefined | null
 type Builtin = Primitive | Function | Date | Error | RegExp
-type DeepReadonly<T> = T extends Builtin
+export type DeepReadonly<T> = T extends Builtin
   ? T
   : T extends Map<infer K, infer V>
     ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>