File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,20 @@ interface Option<T> {
88 set : ( value : T ) => void ;
99}
1010
11+ export interface ComputedRef < T = any > extends WritableComputedRef < T > {
12+ readonly value : T ;
13+ }
14+
15+ interface WritableComputedRef < T > extends Ref < T > { }
16+
1117// read-only
12- export function computed < T > ( getter : Option < T > [ 'get' ] ) : Readonly < Ref < Readonly < T > > > ;
18+ export function computed < T > ( getter : Option < T > [ 'get' ] ) : ComputedRef < T > ;
1319// writable
14- export function computed < T > ( options : Option < T > ) : Ref < Readonly < T > > ;
20+ export function computed < T > ( options : Option < T > ) : WritableComputedRef < T > ;
1521// implement
1622export function computed < T > (
1723 options : Option < T > [ 'get' ] | Option < T >
18- ) : Readonly < Ref < Readonly < T > > > | Ref < Readonly < T > > {
24+ ) : ComputedRef < T > | WritableComputedRef < T > {
1925 const vm = getCurrentVM ( ) ;
2026 let get : Option < T > [ 'get' ] , set : Option < T > [ 'set' ] | undefined ;
2127 if ( typeof options === 'function' ) {
You can’t perform that action at this time.
0 commit comments