@tarojs/taro-h5 3.5.6-alpha.0 → 3.5.6-alpha.2

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,6 +1,3 @@
1
- export declare const getLaunchOptionsSync: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const getEnterOptionsSync: () => Promise<{
5
- errMsg: string;
6
- }>;
1
+ import Taro from '@tarojs/api';
2
+ export declare const getLaunchOptionsSync: typeof Taro.getLaunchOptionsSync;
3
+ export declare const getEnterOptionsSync: typeof Taro.getEnterOptionsSync;
@@ -1,4 +1,15 @@
1
- import { temporarilyNotSupport } from '../../../utils';
1
+ import Taro from '@tarojs/api';
2
+ const launchOptions = {
3
+ path: '',
4
+ query: {},
5
+ scene: 0,
6
+ shareTicket: '',
7
+ referrerInfo: {}
8
+ };
9
+ function initLaunchOptions(options = {}) {
10
+ Object.assign(launchOptions, options);
11
+ }
12
+ Taro.eventCenter.once('__taroRouterLaunch', initLaunchOptions);
2
13
  // 生命周期
3
- export const getLaunchOptionsSync = temporarilyNotSupport('getLaunchOptionsSync');
4
- export const getEnterOptionsSync = temporarilyNotSupport('getEnterOptionsSync');
14
+ export const getLaunchOptionsSync = () => launchOptions;
15
+ export const getEnterOptionsSync = () => launchOptions;
@@ -137,12 +137,8 @@ declare const offAudioInterruptionBegin: () => Promise<{
137
137
  declare const offAppShow: typeof Taro.offWindowResize;
138
138
  declare const offAppHide: typeof Taro.offWindowResize;
139
139
  // 生命周期
140
- declare const getLaunchOptionsSync: () => Promise<{
141
- errMsg: string;
142
- }>;
143
- declare const getEnterOptionsSync: () => Promise<{
144
- errMsg: string;
145
- }>;
140
+ declare const getLaunchOptionsSync: typeof Taro.getLaunchOptionsSync;
141
+ declare const getEnterOptionsSync: typeof Taro.getEnterOptionsSync;
146
142
  // 画布
147
143
  /** 创建离屏 canvas 实例 */
148
144
  declare const createOffscreenCanvas: () => Promise<{
package/dist/index.cjs.js CHANGED
@@ -799,9 +799,20 @@ const offAppHide = callback => {
799
799
  }
800
800
  };
801
801
 
802
+ const launchOptions = {
803
+ path: '',
804
+ query: {},
805
+ scene: 0,
806
+ shareTicket: '',
807
+ referrerInfo: {}
808
+ };
809
+ function initLaunchOptions(options = {}) {
810
+ Object.assign(launchOptions, options);
811
+ }
812
+ Taro__default["default"].eventCenter.once('__taroRouterLaunch', initLaunchOptions);
802
813
  // 生命周期
803
- const getLaunchOptionsSync = temporarilyNotSupport('getLaunchOptionsSync');
804
- const getEnterOptionsSync = temporarilyNotSupport('getEnterOptionsSync');
814
+ const getLaunchOptionsSync = () => launchOptions;
815
+ const getEnterOptionsSync = () => launchOptions;
805
816
 
806
817
  // TODO env 环境变量
807
818
  const canIUse = temporarilyNotSupport('canIUse');