@mpxjs/core 2.8.36 → 2.8.40
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 +23 -16
- package/@types/node.d.ts +10 -8
- package/package.json +3 -3
package/@types/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/// <reference path="./node.d.ts" />
|
|
9
9
|
|
|
10
10
|
// @ts-ignore
|
|
11
|
-
import
|
|
11
|
+
import { GetComputedType } from '@mpxjs/store'
|
|
12
12
|
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
export * from '@mpxjs/store'
|
|
@@ -42,7 +42,7 @@ interface PropOpt {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
interface Properties {
|
|
45
|
-
[key: string]:
|
|
45
|
+
[key: string]: WechatMiniprogram.Component.AllProperty
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
interface Methods {
|
|
@@ -96,6 +96,7 @@ interface Mixin<D, P, C, M> {
|
|
|
96
96
|
properties?: P
|
|
97
97
|
computed?: C
|
|
98
98
|
methods?: M
|
|
99
|
+
|
|
99
100
|
[index: string]: any
|
|
100
101
|
}
|
|
101
102
|
|
|
@@ -108,14 +109,16 @@ interface Context {
|
|
|
108
109
|
triggerEvent: WechatMiniprogram.Component.InstanceMethods<Record<string, any>>['triggerEvent']
|
|
109
110
|
refs: ObjectOf<WechatMiniprogram.NodesRef & ComponentIns<{}, {}, {}, {}, []>>
|
|
110
111
|
asyncRefs: ObjectOf<Promise<WechatMiniprogram.NodesRef & ComponentIns<{}, {}, {}, {}, []>>>
|
|
112
|
+
|
|
111
113
|
forceUpdate (params?: object, callback?: () => void): void
|
|
114
|
+
|
|
112
115
|
selectComponent: ReplaceWxComponentIns['selectComponent']
|
|
113
116
|
selectAllComponents: ReplaceWxComponentIns['selectAllComponents']
|
|
114
117
|
createSelectorQuery: WechatMiniprogram.Component.InstanceMethods<Record<string, any>>['createSelectorQuery']
|
|
115
118
|
createIntersectionObserver: WechatMiniprogram.Component.InstanceMethods<Record<string, any>>['createIntersectionObserver']
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
interface ComponentOpt<D, P, C, M, Mi extends Array<any>, S extends Record<any, any>> extends Partial<WechatMiniprogram.Component.Lifetimes & WechatMiniprogram.Component.OtherOption>{
|
|
121
|
+
interface ComponentOpt<D, P, C, M, Mi extends Array<any>, S extends Record<any, any>> extends Partial<WechatMiniprogram.Component.Lifetimes & WechatMiniprogram.Component.OtherOption> {
|
|
119
122
|
data?: D
|
|
120
123
|
properties?: P
|
|
121
124
|
computed?: C
|
|
@@ -137,11 +140,11 @@ type PageOpt<D, P, C, M, Mi extends Array<any>, S extends Record<any, any>> =
|
|
|
137
140
|
ComponentOpt<D, P, C, M, Mi, S>
|
|
138
141
|
& Partial<WechatMiniprogram.Page.ILifetime>
|
|
139
142
|
|
|
140
|
-
type ThisTypedPageOpt<D extends
|
|
143
|
+
type ThisTypedPageOpt<D extends Data, P extends Properties, C, M extends Methods, Mi extends Array<any>, S extends Record<any, any>, O = {}> =
|
|
141
144
|
PageOpt<D, P, C, M, Mi, S>
|
|
142
145
|
& ThisType<ComponentIns<D, P, C, M, Mi, S, O>> & O
|
|
143
146
|
|
|
144
|
-
type ThisTypedComponentOpt<D extends
|
|
147
|
+
type ThisTypedComponentOpt<D extends Data, P extends Properties, C, M extends Methods, Mi extends Array<any>, S extends Record<any, any>, O = {}> =
|
|
145
148
|
ComponentOpt<D, P, C, M, Mi, S>
|
|
146
149
|
& ThisType<ComponentIns<D, P, C, M, Mi, S, O>> & O
|
|
147
150
|
|
|
@@ -169,13 +172,17 @@ type MpxComProps<O> = { $rawOptions: O }
|
|
|
169
172
|
|
|
170
173
|
export interface MpxComponentIns {
|
|
171
174
|
$refs: ObjectOf<WechatMiniprogram.NodesRef & ComponentIns<{}, {}, {}, {}, []>>
|
|
172
|
-
$asyncRefs
|
|
175
|
+
$asyncRefs: ObjectOf<Promise<WechatMiniprogram.NodesRef & ComponentIns<{}, {}, {}, {}, []>>>
|
|
173
176
|
$set: typeof set
|
|
174
177
|
$remove: typeof del
|
|
175
178
|
$delete: typeof del
|
|
179
|
+
|
|
176
180
|
$watch (expr: string | (() => any), handler: WatchHandler | WatchOptWithHandler, options?: WatchOpt): () => void
|
|
181
|
+
|
|
177
182
|
$forceUpdate (params?: object, callback?: () => void): void
|
|
183
|
+
|
|
178
184
|
$nextTick (fn: () => void): void
|
|
185
|
+
|
|
179
186
|
$i18n: {
|
|
180
187
|
locale: string
|
|
181
188
|
fallbackLocale: string
|
|
@@ -184,6 +191,7 @@ export interface MpxComponentIns {
|
|
|
184
191
|
$tc: typeof tc
|
|
185
192
|
$te: typeof te
|
|
186
193
|
$tm: typeof tm
|
|
194
|
+
|
|
187
195
|
[k: string]: any
|
|
188
196
|
}
|
|
189
197
|
|
|
@@ -193,17 +201,16 @@ interface ReplaceWxComponentIns {
|
|
|
193
201
|
selectAllComponents (selector: string): Array<ComponentIns<{}, {}, {}, {}, []>>
|
|
194
202
|
}
|
|
195
203
|
|
|
196
|
-
type WxComponentIns<D extends
|
|
197
|
-
|
|
198
|
-
&
|
|
199
|
-
& WechatMiniprogram.Component.InstanceMethods<D>
|
|
204
|
+
type WxComponentIns<D extends Data = {}, P extends Properties = {}, M extends Methods = {}> =
|
|
205
|
+
Omit<WechatMiniprogram.Component.Instance<D, P, M>, 'selectComponent' | 'selectAllComponents'>
|
|
206
|
+
& ReplaceWxComponentIns
|
|
200
207
|
|
|
201
|
-
type ComponentIns<D extends
|
|
208
|
+
type ComponentIns<D extends Data = {}, P extends Properties = {}, C = {}, M extends Methods = {}, Mi extends Array<any> = [], S extends Record<any, any> = {}, O = {}> =
|
|
202
209
|
GetDataType<D> & UnboxMixinsField<Mi, 'data'> &
|
|
203
210
|
M & UnboxMixinsField<Mi, 'methods'> & { [K in keyof S]: S[K] extends Ref<infer V> ? V : S[K] } &
|
|
204
211
|
GetPropsType<P & UnboxMixinsField<Mi, 'properties'>> &
|
|
205
212
|
GetComputedType<C & UnboxMixinsField<Mi, 'computed'>> &
|
|
206
|
-
WxComponentIns<D> & MpxComponentIns & MpxComProps<O>
|
|
213
|
+
WxComponentIns<D, P, M> & MpxComponentIns & MpxComProps<O>
|
|
207
214
|
|
|
208
215
|
interface CreateConfig {
|
|
209
216
|
customCtor: any
|
|
@@ -486,7 +493,7 @@ export function reactive<T extends object> (target: T): Reactive<T>
|
|
|
486
493
|
|
|
487
494
|
export function isReactive (value: unknown): boolean
|
|
488
495
|
|
|
489
|
-
export function markRaw<T extends object>(value: T): T
|
|
496
|
+
export function markRaw<T extends object> (value: T): T
|
|
490
497
|
|
|
491
498
|
export function shallowReactive<T extends object> (target: T): ShallowReactive<T>
|
|
492
499
|
|
|
@@ -566,6 +573,7 @@ export function onBeforeUnmount (callback: () => void): void
|
|
|
566
573
|
export function onUnmounted (callback: () => void): void
|
|
567
574
|
|
|
568
575
|
export function onLoad<T extends Record<string, string | undefined>> (callback: (query: T) => void): void
|
|
576
|
+
|
|
569
577
|
// wechat dose not have generics
|
|
570
578
|
// export function onLoad (callback: WechatMiniprogram.Page.ILifetime['onLoad']): void
|
|
571
579
|
|
|
@@ -592,7 +600,7 @@ export function onTabItemTap (callback: WechatMiniprogram.Page.ILifetime['onTabI
|
|
|
592
600
|
export function onSaveExitState (callback: () => void): void
|
|
593
601
|
|
|
594
602
|
// get instance
|
|
595
|
-
export function getCurrentInstance<T extends
|
|
603
|
+
export function getCurrentInstance<T extends ComponentIns<{}, {}, {}>> (): T
|
|
596
604
|
|
|
597
605
|
// I18n
|
|
598
606
|
export function useI18n<Options extends {
|
|
@@ -612,8 +620,7 @@ type InferDefaults<T> = {
|
|
|
612
620
|
[K in keyof T]?: InferDefault<T, NotUndefined<T[K]>>
|
|
613
621
|
}
|
|
614
622
|
|
|
615
|
-
type InferDefault<P, T> = T extends
|
|
616
|
-
| null
|
|
623
|
+
type InferDefault<P, T> = T extends | null
|
|
617
624
|
| number
|
|
618
625
|
| string
|
|
619
626
|
| boolean
|
package/@types/node.d.ts
CHANGED
|
@@ -12,19 +12,21 @@ declare let process: {
|
|
|
12
12
|
env: EnvType
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
declare namespace __WebpackModuleApi {
|
|
17
16
|
interface RequireContext {
|
|
18
|
-
keys(): string[];
|
|
17
|
+
keys (): string[];
|
|
18
|
+
|
|
19
19
|
(id: string): any;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
|
|
21
|
+
<T> (id: string): T;
|
|
22
|
+
|
|
23
|
+
resolve (id: string): string;
|
|
24
|
+
|
|
22
25
|
/** The module id of the context module. This may be useful for module.hot.accept. */
|
|
23
26
|
id: string;
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export function async<T>(path: string): Promise<T>
|
|
30
|
+
interface Require {
|
|
31
|
+
context (path: string, deep?: boolean, filter?: RegExp, mode?: 'sync' | 'eager' | 'weak' | 'lazy' | 'lazy-once'): __WebpackModuleApi.RequireContext
|
|
30
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/core",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.40",
|
|
4
4
|
"description": "mpx runtime core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"miniprogram",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@mpxjs/utils": "^2.8.15",
|
|
23
23
|
"lodash": "^4.1.1",
|
|
24
|
-
"miniprogram-api-typings": "^3.0
|
|
24
|
+
"miniprogram-api-typings": "^3.10.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@mpxjs/api-proxy": "^2.7.44",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"url": "https://github.com/didi/mpx/issues"
|
|
48
48
|
},
|
|
49
49
|
"sideEffects": false,
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "46a9b88c11f1ca2f0cfbc414e668b2f618ee6806"
|
|
51
51
|
}
|