ivue 1.5.6 → 1.5.7
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/dist/ivue.d.ts +2 -2
- package/lib/ivue.ts +8 -6
- package/package.json +1 -1
package/dist/ivue.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface IVueToRefsFn<T extends AnyClass> {
|
|
|
27
27
|
* Converts a class properties to a composable .value Refs using ToRef vue type,
|
|
28
28
|
* also knows NOT to convert functions to .value Refs but to leave them as is.
|
|
29
29
|
*/
|
|
30
|
-
export declare type IVueRefs<T
|
|
30
|
+
export declare type IVueRefs<T> = {
|
|
31
31
|
[K in keyof T]: T[K] extends Function ? T[K] : ToRef<T[K]>;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
@@ -47,7 +47,7 @@ export declare type Unwrap<T> = T extends Ref | DemiRef ? UnwrapRefRecursively<T
|
|
|
47
47
|
/**
|
|
48
48
|
* Fully unwraps to bare value types any Vue 3 composable return definition type.
|
|
49
49
|
*/
|
|
50
|
-
export declare type Use<T = any> = Unwrap<T extends AnyFn ? ReturnType<T> : T>;
|
|
50
|
+
export declare type Use<T = any> = T extends Ref | DemiRef ? UnwrapRefRecursively<T> : Unwrap<T extends AnyFn ? ReturnType<T> : T>;
|
|
51
51
|
/**
|
|
52
52
|
* Extracts object defined emit types by converting them to a plain interface
|
|
53
53
|
*/
|
package/lib/ivue.ts
CHANGED
|
@@ -30,10 +30,10 @@ export interface IVueToRefsFn<T extends AnyClass> {
|
|
|
30
30
|
IVueRefs<InstanceType<T>>,
|
|
31
31
|
P
|
|
32
32
|
>;
|
|
33
|
-
<P extends keyof InstanceType<T>>(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
<P extends keyof InstanceType<T>>(props: P[], unwrap: true): Pick<
|
|
34
|
+
InstanceType<T>,
|
|
35
|
+
P
|
|
36
|
+
>;
|
|
37
37
|
(props: true): InstanceType<T>;
|
|
38
38
|
(props: false): IVueRefs<InstanceType<T>>;
|
|
39
39
|
(): IVueRefs<InstanceType<T>>;
|
|
@@ -43,7 +43,7 @@ export interface IVueToRefsFn<T extends AnyClass> {
|
|
|
43
43
|
* Converts a class properties to a composable .value Refs using ToRef vue type,
|
|
44
44
|
* also knows NOT to convert functions to .value Refs but to leave them as is.
|
|
45
45
|
*/
|
|
46
|
-
export type IVueRefs<T
|
|
46
|
+
export type IVueRefs<T> = {
|
|
47
47
|
[K in keyof T]: T[K] extends Function ? T[K] : ToRef<T[K]>;
|
|
48
48
|
};
|
|
49
49
|
|
|
@@ -72,7 +72,9 @@ export type Unwrap<T> = T extends Ref | DemiRef
|
|
|
72
72
|
/**
|
|
73
73
|
* Fully unwraps to bare value types any Vue 3 composable return definition type.
|
|
74
74
|
*/
|
|
75
|
-
export type Use<T = any> =
|
|
75
|
+
export type Use<T = any> = T extends Ref | DemiRef
|
|
76
|
+
? UnwrapRefRecursively<T>
|
|
77
|
+
: Unwrap<T extends AnyFn ? ReturnType<T> : T>;
|
|
76
78
|
|
|
77
79
|
/**
|
|
78
80
|
* Extracts object defined emit types by converting them to a plain interface
|