Skip to content

Commit

Permalink
fix(types): export Raw type (vuejs#6380)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz authored and chrislone committed Feb 4, 2023
1 parent 7a9d4ad commit 811390b
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ export {
DebuggerEvent,
DebuggerEventExtraInfo,
TrackOpTypes,
TriggerOpTypes
TriggerOpTypes,
Raw
} from '@vue/reactivity'
export {
WatchEffect,
Expand Down

0 comments on commit 811390b

Please sign in to comment.