ivue 1.1.16 → 1.1.17

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.
@@ -1,4 +1,5 @@
1
1
  import type { ComputedRef, ExtractPropTypes, Ref, ToRef, UnwrapNestedRefs } from 'vue';
2
+ import type { Ref as DemiRef } from 'vue-demi';
2
3
  import { UnwrapRef } from 'vue';
3
4
  /** Types */
4
5
  /**
@@ -24,10 +25,11 @@ export declare type IVueRefs<T = any> = {
24
25
  };
25
26
  /**
26
27
  * Unwraps the returned Refs of composable method T to a reactive type definition.
28
+ * Also support Vue 3 Demi for vue-use library support.
27
29
  */
28
- declare type ResolveRef<T = any> = T extends Ref ? ResolveRef<T['value']> : T;
29
- export declare type UseComposableReturn<T> = T extends Ref ? ResolveRef<T> : {
30
- [K in keyof T]: T[K] extends Ref ? ResolveRef<T[K]> : T[K];
30
+ declare type ResolveRef<T = any> = T extends Ref | DemiRef ? ResolveRef<T['value']> : T;
31
+ export declare type UseComposableReturn<T> = T extends Ref | DemiRef ? ResolveRef<T> : {
32
+ [K in keyof T]: T[K] extends Ref | DemiRef ? ResolveRef<T[K]> : T[K];
31
33
  };
32
34
  export declare type UseComposable<T extends (...args: any[]) => any> = UseComposableReturn<ReturnType<T>>;
33
35
  /**
package/docs/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "eslint-plugin-import": "^2.29.1",
19
19
  "eslint-plugin-vue": "^9.14.1",
20
20
  "execa": "^8.0.0",
21
- "ivue": "^1.1.14",
21
+ "ivue": "^1.1.16",
22
22
  "typescript": "^4.5.4",
23
23
  "vite-plugin-dynamic-import": "^1.5.0",
24
24
  "vite-tsconfig-paths": "^4.3.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ivue",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "Infinite Vue – Class Based Architecture for Vue 3",
5
5
  "type": "module",
6
6
  "exports": {
package/src/ivue.ts CHANGED
@@ -7,6 +7,7 @@ import type {
7
7
  ToRef,
8
8
  UnwrapNestedRefs,
9
9
  } from 'vue';
10
+ import type { Ref as DemiRef } from 'vue-demi';
10
11
  import { UnwrapRef, computed, reactive, ref, toRef } from 'vue';
11
12
 
12
13
  /** Types */
@@ -39,13 +40,14 @@ export type IVueRefs<T = any> = {
39
40
 
40
41
  /**
41
42
  * Unwraps the returned Refs of composable method T to a reactive type definition.
43
+ * Also support Vue 3 Demi for vue-use library support.
42
44
  */
43
- type ResolveRef<T = any> = T extends Ref ? ResolveRef<T['value']> : T;
45
+ type ResolveRef<T = any> = T extends Ref | DemiRef ? ResolveRef<T['value']> : T;
44
46
 
45
- export type UseComposableReturn<T> = T extends Ref
47
+ export type UseComposableReturn<T> = T extends Ref | DemiRef
46
48
  ? ResolveRef<T>
47
49
  : {
48
- [K in keyof T]: T[K] extends Ref ? ResolveRef<T[K]> : T[K];
50
+ [K in keyof T]: T[K] extends Ref | DemiRef ? ResolveRef<T[K]> : T[K];
49
51
  };
50
52
 
51
53
  export type UseComposable<T extends (...args: any[]) => any> =