1
- import { Ref , UnwrapRef , ShallowUnwrapRef , ComputedRef } from '@vue/reactivity'
1
+ import {
2
+ Ref ,
3
+ UnwrapRef ,
4
+ ShallowUnwrapRef ,
5
+ ComputedRef ,
6
+ WritableComputedOptions ,
7
+ DebuggerOptions ,
8
+ WritableComputedRef
9
+ } from '@vue/reactivity'
2
10
3
11
export function $ref < T > ( arg : T | Ref < T > ) : UnwrapRef < T >
4
12
export function $ref ( ) { }
@@ -8,17 +16,28 @@ export function $shallowRef<T>(arg: T): T {
8
16
}
9
17
10
18
declare const ComputedRefMarker : unique symbol
11
- type ComputedRefValue < T > = T & { [ ComputedRefMarker ] ?: any }
19
+ type ComputedValue < T > = T & { [ ComputedRefMarker ] ?: any }
12
20
13
- export function $computed < T > ( getter : ( ) => T ) : ComputedRefValue < T >
21
+ declare const WritableComputedRefMarker : unique symbol
22
+ type WritableComputedValue < T > = T & { [ WritableComputedRefMarker ] ?: any }
23
+
24
+ export function $computed < T > (
25
+ getter : ( ) => T ,
26
+ debuggerOptions ?: DebuggerOptions
27
+ ) : ComputedValue < T >
28
+ export function $computed < T > (
29
+ options : WritableComputedOptions < T > ,
30
+ debuggerOptions ?: DebuggerOptions
31
+ ) : WritableComputedValue < T >
14
32
export function $computed ( ) { }
15
33
16
34
export function $fromRefs < T > ( source : T ) : ShallowUnwrapRef < T >
17
35
export function $fromRefs ( ) {
18
36
return null as any
19
37
}
20
38
21
- export function $raw < T > ( value : ComputedRefValue < T > ) : ComputedRef < T >
39
+ export function $raw < T > ( value : ComputedValue < T > ) : ComputedRef < T >
40
+ export function $raw < T > ( value : WritableComputedValue < T > ) : WritableComputedRef < T >
22
41
export function $raw < T > ( value : T ) : Ref < T >
23
42
export function $raw ( ) {
24
43
return null as any
0 commit comments