fix(types): export `Raw` type (#6380)

fix #7048
This commit is contained in:
三咲智子 Kevin Deng 2022-11-08 10:03:49 +08:00 committed by GitHub
parent c4f213b425
commit e9172db68b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -28,6 +28,7 @@ export {
shallowReadonly,
markRaw,
toRaw,
Raw,
ReactiveFlags,
DeepReadonly,
ShallowReactive,

View File

@ -241,9 +241,9 @@ export function toRaw<T>(observed: T): T {
return raw ? toRaw(raw) : observed
}
export function markRaw<T extends object>(
value: T
): T & { [RawSymbol]?: true } {
export type Raw<T> = T & { [RawSymbol]?: true }
export function markRaw<T extends object>(value: T): Raw<T> {
def(value, ReactiveFlags.SKIP, true)
return value
}

View File

@ -172,7 +172,8 @@ export {
DebuggerEvent,
DebuggerEventExtraInfo,
TrackOpTypes,
TriggerOpTypes
TriggerOpTypes,
Raw
} from '@vue/reactivity'
export {
WatchEffect,