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, shallowReadonly,
markRaw, markRaw,
toRaw, toRaw,
Raw,
ReactiveFlags, ReactiveFlags,
DeepReadonly, DeepReadonly,
ShallowReactive, ShallowReactive,

View File

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

View File

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