@mpxjs/core 2.8.47 → 2.8.50
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/@types/index.d.ts +17 -9
- package/package.json +3 -3
package/@types/index.d.ts
CHANGED
|
@@ -31,18 +31,22 @@ type ArrayType<T extends any[]> = T extends Array<infer R> ? R : never;
|
|
|
31
31
|
// Mpx types
|
|
32
32
|
type Data = object | (() => object)
|
|
33
33
|
|
|
34
|
-
type
|
|
34
|
+
type PropConstructor<T = any> = {
|
|
35
|
+
new (...args: any[]): T & {};
|
|
36
|
+
} | {
|
|
37
|
+
(): T;
|
|
38
|
+
}
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
type: PropType
|
|
38
|
-
optionalTypes?: Array<PropType>
|
|
39
|
-
value?: any
|
|
40
|
+
export type PropType<T> = PropConstructor<T>
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
type FullPropType<T> = {
|
|
43
|
+
type: PropType<T>;
|
|
44
|
+
value?: T;
|
|
45
|
+
optionalTypes?: PropType<T>[];
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
interface Properties {
|
|
45
|
-
[key: string]: WechatMiniprogram.Component.AllProperty
|
|
49
|
+
[key: string]: WechatMiniprogram.Component.AllProperty | PropType<any> | FullPropType<any>
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
interface Methods {
|
|
@@ -78,8 +82,12 @@ type PropValueType<Def> = Def extends {
|
|
|
78
82
|
}
|
|
79
83
|
? T
|
|
80
84
|
: Def extends (...args: any[]) => infer T
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
? T
|
|
86
|
+
: Def extends FullPropType<infer T>
|
|
87
|
+
? T
|
|
88
|
+
: Def extends PropType<infer T>
|
|
89
|
+
? T
|
|
90
|
+
: any;
|
|
83
91
|
|
|
84
92
|
type GetPropsType<T> = {
|
|
85
93
|
readonly [K in keyof T]: PropValueType<T[K]>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/core",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.50",
|
|
4
4
|
"description": "mpx runtime core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"miniprogram",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"main": "src/index.js",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mpxjs/utils": "^2.8.
|
|
22
|
+
"@mpxjs/utils": "^2.8.50",
|
|
23
23
|
"lodash": "^4.1.1",
|
|
24
24
|
"miniprogram-api-typings": "^3.10.0"
|
|
25
25
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"url": "https://github.com/didi/mpx/issues"
|
|
48
48
|
},
|
|
49
49
|
"sideEffects": false,
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "32f30631cc5f37503fb7791cb3b0d6c901ee2b27"
|
|
51
51
|
}
|