feat(types): expose DeepReadonly type (#1606)
This commit is contained in:
parent
622d042c6e
commit
527c2c8bbb
@ -22,7 +22,8 @@ export {
|
||||
shallowReadonly,
|
||||
markRaw,
|
||||
toRaw,
|
||||
ReactiveFlags
|
||||
ReactiveFlags,
|
||||
DeepReadonly
|
||||
} from './reactive'
|
||||
export {
|
||||
computed,
|
||||
|
@ -74,7 +74,7 @@ export function shallowReactive<T extends object>(target: T): T {
|
||||
|
||||
type Primitive = string | number | boolean | bigint | symbol | undefined | null
|
||||
type Builtin = Primitive | Function | Date | Error | RegExp
|
||||
type DeepReadonly<T> = T extends Builtin
|
||||
export type DeepReadonly<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Map<infer K, infer V>
|
||||
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
|
||||
|
Loading…
Reference in New Issue
Block a user