File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ export function shallowReactive<T extends object>(
135
135
}
136
136
137
137
type Primitive = string | number | boolean | bigint | symbol | undefined | null
138
- type Builtin = Primitive | Function | Date | Error | RegExp
138
+ export type Builtin = Primitive | Function | Date | Error | RegExp
139
139
export type DeepReadonly < T > = T extends Builtin
140
140
? T
141
141
: T extends Map < infer K , infer V >
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import {
21
21
toRaw ,
22
22
toReactive ,
23
23
} from './reactive'
24
- import type { ShallowReactiveMarker } from './reactive'
24
+ import type { Builtin , ShallowReactiveMarker } from './reactive'
25
25
import { type Dep , createDep } from './dep'
26
26
import { ComputedRefImpl } from './computed'
27
27
import { getDepFromReactive } from './reactiveEffect'
@@ -475,11 +475,6 @@ function propertyToRef(
475
475
: ( new ObjectRefImpl ( source , key , defaultValue ) as any )
476
476
}
477
477
478
- // corner case when use narrows type
479
- // Ex. type RelativePath = string & { __brand: unknown }
480
- // RelativePath extends object -> true
481
- type BaseTypes = string | number | boolean
482
-
483
478
/**
484
479
* This is a special exported interface for other packages to declare
485
480
* additional types that should bail out for ref unwrapping. For example
@@ -509,8 +504,7 @@ export type UnwrapRef<T> =
509
504
: UnwrapRefSimple < T >
510
505
511
506
export type UnwrapRefSimple < T > = T extends
512
- | Function
513
- | BaseTypes
507
+ | Builtin
514
508
| Ref
515
509
| RefUnwrapBailTypes [ keyof RefUnwrapBailTypes ]
516
510
| { [ RawSymbol ] ?: true }
Original file line number Diff line number Diff line change @@ -46,11 +46,11 @@ export interface LegacyPublicProperties {
46
46
$set < T extends Record < keyof any , any > , K extends keyof T > (
47
47
target : T ,
48
48
key : K ,
49
- value : T [ K ]
49
+ value : T [ K ] ,
50
50
) : void
51
51
$delete < T extends Record < keyof any , any > , K extends keyof T > (
52
52
target : T ,
53
- key : K
53
+ key : K ,
54
54
) : void
55
55
$mount ( el ?: string | Element ) : this
56
56
$destroy ( ) : void
You can’t perform that action at this time.
0 commit comments