Parcourir la source

fix(types/reactivity): export ShallowRef type (#5026)

close #5205
三咲智子 il y a 4 ans
Parent
commit
523b4b78f5
2 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 1 0
      packages/reactivity/src/index.ts
  2. 1 1
      packages/reactivity/src/ref.ts

+ 1 - 0
packages/reactivity/src/index.ts

@@ -12,6 +12,7 @@ export {
   ToRef,
   ToRefs,
   UnwrapRef,
+  ShallowRef,
   ShallowUnwrapRef,
   RefUnwrapBailTypes
 } from './ref'

+ 1 - 1
packages/reactivity/src/ref.ts

@@ -77,7 +77,7 @@ export function ref(value?: unknown) {
 
 declare const ShallowRefMarker: unique symbol
 
-type ShallowRef<T = any> = Ref<T> & { [ShallowRefMarker]?: true }
+export type ShallowRef<T = any> = Ref<T> & { [ShallowRefMarker]?: true }
 
 export function shallowRef<T extends object>(
   value: T