@mpxjs/core 2.8.5 → 2.8.6

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 CHANGED
@@ -7,8 +7,10 @@
7
7
  /// <reference path="./global.d.ts" />
8
8
  /// <reference path="./node.d.ts" />
9
9
 
10
+ // @ts-ignore
10
11
  import type { GetComputedType } from '@mpxjs/store'
11
12
 
13
+ // @ts-ignore
12
14
  export * from '@mpxjs/store'
13
15
 
14
16
  // utils
@@ -571,27 +573,29 @@ export function onBeforeUnmount (callback: () => void): void
571
573
 
572
574
  export function onUnmounted (callback: () => void): void
573
575
 
574
- export function onLoad<T extends object> (callback: (query: T) => void): void
576
+ export function onLoad<T extends Record<string, string | undefined>> (callback: (query: T) => void): void
577
+ // wechat dose not have generics
578
+ // export function onLoad (callback: WechatMiniprogram.Page.ILifetime['onLoad']): void
575
579
 
576
- export function onShow (callback: () => void): void
580
+ export function onShow (callback: WechatMiniprogram.Page.ILifetime['onShow']): void
577
581
 
578
- export function onHide (callback: () => void): void
582
+ export function onHide (callback: WechatMiniprogram.Page.ILifetime['onHide']): void
579
583
 
580
- export function onResize (callback: () => void): void
584
+ export function onResize (callback: WechatMiniprogram.Page.ILifetime['onResize']): void
581
585
 
582
- export function onPullDownRefresh (callback: () => void): void
586
+ export function onPullDownRefresh (callback: WechatMiniprogram.Page.ILifetime['onPullDownRefresh']): void
583
587
 
584
- export function onReachBottom (callback: () => void): void
588
+ export function onReachBottom (callback: WechatMiniprogram.Page.ILifetime['onReachBottom']): void
585
589
 
586
- export function onShareAppMessage (callback: () => void): void
590
+ export function onShareAppMessage (callback: WechatMiniprogram.Page.ILifetime['onShareAppMessage']): void
587
591
 
588
- export function onShareTimeline (callback: () => void): void
592
+ export function onShareTimeline (callback: WechatMiniprogram.Page.ILifetime['onShareTimeline']): void
589
593
 
590
- export function onAddToFavorites (callback: () => void): void
594
+ export function onAddToFavorites (callback: WechatMiniprogram.Page.ILifetime['onAddToFavorites']): void
591
595
 
592
- export function onPageScroll (callback: () => void): void
596
+ export function onPageScroll (callback: WechatMiniprogram.Page.ILifetime['onPageScroll']): void
593
597
 
594
- export function onTabItemTap (callback: () => void): void
598
+ export function onTabItemTap (callback: WechatMiniprogram.Page.ILifetime['onTabItemTap']): void
595
599
 
596
600
  export function onSaveExitState (callback: () => void): void
597
601
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/core",
3
- "version": "2.8.5",
3
+ "version": "2.8.6",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -47,5 +47,5 @@
47
47
  "url": "https://github.com/didi/mpx/issues"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "c4cb7f7244d13a59535891acf02c347960c52343"
50
+ "gitHead": "c4261c7ea5a16ee3ceaac78afad09e5e0b35d39a"
51
51
  }
@@ -1,5 +1,21 @@
1
+ import { error } from '@mpxjs/utils'
2
+
3
+ const BEHAVIORS_MAP = [
4
+ 'wx://form-field',
5
+ 'wx://form-field-group',
6
+ 'wx://form-field-button',
7
+ 'wx://component-export'
8
+ ]
9
+
1
10
  export default {
2
11
  convert (options) {
3
- // 暂时无需转换
12
+ if (options.behaviors) {
13
+ options.behaviors.forEach((behavior, idx) => {
14
+ if (BEHAVIORS_MAP.includes(behavior)) {
15
+ error(`Built-in behavior "${behavior}" is not supported in tt environment!`, global.currentResource)
16
+ options.behaviors.splice(idx, 1)
17
+ }
18
+ })
19
+ }
4
20
  }
5
21
  }