@ftjs/core 1.3.0 → 1.3.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/dist/type-helper.d.ts +3 -2
- package/package.json +1 -1
package/dist/type-helper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MaybeRef, Ref } from 'vue';
|
|
1
|
+
import { ComputedRef, MaybeRef, Ref, ShallowRef, WritableComputedRef } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* 临时工具类型减1
|
|
4
4
|
*/
|
|
@@ -23,11 +23,12 @@ export type Unref<T> = T extends MaybeRef<infer U> ? U : T;
|
|
|
23
23
|
export type Unrefs<T> = {
|
|
24
24
|
[K in keyof T]: Unref<T[K]>;
|
|
25
25
|
};
|
|
26
|
+
export type MaybeRef2<T = any> = T | Ref<T> | ShallowRef<T> | WritableComputedRef<T> | ComputedRef<T>;
|
|
26
27
|
/**
|
|
27
28
|
* 工具类型:将对象的属性值转换为 {@link MaybeRef}
|
|
28
29
|
*/
|
|
29
30
|
export type Refs<T> = {
|
|
30
|
-
[K in keyof T]: T[K] extends Ref<any> ? T[K] :
|
|
31
|
+
[K in keyof T]: T[K] extends Ref<any> ? T[K] : MaybeRef2<T[K]>;
|
|
31
32
|
};
|
|
32
33
|
/**
|
|
33
34
|
* 工具类型:提取 Column 的类型
|