Skip to content

Commit 527c2c8

Browse files
author
Pick
authored
feat(types): expose DeepReadonly type (#1606)
1 parent 622d042 commit 527c2c8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/reactivity/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export {
2222
shallowReadonly,
2323
markRaw,
2424
toRaw,
25-
ReactiveFlags
25+
ReactiveFlags,
26+
DeepReadonly
2627
} from './reactive'
2728
export {
2829
computed,

packages/reactivity/src/reactive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function shallowReactive<T extends object>(target: T): T {
7474

7575
type Primitive = string | number | boolean | bigint | symbol | undefined | null
7676
type Builtin = Primitive | Function | Date | Error | RegExp
77-
type DeepReadonly<T> = T extends Builtin
77+
export type DeepReadonly<T> = T extends Builtin
7878
? T
7979
: T extends Map<infer K, infer V>
8080
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>

0 commit comments

Comments
 (0)