Skip to content

Commit

Permalink
fix(types): export Raw type (#6380)
Browse files Browse the repository at this point in the history
fix #7048
  • Loading branch information
sxzz committed Nov 8, 2022
1 parent c4f213b commit e9172db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/reactivity/src/index.ts
Expand Up @@ -28,6 +28,7 @@ export {
shallowReadonly,
markRaw,
toRaw,
Raw,
ReactiveFlags,
DeepReadonly,
ShallowReactive,
Expand Down
6 changes: 3 additions & 3 deletions packages/reactivity/src/reactive.ts
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion packages/runtime-core/src/index.ts
Expand Up @@ -172,7 +172,8 @@ export {
DebuggerEvent,
DebuggerEventExtraInfo,
TrackOpTypes,
TriggerOpTypes
TriggerOpTypes,
Raw
} from '@vue/reactivity'
export {
WatchEffect,
Expand Down

0 comments on commit e9172db

Please sign in to comment.