parent
44166b43d9
commit
2b588cf1bc
@ -25,7 +25,8 @@ export {
|
||||
markRaw,
|
||||
toRaw,
|
||||
ReactiveFlags,
|
||||
DeepReadonly
|
||||
DeepReadonly,
|
||||
UnwrapNestedRefs
|
||||
} from './reactive'
|
||||
export {
|
||||
computed,
|
||||
|
@ -57,7 +57,7 @@ function getTargetType(value: Target) {
|
||||
}
|
||||
|
||||
// only unwrap nested ref
|
||||
type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRef<T>
|
||||
export type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRef<T>
|
||||
|
||||
/**
|
||||
* Creates a reactive copy of the original object.
|
||||
|
@ -20,7 +20,8 @@ import {
|
||||
ReactiveFlags,
|
||||
track,
|
||||
TrackOpTypes,
|
||||
ShallowUnwrapRef
|
||||
ShallowUnwrapRef,
|
||||
UnwrapNestedRefs
|
||||
} from '@vue/reactivity'
|
||||
import {
|
||||
ExtractComputedReturns,
|
||||
@ -195,7 +196,7 @@ export type ComponentPublicInstance<
|
||||
): WatchStopHandle
|
||||
} & P &
|
||||
ShallowUnwrapRef<B> &
|
||||
D &
|
||||
UnwrapNestedRefs<D> &
|
||||
ExtractComputedReturns<C> &
|
||||
M &
|
||||
ComponentCustomProperties
|
||||
|
@ -379,7 +379,8 @@ describe('type inference w/ options API', () => {
|
||||
// here in data() - somehow that would mess up the inference
|
||||
expectType<number | undefined>(this.a)
|
||||
return {
|
||||
c: this.a || 123
|
||||
c: this.a || 123,
|
||||
someRef: ref(0)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -418,6 +419,7 @@ describe('type inference w/ options API', () => {
|
||||
expectType<number>(this.d)
|
||||
// computed get/set
|
||||
expectType<number>(this.e)
|
||||
expectType<number>(this.someRef)
|
||||
},
|
||||
methods: {
|
||||
doSomething() {
|
||||
|
Loading…
Reference in New Issue
Block a user