@vueuse/shared 10.11.0 → 10.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.cts +6 -14
- package/index.d.mts +6 -14
- package/index.d.ts +6 -14
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue_demi from 'vue-demi';
|
|
2
|
-
import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs,
|
|
2
|
+
import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, ShallowRef, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, WatchCallback, WatchStopHandle } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Note: If you are using Vue 3.4+, you can straight use computed instead.
|
|
@@ -42,21 +42,13 @@ type RemovableRef<T> = Omit<Ref<T>, 'value'> & {
|
|
|
42
42
|
set value(value: T | null | undefined);
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
-
* Maybe it's a ref, or a plain value
|
|
46
|
-
*
|
|
47
|
-
* ```ts
|
|
48
|
-
* type MaybeRef<T> = T | Ref<T>
|
|
49
|
-
* ```
|
|
45
|
+
* Maybe it's a ref, or a plain value.
|
|
50
46
|
*/
|
|
51
|
-
type MaybeRef<T> = T | Ref<T>;
|
|
47
|
+
type MaybeRef<T = any> = T | Ref<T> | ShallowRef<T> | WritableComputedRef<T>;
|
|
52
48
|
/**
|
|
53
|
-
* Maybe it's a ref, or a plain value, or a getter function
|
|
54
|
-
*
|
|
55
|
-
* ```ts
|
|
56
|
-
* type MaybeRefOrGetter<T> = (() => T) | T | Ref<T> | ComputedRef<T>
|
|
57
|
-
* ```
|
|
49
|
+
* Maybe it's a ref, or a plain value, or a getter function.
|
|
58
50
|
*/
|
|
59
|
-
type MaybeRefOrGetter<T> = MaybeRef<T> | (() => T);
|
|
51
|
+
type MaybeRefOrGetter<T = any> = MaybeRef<T> | ComputedRef<T> | (() => T);
|
|
60
52
|
/**
|
|
61
53
|
* Maybe it's a computed ref, or a readonly value, or a getter function
|
|
62
54
|
*/
|
|
@@ -919,7 +911,7 @@ interface UseCounterOptions {
|
|
|
919
911
|
* @param [initialValue]
|
|
920
912
|
* @param options
|
|
921
913
|
*/
|
|
922
|
-
declare function useCounter(initialValue?: MaybeRef
|
|
914
|
+
declare function useCounter(initialValue?: MaybeRef<number>, options?: UseCounterOptions): {
|
|
923
915
|
count: vue_demi.Ref<number>;
|
|
924
916
|
inc: (delta?: number) => number;
|
|
925
917
|
dec: (delta?: number) => number;
|
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue_demi from 'vue-demi';
|
|
2
|
-
import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs,
|
|
2
|
+
import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, ShallowRef, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, WatchCallback, WatchStopHandle } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Note: If you are using Vue 3.4+, you can straight use computed instead.
|
|
@@ -42,21 +42,13 @@ type RemovableRef<T> = Omit<Ref<T>, 'value'> & {
|
|
|
42
42
|
set value(value: T | null | undefined);
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
-
* Maybe it's a ref, or a plain value
|
|
46
|
-
*
|
|
47
|
-
* ```ts
|
|
48
|
-
* type MaybeRef<T> = T | Ref<T>
|
|
49
|
-
* ```
|
|
45
|
+
* Maybe it's a ref, or a plain value.
|
|
50
46
|
*/
|
|
51
|
-
type MaybeRef<T> = T | Ref<T>;
|
|
47
|
+
type MaybeRef<T = any> = T | Ref<T> | ShallowRef<T> | WritableComputedRef<T>;
|
|
52
48
|
/**
|
|
53
|
-
* Maybe it's a ref, or a plain value, or a getter function
|
|
54
|
-
*
|
|
55
|
-
* ```ts
|
|
56
|
-
* type MaybeRefOrGetter<T> = (() => T) | T | Ref<T> | ComputedRef<T>
|
|
57
|
-
* ```
|
|
49
|
+
* Maybe it's a ref, or a plain value, or a getter function.
|
|
58
50
|
*/
|
|
59
|
-
type MaybeRefOrGetter<T> = MaybeRef<T> | (() => T);
|
|
51
|
+
type MaybeRefOrGetter<T = any> = MaybeRef<T> | ComputedRef<T> | (() => T);
|
|
60
52
|
/**
|
|
61
53
|
* Maybe it's a computed ref, or a readonly value, or a getter function
|
|
62
54
|
*/
|
|
@@ -919,7 +911,7 @@ interface UseCounterOptions {
|
|
|
919
911
|
* @param [initialValue]
|
|
920
912
|
* @param options
|
|
921
913
|
*/
|
|
922
|
-
declare function useCounter(initialValue?: MaybeRef
|
|
914
|
+
declare function useCounter(initialValue?: MaybeRef<number>, options?: UseCounterOptions): {
|
|
923
915
|
count: vue_demi.Ref<number>;
|
|
924
916
|
inc: (delta?: number) => number;
|
|
925
917
|
dec: (delta?: number) => number;
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue_demi from 'vue-demi';
|
|
2
|
-
import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs,
|
|
2
|
+
import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, ShallowRef, WatchOptions, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, WatchCallback, WatchStopHandle } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Note: If you are using Vue 3.4+, you can straight use computed instead.
|
|
@@ -42,21 +42,13 @@ type RemovableRef<T> = Omit<Ref<T>, 'value'> & {
|
|
|
42
42
|
set value(value: T | null | undefined);
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
-
* Maybe it's a ref, or a plain value
|
|
46
|
-
*
|
|
47
|
-
* ```ts
|
|
48
|
-
* type MaybeRef<T> = T | Ref<T>
|
|
49
|
-
* ```
|
|
45
|
+
* Maybe it's a ref, or a plain value.
|
|
50
46
|
*/
|
|
51
|
-
type MaybeRef<T> = T | Ref<T>;
|
|
47
|
+
type MaybeRef<T = any> = T | Ref<T> | ShallowRef<T> | WritableComputedRef<T>;
|
|
52
48
|
/**
|
|
53
|
-
* Maybe it's a ref, or a plain value, or a getter function
|
|
54
|
-
*
|
|
55
|
-
* ```ts
|
|
56
|
-
* type MaybeRefOrGetter<T> = (() => T) | T | Ref<T> | ComputedRef<T>
|
|
57
|
-
* ```
|
|
49
|
+
* Maybe it's a ref, or a plain value, or a getter function.
|
|
58
50
|
*/
|
|
59
|
-
type MaybeRefOrGetter<T> = MaybeRef<T> | (() => T);
|
|
51
|
+
type MaybeRefOrGetter<T = any> = MaybeRef<T> | ComputedRef<T> | (() => T);
|
|
60
52
|
/**
|
|
61
53
|
* Maybe it's a computed ref, or a readonly value, or a getter function
|
|
62
54
|
*/
|
|
@@ -919,7 +911,7 @@ interface UseCounterOptions {
|
|
|
919
911
|
* @param [initialValue]
|
|
920
912
|
* @param options
|
|
921
913
|
*/
|
|
922
|
-
declare function useCounter(initialValue?: MaybeRef
|
|
914
|
+
declare function useCounter(initialValue?: MaybeRef<number>, options?: UseCounterOptions): {
|
|
923
915
|
count: vue_demi.Ref<number>;
|
|
924
916
|
inc: (delta?: number) => number;
|
|
925
917
|
dec: (delta?: number) => number;
|