@tarojs/taro-h5 3.6.6-alpha.3 → 3.6.7
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/_virtual/_commonjsHelpers.js +35 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/lodash.js +4 -0
- package/dist/_virtual/lodash.js.map +1 -0
- package/dist/api/base/index.d.ts +2 -1
- package/dist/api/base/index.js +3 -3
- package/dist/api/base/index.js.map +1 -1
- package/dist/api/base/weapp/app-event.js +4 -3
- package/dist/api/base/weapp/app-event.js.map +1 -1
- package/dist/api/canvas/CanvasContext.d.ts +1 -2
- package/dist/api/canvas/CanvasContext.js.map +1 -1
- package/dist/api/device/accelerometer.js +2 -1
- package/dist/api/device/accelerometer.js.map +1 -1
- package/dist/api/device/compass.js +2 -1
- package/dist/api/device/compass.js.map +1 -1
- package/dist/api/device/index.js +1 -1
- package/dist/api/device/motion.js +2 -1
- package/dist/api/device/motion.js.map +1 -1
- package/dist/api/device/wifi.d.ts +2 -1
- package/dist/api/device/wifi.js +2 -1
- package/dist/api/device/wifi.js.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +6 -5
- package/dist/api/index.js.map +1 -1
- package/dist/api/media/audio/InnerAudioContext.d.ts +2 -0
- package/dist/api/media/audio/InnerAudioContext.js +4 -1
- package/dist/api/media/audio/InnerAudioContext.js.map +1 -1
- package/dist/api/media/image/index.d.ts +3 -1
- package/dist/api/media/image/index.js +3 -1
- package/dist/api/media/image/index.js.map +1 -1
- package/dist/api/media/index.js +1 -1
- package/dist/api/network/request/index.d.ts +1 -1
- package/dist/api/network/request/index.js +18 -23
- package/dist/api/network/request/index.js.map +1 -1
- package/dist/api/open-api/index.js +1 -1
- package/dist/api/open-api/subscribe-message.d.ts +2 -1
- package/dist/api/open-api/subscribe-message.js +3 -1
- package/dist/api/open-api/subscribe-message.js.map +1 -1
- package/dist/api/qq/index.d.ts +2 -0
- package/dist/api/qq/index.js +7 -0
- package/dist/api/qq/index.js.map +1 -0
- package/dist/api/ui/index.js +1 -1
- package/dist/api/ui/window.d.ts +2 -1
- package/dist/api/ui/window.js +2 -1
- package/dist/api/ui/window.js.map +1 -1
- package/dist/index.cjs.d.ts +11 -4
- package/dist/index.cjs.js +17552 -236
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.d.ts +11 -4
- package/dist/index.esm.js +17493 -207
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -10
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/registry.npmjs.org_lodash@4.17.21/node_modules/lodash/lodash.js +17220 -0
- package/dist/node_modules/.pnpm/registry.npmjs.org_lodash@4.17.21/node_modules/lodash/lodash.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/lodash.d.ts +3 -0
- package/dist/utils/lodash.js +32 -0
- package/dist/utils/lodash.js.map +1 -0
- package/package.json +10 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InnerAudioContext.js","sources":["../../../../src/api/media/audio/InnerAudioContext.ts"],"sourcesContent":["import Taro from '@tarojs/api'\n\nimport { permanentlyNotSupport } from '../../../utils'\nimport { CallbackManager } from '../../../utils/handler'\n\nexport class InnerAudioContext implements Taro.InnerAudioContext {\n Instance?: HTMLAudioElement\n errorStack: CallbackManager\n stopStack: CallbackManager\n __startTime = 0\n\n constructor () {\n this.Instance = new Audio()\n this.errorStack = new CallbackManager()\n this.stopStack = new CallbackManager()\n\n Taro.eventCenter.on('__taroRouterChange', () => { this.stop() })\n this.onPlay(() => {\n if (this.currentTime !== this.startTime) {\n this.seek(this.startTime)\n }\n })\n }\n\n set autoplay (e) { this.setProperty('autoplay', e) }\n get autoplay () { return this.Instance?.autoplay || false }\n get buffered () { return this.Instance?.buffered.length || 0 }\n get currentTime () { return this.Instance?.currentTime || 0 }\n get duration () { return this.Instance?.duration || 0 }\n set loop (e) { this.setProperty('loop', e) }\n get loop () { return this.Instance?.loop || false }\n get paused () { return this.Instance?.paused ?? true }\n set src (e) { this.setProperty('src', e) }\n get src () { return this.Instance?.src || '' }\n set volume (e) { this.setProperty('volume', e) }\n get volume () { return this.Instance?.volume || 0 }\n set playbackRate (e) { this.setProperty('playbackRate', e) }\n get playbackRate () { return this.Instance?.playbackRate || 0 }\n set obeyMuteSwitch (_e) { permanentlyNotSupport('InnerAudioContext.obeyMuteSwitch')() }\n get obeyMuteSwitch () { return true }\n set startTime (e) { this.__startTime = e }\n get startTime () { return this.__startTime || 0 }\n set referrerPolicy (e) { this.Instance?.setAttribute('referrerpolicy', e) }\n get referrerPolicy () { return this.Instance?.getAttribute('referrerpolicy') || 'origin' }\n\n private setProperty (key: string, value: unknown) {\n if (this.Instance) {\n this.Instance[key] = value\n }\n }\n\n play = () => this.Instance?.play()\n\n pause = () => this.Instance?.pause()\n\n stop = () => {\n this.pause()\n this.seek(0)\n this.stopStack.trigger()\n }\n\n seek = (position: number) => {\n if (this.Instance) {\n this.Instance.currentTime = position\n }\n }\n\n /**\n * @TODO destroy得并不干净\n */\n destroy = () => {\n this.stop()\n if (this.Instance) {\n document.body.removeChild(this.Instance)\n this.Instance = undefined\n }\n }\n\n onCanplay = (callback = () => {}) => this.Instance?.addEventListener('canplay', callback)\n onPlay = (callback = () => {}) => this.Instance?.addEventListener('play', callback)\n onPause = (callback = () => {}) => this.Instance?.addEventListener('pause', callback)\n onStop = (callback = () => {}) => this.stopStack.add(callback)\n onEnded = (callback = () => {}) => this.Instance?.addEventListener('ended', callback)\n onTimeUpdate = (callback = () => {}) => this.Instance?.addEventListener('timeupdate', callback)\n onError = (callback?: ((res: Taro.InnerAudioContext.onErrorDetail) => void)) => this.errorStack.add(callback)\n onWaiting = (callback = () => {}) => this.Instance?.addEventListener('waiting', callback)\n onSeeking = (callback = () => {}) => this.Instance?.addEventListener('seeking', callback)\n onSeeked = (callback = () => {}) => this.Instance?.addEventListener('seeked', callback)\n offCanplay = (callback = () => {}) => this.Instance?.removeEventListener('canplay', callback)\n offPlay = (callback = () => {}) => this.Instance?.removeEventListener('play', callback)\n offPause = (callback = () => {}) => this.Instance?.removeEventListener('pause', callback)\n offStop = (callback = () => {}) => this.stopStack.remove(callback)\n offEnded = (callback = () => {}) => this.Instance?.removeEventListener('ended', callback)\n offTimeUpdate = (callback = () => {}) => this.Instance?.removeEventListener('timeupdate', callback)\n offError = (callback = () => {}) => this.errorStack.remove(callback)\n offWaiting = (callback = () => {}) => this.Instance?.removeEventListener('waiting', callback)\n offSeeking = (callback = () => {}) => this.Instance?.removeEventListener('seeking', callback)\n offSeeked = (callback = () => {}) => this.Instance?.removeEventListener('seeked', callback)\n}\n"],"names":[],"mappings":";;;;MAKa,iBAAiB,CAAA;AAM5B,IAAA,WAAA,GAAA;QAFA,IAAW,CAAA,WAAA,GAAG,CAAC,CAAA;AA0Cf,QAAA,IAAA,CAAA,IAAI,GAAG,MAAK,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAI,EAAE,CAAA,EAAA,CAAA;AAElC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAK,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAK,EAAE,CAAA,EAAA,CAAA;QAEpC,IAAI,CAAA,IAAA,GAAG,MAAK;YACV,IAAI,CAAC,KAAK,EAAE,CAAA;AACZ,YAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACZ,YAAA,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;AAC1B,SAAC,CAAA;AAED,QA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IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAY,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA,EAAE;AAC3E,IAAA,IAAI,cAAc,GAAM,EAAA,IAAA,EAAA,CAAA,CAAA,OAAO,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAY,CAAC,gBAAgB,CAAC,KAAI,QAAQ,CAAA,EAAE;IAElF,WAAW,CAAE,GAAW,EAAE,KAAc,EAAA;QAC9C,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAC3B,SAAA;KACF;AAiDF;;;;"}
|
|
1
|
+
{"version":3,"file":"InnerAudioContext.js","sources":["../../../../src/api/media/audio/InnerAudioContext.ts"],"sourcesContent":["import Taro from '@tarojs/api'\n\nimport { permanentlyNotSupport } from '../../../utils'\nimport { CallbackManager } from '../../../utils/handler'\n\nexport class InnerAudioContext implements Taro.InnerAudioContext {\n Instance?: HTMLAudioElement\n errorStack: CallbackManager\n stopStack: CallbackManager\n __startTime = 0\n __isFirstPlay = true\n\n constructor () {\n this.Instance = new Audio()\n this.errorStack = new CallbackManager()\n this.stopStack = new CallbackManager()\n\n Taro.eventCenter.on('__taroRouterChange', () => { this.stop() })\n this.onPlay(() => {\n if (this.__isFirstPlay) {\n this.__isFirstPlay = false\n this.seek(this.startTime)\n }\n })\n }\n\n set autoplay (e) { this.setProperty('autoplay', e) }\n get autoplay () { return this.Instance?.autoplay || false }\n get buffered () { return this.Instance?.buffered.length || 0 }\n get currentTime () { return this.Instance?.currentTime || 0 }\n set currentTime (e) { this.seek(e) }\n get duration () { return this.Instance?.duration || 0 }\n set loop (e) { this.setProperty('loop', e) }\n get loop () { return this.Instance?.loop || false }\n get paused () { return this.Instance?.paused ?? true }\n set src (e) { this.setProperty('src', e) }\n get src () { return this.Instance?.src || '' }\n set volume (e) { this.setProperty('volume', e) }\n get volume () { return this.Instance?.volume || 0 }\n set playbackRate (e) { this.setProperty('playbackRate', e) }\n get playbackRate () { return this.Instance?.playbackRate || 0 }\n set obeyMuteSwitch (_e) { permanentlyNotSupport('InnerAudioContext.obeyMuteSwitch')() }\n get obeyMuteSwitch () { return true }\n set startTime (e) { this.__startTime = e }\n get startTime () { return this.__startTime || 0 }\n set referrerPolicy (e) { this.Instance?.setAttribute('referrerpolicy', e) }\n get referrerPolicy () { return this.Instance?.getAttribute('referrerpolicy') || 'origin' }\n\n private setProperty (key: string, value: unknown) {\n if (this.Instance) {\n this.Instance[key] = value\n }\n }\n\n play = () => this.Instance?.play()\n\n pause = () => this.Instance?.pause()\n\n stop = () => {\n this.pause()\n this.seek(0)\n this.stopStack.trigger()\n }\n\n seek = (position: number) => {\n if (this.Instance) {\n this.Instance.currentTime = position\n }\n }\n\n /**\n * @TODO destroy得并不干净\n */\n destroy = () => {\n this.stop()\n if (this.Instance) {\n document.body.removeChild(this.Instance)\n this.Instance = undefined\n }\n }\n\n onCanplay = (callback = () => {}) => this.Instance?.addEventListener('canplay', callback)\n onPlay = (callback = () => {}) => this.Instance?.addEventListener('play', callback)\n onPause = (callback = () => {}) => this.Instance?.addEventListener('pause', callback)\n onStop = (callback = () => {}) => this.stopStack.add(callback)\n onEnded = (callback = () => {}) => this.Instance?.addEventListener('ended', callback)\n onTimeUpdate = (callback = () => {}) => this.Instance?.addEventListener('timeupdate', callback)\n onError = (callback?: ((res: Taro.InnerAudioContext.onErrorDetail) => void)) => this.errorStack.add(callback)\n onWaiting = (callback = () => {}) => this.Instance?.addEventListener('waiting', callback)\n onSeeking = (callback = () => {}) => this.Instance?.addEventListener('seeking', callback)\n onSeeked = (callback = () => {}) => this.Instance?.addEventListener('seeked', callback)\n offCanplay = (callback = () => {}) => this.Instance?.removeEventListener('canplay', callback)\n offPlay = (callback = () => {}) => this.Instance?.removeEventListener('play', callback)\n offPause = (callback = () => {}) => this.Instance?.removeEventListener('pause', callback)\n offStop = (callback = () => {}) => this.stopStack.remove(callback)\n offEnded = (callback = () => {}) => this.Instance?.removeEventListener('ended', callback)\n offTimeUpdate = (callback = () => {}) => this.Instance?.removeEventListener('timeupdate', callback)\n offError = (callback = () => {}) => this.errorStack.remove(callback)\n offWaiting = (callback = () => {}) => this.Instance?.removeEventListener('waiting', callback)\n offSeeking = (callback = () => {}) => this.Instance?.removeEventListener('seeking', callback)\n offSeeked = (callback = () => {}) => this.Instance?.removeEventListener('seeked', callback)\n}\n"],"names":[],"mappings":";;;;MAKa,iBAAiB,CAAA;AAO5B,IAAA,WAAA,GAAA;QAHA,IAAW,CAAA,WAAA,GAAG,CAAC,CAAA;QACf,IAAa,CAAA,aAAA,GAAG,IAAI,CAAA;AA4CpB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAK,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAI,EAAE,CAAA,EAAA,CAAA;AAElC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAK,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAK,EAAE,CAAA,EAAA,CAAA;QAEpC,IAAI,CAAA,IAAA,GAAG,MAAK;YACV,IAAI,CAAC,KAAK,EAAE,CAAA;AACZ,YAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACZ,YAAA,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;AAC1B,SAAC,CAAA;AAED,QAAA,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IAAI,CAAC,CAAA,EAAE;AACjD,IAAA,IAAI,cAAc,CAAE,CAAC,EAAI,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAY,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA,EAAE;AAC3E,IAAA,IAAI,cAAc,GAAM,EAAA,IAAA,EAAA,CAAA,CAAA,OAAO,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAY,CAAC,gBAAgB,CAAC,KAAI,QAAQ,CAAA,EAAE;IAElF,WAAW,CAAE,GAAW,EAAE,KAAc,EAAA;QAC9C,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAC3B,SAAA;KACF;AAiDF;;;;"}
|
|
@@ -2,7 +2,9 @@ declare const saveImageToPhotosAlbum: (option?: {}, ...args: any[]) => Promise<P
|
|
|
2
2
|
declare const previewMedia: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
3
3
|
declare const compressImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
4
4
|
declare const chooseMessageFile: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
5
|
-
|
|
5
|
+
declare const editImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
6
|
+
declare const cropImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
7
|
+
export { saveImageToPhotosAlbum, previewMedia, compressImage, chooseMessageFile, editImage, cropImage };
|
|
6
8
|
export * from "./getImageInfo.js";
|
|
7
9
|
export * from "./previewImage.js";
|
|
8
10
|
export * from "./chooseImage.js";
|
|
@@ -8,6 +8,8 @@ const saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum');
|
|
|
8
8
|
const previewMedia = temporarilyNotSupport('previewMedia');
|
|
9
9
|
const compressImage = temporarilyNotSupport('compressImage');
|
|
10
10
|
const chooseMessageFile = temporarilyNotSupport('chooseMessageFile');
|
|
11
|
+
const editImage = temporarilyNotSupport('editImage');
|
|
12
|
+
const cropImage = temporarilyNotSupport('cropImage');
|
|
11
13
|
|
|
12
|
-
export { chooseMessageFile, compressImage, previewMedia, saveImageToPhotosAlbum };
|
|
14
|
+
export { chooseMessageFile, compressImage, cropImage, editImage, previewMedia, saveImageToPhotosAlbum };
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/api/media/image/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../../utils'\r\n\r\n// 图片\r\nexport const saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum')\r\nexport const previewMedia = temporarilyNotSupport('previewMedia')\r\n\r\nexport * from './getImageInfo'\r\nexport * from './previewImage'\r\n\r\nexport const compressImage = temporarilyNotSupport('compressImage')\r\nexport const chooseMessageFile = temporarilyNotSupport('chooseMessageFile')\r\n\r\nexport * from './chooseImage'\r\n"],"names":[],"mappings":";;;;;AAEA;MACa,sBAAsB,GAAG,qBAAqB,CAAC,wBAAwB,EAAC;MACxE,YAAY,GAAG,qBAAqB,CAAC,cAAc,EAAC;MAKpD,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;MACtD,iBAAiB,GAAG,qBAAqB,CAAC,mBAAmB;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/api/media/image/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../../utils'\r\n\r\n// 图片\r\nexport const saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum')\r\nexport const previewMedia = temporarilyNotSupport('previewMedia')\r\n\r\nexport * from './getImageInfo'\r\nexport * from './previewImage'\r\n\r\nexport const compressImage = temporarilyNotSupport('compressImage')\r\nexport const chooseMessageFile = temporarilyNotSupport('chooseMessageFile')\r\n\r\nexport * from './chooseImage'\r\n\r\nexport const editImage = temporarilyNotSupport('editImage')\r\nexport const cropImage = temporarilyNotSupport('cropImage')\r\n"],"names":[],"mappings":";;;;;AAEA;MACa,sBAAsB,GAAG,qBAAqB,CAAC,wBAAwB,EAAC;MACxE,YAAY,GAAG,qBAAqB,CAAC,cAAc,EAAC;MAKpD,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;MACtD,iBAAiB,GAAG,qBAAqB,CAAC,mBAAmB,EAAC;MAI9D,SAAS,GAAG,qBAAqB,CAAC,WAAW,EAAC;MAC9C,SAAS,GAAG,qBAAqB,CAAC,WAAW;;;;"}
|
package/dist/api/media/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createAudioContext, createInnerAudioContext, createMediaAudioPlayer, createWebAudioContext, getAvailableAudioSources, pauseVoice, playVoice, setInnerAudioOption, stopVoice } from './audio/index.js';
|
|
2
2
|
export { getBackgroundAudioManager, getBackgroundAudioPlayerState, onBackgroundAudioPause, onBackgroundAudioPlay, onBackgroundAudioStop, pauseBackgroundAudio, playBackgroundAudio, seekBackgroundAudio, stopBackgroundAudio } from './background-audio/index.js';
|
|
3
3
|
export { createCameraContext } from './camera.js';
|
|
4
|
-
export { chooseMessageFile, compressImage, previewMedia, saveImageToPhotosAlbum } from './image/index.js';
|
|
4
|
+
export { chooseMessageFile, compressImage, cropImage, editImage, previewMedia, saveImageToPhotosAlbum } from './image/index.js';
|
|
5
5
|
export { createLivePlayerContext, createLivePusherContext } from './live.js';
|
|
6
6
|
export { createMapContext } from './map.js';
|
|
7
7
|
export { createMediaRecorder } from './media-recorder.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Taro from '@tarojs/api';
|
|
2
|
-
declare const request:
|
|
2
|
+
declare const request: typeof Taro.request;
|
|
3
3
|
declare const addInterceptor: any;
|
|
4
4
|
declare const cleanInterceptors: any;
|
|
5
5
|
export { request, addInterceptor, cleanInterceptors };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __rest } from '../../../node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import 'whatwg-fetch';
|
|
3
2
|
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
|
|
4
3
|
import Taro from '@tarojs/api';
|
|
@@ -8,7 +7,7 @@ import { serializeParams } from '../../../utils/index.js';
|
|
|
8
7
|
|
|
9
8
|
// @ts-ignore
|
|
10
9
|
const { Link } = Taro;
|
|
11
|
-
function generateRequestUrlWithParams(url
|
|
10
|
+
function generateRequestUrlWithParams(url, params) {
|
|
12
11
|
params = typeof params === 'string' ? params : serializeParams(params);
|
|
13
12
|
if (params) {
|
|
14
13
|
url += (~url.indexOf('?') ? '&' : '?') + params;
|
|
@@ -16,21 +15,26 @@ function generateRequestUrlWithParams(url = '', params) {
|
|
|
16
15
|
url = url.replace('?&', '?');
|
|
17
16
|
return url;
|
|
18
17
|
}
|
|
19
|
-
|
|
18
|
+
// FIXME 移除 any 标注
|
|
19
|
+
function _request(options) {
|
|
20
|
+
options = options || {};
|
|
21
|
+
if (typeof options === 'string') {
|
|
22
|
+
options = {
|
|
23
|
+
url: options
|
|
24
|
+
};
|
|
25
|
+
}
|
|
20
26
|
const { success, complete, fail } = options;
|
|
21
|
-
let url = options.url
|
|
27
|
+
let url = options.url;
|
|
22
28
|
const params = {};
|
|
23
29
|
const res = {};
|
|
24
30
|
if (options.jsonp) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (typeof jsonp === 'string') {
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
params.name = jsonp;
|
|
31
|
+
Object.assign(params, options);
|
|
32
|
+
params.params = options.data;
|
|
33
|
+
params.cache = options.jsonpCache;
|
|
34
|
+
if (typeof options.jsonp === 'string') {
|
|
35
|
+
params.name = options.jsonp;
|
|
33
36
|
}
|
|
37
|
+
delete params.jsonp;
|
|
34
38
|
return jsonpRetry(url, params)
|
|
35
39
|
.then(data => {
|
|
36
40
|
res.statusCode = 200;
|
|
@@ -51,7 +55,7 @@ function _request(options = {}) {
|
|
|
51
55
|
if (methodUpper === 'GET' || methodUpper === 'HEAD') {
|
|
52
56
|
url = generateRequestUrlWithParams(url, options.data);
|
|
53
57
|
}
|
|
54
|
-
else if (Object.prototype.toString.call(options.data)
|
|
58
|
+
else if (['[object Array]', '[object Object]'].indexOf(Object.prototype.toString.call(options.data)) >= 0) {
|
|
55
59
|
options.header = options.header || {};
|
|
56
60
|
const keyOfContentType = Object.keys(options.header).find(item => item.toLowerCase() === 'content-type');
|
|
57
61
|
if (!keyOfContentType) {
|
|
@@ -141,16 +145,7 @@ function taroInterceptor(chain) {
|
|
|
141
145
|
return _request(chain.requestParams);
|
|
142
146
|
}
|
|
143
147
|
const link = new Link(taroInterceptor);
|
|
144
|
-
const request = (
|
|
145
|
-
const [url = '', options = {}] = args;
|
|
146
|
-
if (typeof url === 'string') {
|
|
147
|
-
options.url = url;
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
Object.assign(options, url);
|
|
151
|
-
}
|
|
152
|
-
return link.request(options);
|
|
153
|
-
});
|
|
148
|
+
const request = link.request.bind(link);
|
|
154
149
|
const addInterceptor = link.addInterceptor.bind(link);
|
|
155
150
|
const cleanInterceptors = link.cleanInterceptors.bind(link);
|
|
156
151
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/api/network/request/index.ts"],"sourcesContent":["import 'whatwg-fetch'\nimport 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'\n\nimport Taro from '@tarojs/api'\nimport { isFunction } from '@tarojs/shared'\nimport jsonpRetry from 'jsonp-retry'\n\nimport { serializeParams } from '../../../utils'\n\n// @ts-ignore\nconst { Link } = Taro\n\nfunction generateRequestUrlWithParams (url = '', params?: unknown) {\n params = typeof params === 'string' ? params : serializeParams(params)\n if (params) {\n url += (~url.indexOf('?') ? '&' : '?') + params\n }\n url = url.replace('?&', '?')\n return url\n}\n\nfunction _request (options: Partial<Taro.request.Option> = {}) {\n const { success, complete, fail } = options\n let url = options.url || ''\n const params: RequestInit = {}\n const res: any = {}\n if (options.jsonp) {\n const { jsonp, ...opts } = options\n Object.assign(params, opts)\n // @ts-ignore\n params.params = opts.data\n params.cache = opts.jsonpCache\n if (typeof jsonp === 'string') {\n // @ts-ignore\n params.name = jsonp\n }\n return jsonpRetry(url, params)\n .then(data => {\n res.statusCode = 200\n res.data = data\n isFunction(success) && success(res)\n isFunction(complete) && complete(res)\n return res\n })\n .catch(err => {\n isFunction(fail) && fail(err)\n isFunction(complete) && complete(res)\n return Promise.reject(err)\n })\n }\n params.method = options.method || 'GET'\n const methodUpper = params.method.toUpperCase()\n params.cache = options.cache || 'default'\n if (methodUpper === 'GET' || methodUpper === 'HEAD') {\n url = generateRequestUrlWithParams(url, options.data)\n } else if (Object.prototype.toString.call(options.data) === '[object Object]') {\n options.header = options.header || {}\n\n const keyOfContentType = Object.keys(options.header).find(item => item.toLowerCase() === 'content-type')\n if (!keyOfContentType) {\n options.header['Content-Type'] = 'application/json'\n }\n const contentType = options.header[keyOfContentType || 'Content-Type']\n\n if (contentType.indexOf('application/json') >= 0) {\n params.body = JSON.stringify(options.data)\n } else if (contentType.indexOf('application/x-www-form-urlencoded') >= 0) {\n params.body = serializeParams(options.data)\n } else {\n params.body = options.data\n }\n } else {\n params.body = options.data\n }\n if (options.header) {\n params.headers = options.header\n }\n if (options.mode) {\n params.mode = options.mode\n }\n let timeoutTimer: ReturnType<typeof setTimeout> | null = null\n if (options.signal) {\n params.signal = options.signal\n } else if (typeof options.timeout === 'number') {\n const controller = new window.AbortController()\n params.signal = controller.signal\n timeoutTimer = setTimeout(function () {\n controller.abort()\n }, options.timeout)\n }\n params.credentials = options.credentials\n return fetch(url, params)\n .then(response => {\n if (timeoutTimer) {\n clearTimeout(timeoutTimer)\n timeoutTimer = null\n }\n if (!response) {\n const errorResponse = { ok: false }\n throw errorResponse\n }\n res.statusCode = response.status\n res.header = {}\n for (const key of response.headers.keys()) {\n res.header[key] = response.headers.get(key)\n }\n if (options.responseType === 'arraybuffer') {\n return response.arrayBuffer()\n }\n if (res.statusCode !== 204) {\n if (options.dataType === 'json' || typeof options.dataType === 'undefined') {\n return response.json().catch(() => {\n return null\n })\n }\n }\n if (options.responseType === 'text' || options.dataType === 'text') {\n return response.text()\n }\n return Promise.resolve(null)\n })\n .then(data => {\n res.data = data\n isFunction(success) && success(res)\n isFunction(complete) && complete(res)\n return res\n })\n .catch(err => {\n if (timeoutTimer) {\n clearTimeout(timeoutTimer)\n timeoutTimer = null\n }\n isFunction(fail) && fail(err)\n isFunction(complete) && complete(res)\n err.statusCode = res.statusCode\n err.errMsg = err.message\n return Promise.reject(err)\n })\n}\n\nfunction taroInterceptor (chain) {\n return _request(chain.requestParams)\n}\n\nconst link = new Link(taroInterceptor)\n\nexport const request = (<T extends Partial<Taro.request.Option> = TaroGeneral.IAnyObject>(...args: [string | T, T]) => {\n const [url = '', options = {} as T] = args\n if (typeof url === 'string') {\n options.url = url\n } else {\n Object.assign(options, url)\n }\n return link.request(options)\n}) as typeof Taro.request\nexport const addInterceptor = link.addInterceptor.bind(link)\nexport const cleanInterceptors = link.cleanInterceptors.bind(link)\n"],"names":[],"mappings":";;;;;;;;AASA;AACA,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;AAErB,S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,GAAG,EAAO,CAAC,GAAG,IAAI,CAAA;AAC1C,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;AAClB,KAAA;AAAM,SAAA;AACL,QAAA,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC5B,KAAA;AACD,IAAA,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC,EAAwB;AAClB,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAC;AACrD,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/api/network/request/index.ts"],"sourcesContent":["import 'whatwg-fetch'\nimport 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'\n\nimport Taro from '@tarojs/api'\nimport { isFunction } from '@tarojs/shared'\nimport jsonpRetry from 'jsonp-retry'\n\nimport { serializeParams } from '../../../utils'\n\n// @ts-ignore\nconst { Link } = Taro\n\nfunction generateRequestUrlWithParams (url: string, params?: unknown) {\n params = typeof params === 'string' ? params : serializeParams(params)\n if (params) {\n url += (~url.indexOf('?') ? '&' : '?') + params\n }\n url = url.replace('?&', '?')\n return url\n}\n\n// FIXME 移除 any 标注\nfunction _request (options) {\n options = options || {}\n if (typeof options === 'string') {\n options = {\n url: options\n }\n }\n const { success, complete, fail } = options\n let url = options.url\n const params: any = {}\n const res: any = {}\n if (options.jsonp) {\n Object.assign(params, options)\n params.params = options.data\n params.cache = options.jsonpCache\n if (typeof options.jsonp === 'string') {\n params.name = options.jsonp\n }\n delete params.jsonp\n return jsonpRetry(url, params)\n .then(data => {\n res.statusCode = 200\n res.data = data\n isFunction(success) && success(res)\n isFunction(complete) && complete(res)\n return res\n })\n .catch(err => {\n isFunction(fail) && fail(err)\n isFunction(complete) && complete(res)\n return Promise.reject(err)\n })\n }\n params.method = options.method || 'GET'\n const methodUpper = params.method.toUpperCase()\n params.cache = options.cache || 'default'\n if (methodUpper === 'GET' || methodUpper === 'HEAD') {\n url = generateRequestUrlWithParams(url, options.data)\n } else if (['[object Array]', '[object Object]'].indexOf(Object.prototype.toString.call(options.data)) >= 0) {\n options.header = options.header || {}\n\n const keyOfContentType = Object.keys(options.header).find(item => item.toLowerCase() === 'content-type')\n if (!keyOfContentType) {\n options.header['Content-Type'] = 'application/json'\n }\n const contentType = options.header[keyOfContentType || 'Content-Type']\n\n if (contentType.indexOf('application/json') >= 0) {\n params.body = JSON.stringify(options.data)\n } else if (contentType.indexOf('application/x-www-form-urlencoded') >= 0) {\n params.body = serializeParams(options.data)\n } else {\n params.body = options.data\n }\n } else {\n params.body = options.data\n }\n if (options.header) {\n params.headers = options.header\n }\n if (options.mode) {\n params.mode = options.mode\n }\n let timeoutTimer: ReturnType<typeof setTimeout> | null = null\n if (options.signal) {\n params.signal = options.signal\n } else if (typeof options.timeout === 'number') {\n const controller = new window.AbortController()\n params.signal = controller.signal\n timeoutTimer = setTimeout(function () {\n controller.abort()\n }, options.timeout)\n }\n params.credentials = options.credentials\n return fetch(url, params)\n .then(response => {\n if (timeoutTimer) {\n clearTimeout(timeoutTimer)\n timeoutTimer = null\n }\n if (!response) {\n const errorResponse = { ok: false }\n throw errorResponse\n }\n res.statusCode = response.status\n res.header = {}\n for (const key of response.headers.keys()) {\n res.header[key] = response.headers.get(key)\n }\n if (options.responseType === 'arraybuffer') {\n return response.arrayBuffer()\n }\n if (res.statusCode !== 204) {\n if (options.dataType === 'json' || typeof options.dataType === 'undefined') {\n return response.json().catch(() => {\n return null\n })\n }\n }\n if (options.responseType === 'text' || options.dataType === 'text') {\n return response.text()\n }\n return Promise.resolve(null)\n })\n .then(data => {\n res.data = data\n isFunction(success) && success(res)\n isFunction(complete) && complete(res)\n return res\n })\n .catch(err => {\n if (timeoutTimer) {\n clearTimeout(timeoutTimer)\n timeoutTimer = null\n }\n isFunction(fail) && fail(err)\n isFunction(complete) && complete(res)\n err.statusCode = res.statusCode\n err.errMsg = err.message\n return Promise.reject(err)\n })\n}\n\nfunction taroInterceptor (chain) {\n return _request(chain.requestParams)\n}\n\nconst link = new Link(taroInterceptor)\n\nexport const request: typeof Taro.request = link.request.bind(link)\nexport const addInterceptor = link.addInterceptor.bind(link)\nexport const cleanInterceptors = link.cleanInterceptors.bind(link)\n"],"names":[],"mappings":";;;;;;;AASA;AACA,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;AAErB,SAAS,4BAA4B,CAAE,GAAW,EAAE,MAAgB,EAAA;AAClE,IAAA,MAAM,GAAG,OAAO,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;AACtE,IAAA,IAAI,MAAM,EAAE;QACV,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,MAAM,CAAA;AAChD,KAAA;IACD,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AAC5B,IAAA,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;AACA,SAAS,QAAQ,CAAE,OAAO,EAAA;AACxB,IAAA,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;AACvB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,OAAO,GAAG;AACR,YAAA,GAAG,EAAE,OAAO;SACb,CAAA;AACF,KAAA;IACD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;AAC3C,IAAA,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;IACrB,MAAM,MAAM,GAAQ,EAAE,CAAA;IACtB,MAAM,GAAG,GAAQ,EAAE,CAAA;IACnB,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,Q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,CAAC,CAAA;AACrC,QAAA,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAA;AAC/B,QAAA,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,OAAO,CAAA;AACxB,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAC5B,KAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAS,eAAe,CAAE,KAAK,EAAA;AAC7B,IAAA,OAAO,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;AACtC,CAAC;AAED,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,eAAe,CAAC,CAAA;AAE/B,MAAM,OAAO,GAAwB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAC;AAC5D,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAC;AACrD,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI;;;;"}
|
|
@@ -13,7 +13,7 @@ export { checkSession, login, pluginLogin } from './login.js';
|
|
|
13
13
|
export { showRedPackage } from './red-package.js';
|
|
14
14
|
export { getSetting, openSetting } from './settings.js';
|
|
15
15
|
export { checkIsSoterEnrolledInDevice, checkIsSupportSoterAuthentication, startSoterAuthentication } from './soter.js';
|
|
16
|
-
export { requestSubscribeMessage } from './subscribe-message.js';
|
|
16
|
+
export { requestSubscribeDeviceMessage, requestSubscribeMessage } from './subscribe-message.js';
|
|
17
17
|
export { getUserInfo, getUserProfile } from './user-info.js';
|
|
18
18
|
export { getWeRunData, shareToWeRun } from './werun.js';
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
declare const requestSubscribeMessage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
2
|
-
|
|
2
|
+
declare const requestSubscribeDeviceMessage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
3
|
+
export { requestSubscribeMessage, requestSubscribeDeviceMessage };
|
|
@@ -2,6 +2,8 @@ import { temporarilyNotSupport } from '../../utils/index.js';
|
|
|
2
2
|
|
|
3
3
|
// 订阅消息
|
|
4
4
|
const requestSubscribeMessage = temporarilyNotSupport('requestSubscribeMessage');
|
|
5
|
+
// 订阅设备消息
|
|
6
|
+
const requestSubscribeDeviceMessage = temporarilyNotSupport('requestSubscribeDeviceMessage');
|
|
5
7
|
|
|
6
|
-
export { requestSubscribeMessage };
|
|
8
|
+
export { requestSubscribeDeviceMessage, requestSubscribeMessage };
|
|
7
9
|
//# sourceMappingURL=subscribe-message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe-message.js","sources":["../../../src/api/open-api/subscribe-message.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 订阅消息\nexport const requestSubscribeMessage = temporarilyNotSupport('requestSubscribeMessage')\n"],"names":[],"mappings":";;AAEA;MACa,uBAAuB,GAAG,qBAAqB,CAAC,yBAAyB;;;;"}
|
|
1
|
+
{"version":3,"file":"subscribe-message.js","sources":["../../../src/api/open-api/subscribe-message.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 订阅消息\nexport const requestSubscribeMessage = temporarilyNotSupport('requestSubscribeMessage')\n// 订阅设备消息\nexport const requestSubscribeDeviceMessage = temporarilyNotSupport('requestSubscribeDeviceMessage')\n"],"names":[],"mappings":";;AAEA;MACa,uBAAuB,GAAG,qBAAqB,CAAC,yBAAyB,EAAC;AACvF;MACa,6BAA6B,GAAG,qBAAqB,CAAC,+BAA+B;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/api/qq/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 打开手Q说说发表界面\nexport const openQzonePublish = temporarilyNotSupport('openQzonePublish')\n"],"names":[],"mappings":";;AAEA;MACa,gBAAgB,GAAG,qBAAqB,CAAC,kBAAkB;;;;"}
|
package/dist/api/ui/index.js
CHANGED
|
@@ -9,5 +9,5 @@ export { startPullDownRefresh, stopPullDownRefresh } from './pull-down-refresh.j
|
|
|
9
9
|
export { pageScrollTo } from './scroll/index.js';
|
|
10
10
|
export { setTopBarText } from './sticky.js';
|
|
11
11
|
export { hideTabBar, hideTabBarRedDot, initTabBarApis, removeTabBarBadge, setTabBarBadge, setTabBarItem, setTabBarStyle, showTabBar, showTabBarRedDot } from './tab-bar.js';
|
|
12
|
-
export { offWindowResize, onWindowResize, setWindowSize } from './window.js';
|
|
12
|
+
export { checkIsPictureInPictureActive, offWindowResize, onWindowResize, setWindowSize } from './window.js';
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/dist/api/ui/window.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ declare const onWindowResize: typeof Taro.onWindowResize;
|
|
|
11
11
|
* 取消监听窗口尺寸变化事件
|
|
12
12
|
*/
|
|
13
13
|
declare const offWindowResize: typeof Taro.offWindowResize;
|
|
14
|
-
|
|
14
|
+
declare const checkIsPictureInPictureActive: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
15
|
+
export { setWindowSize, onWindowResize, offWindowResize, checkIsPictureInPictureActive };
|
package/dist/api/ui/window.js
CHANGED
|
@@ -30,6 +30,7 @@ const offWindowResize = callback => {
|
|
|
30
30
|
window.removeEventListener('resize', resizeListener);
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
+
const checkIsPictureInPictureActive = temporarilyNotSupport('checkIsPictureInPictureActive');
|
|
33
34
|
|
|
34
|
-
export { offWindowResize, onWindowResize, setWindowSize };
|
|
35
|
+
export { checkIsPictureInPictureActive, offWindowResize, onWindowResize, setWindowSize };
|
|
35
36
|
//# sourceMappingURL=window.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window.js","sources":["../../../src/api/ui/window.ts"],"sourcesContent":["import Taro from '@tarojs/api'\r\n\r\nimport { temporarilyNotSupport } from '../../utils'\r\nimport { CallbackManager } from '../../utils/handler'\r\n\r\nconst callbackManager = new CallbackManager()\r\n\r\nconst resizeListener = () => {\r\n callbackManager.trigger({\r\n windowWidth: window.screen.width,\r\n windowHeight: window.screen.height\r\n })\r\n}\r\n\r\n/**\r\n * 设置窗口大小,该接口仅适用于 PC 平台,使用细则请参见指南\r\n */\r\nexport const setWindowSize = temporarilyNotSupport('setWindowSize')\r\n\r\n/**\r\n * 监听窗口尺寸变化事件\r\n */\r\nexport const onWindowResize: typeof Taro.onWindowResize = callback => {\r\n callbackManager.add(callback)\r\n if (callbackManager.count() === 1) {\r\n window.addEventListener('resize', resizeListener)\r\n }\r\n}\r\n\r\n/**\r\n * 取消监听窗口尺寸变化事件\r\n */\r\nexport const offWindowResize: typeof Taro.offWindowResize = callback => {\r\n callbackManager.remove(callback)\r\n if (callbackManager.count() === 0) {\r\n window.removeEventListener('resize', resizeListener)\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAKA,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA;AAE7C,MAAM,cAAc,GAAG,MAAK;IAC1B,eAAe,CAAC,OAAO,CAAC;AACtB,QAAA,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;AAChC,QAAA,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;AACnC,KAAA,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;AAEG;MACU,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;AAEnE;;AAEG;AACU,MAAA,cAAc,GAA+B,QAAQ,IAAG;AACnE,IAAA,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC7B,IAAA,IAAI,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACjC,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AAClD,KAAA;AACH,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAgC,QAAQ,IAAG;AACrE,IAAA,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AAChC,IAAA,IAAI,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACjC,QAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AACrD,KAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"window.js","sources":["../../../src/api/ui/window.ts"],"sourcesContent":["import Taro from '@tarojs/api'\r\n\r\nimport { temporarilyNotSupport } from '../../utils'\r\nimport { CallbackManager } from '../../utils/handler'\r\n\r\nconst callbackManager = new CallbackManager()\r\n\r\nconst resizeListener = () => {\r\n callbackManager.trigger({\r\n windowWidth: window.screen.width,\r\n windowHeight: window.screen.height\r\n })\r\n}\r\n\r\n/**\r\n * 设置窗口大小,该接口仅适用于 PC 平台,使用细则请参见指南\r\n */\r\nexport const setWindowSize = temporarilyNotSupport('setWindowSize')\r\n\r\n/**\r\n * 监听窗口尺寸变化事件\r\n */\r\nexport const onWindowResize: typeof Taro.onWindowResize = callback => {\r\n callbackManager.add(callback)\r\n if (callbackManager.count() === 1) {\r\n window.addEventListener('resize', resizeListener)\r\n }\r\n}\r\n\r\n/**\r\n * 取消监听窗口尺寸变化事件\r\n */\r\nexport const offWindowResize: typeof Taro.offWindowResize = callback => {\r\n callbackManager.remove(callback)\r\n if (callbackManager.count() === 0) {\r\n window.removeEventListener('resize', resizeListener)\r\n }\r\n}\r\n\r\nexport const checkIsPictureInPictureActive = temporarilyNotSupport('checkIsPictureInPictureActive')\r\n"],"names":[],"mappings":";;;AAKA,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA;AAE7C,MAAM,cAAc,GAAG,MAAK;IAC1B,eAAe,CAAC,OAAO,CAAC;AACtB,QAAA,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;AAChC,QAAA,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;AACnC,KAAA,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;AAEG;MACU,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;AAEnE;;AAEG;AACU,MAAA,cAAc,GAA+B,QAAQ,IAAG;AACnE,IAAA,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC7B,IAAA,IAAI,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACjC,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AAClD,KAAA;AACH,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAgC,QAAQ,IAAG;AACrE,IAAA,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AAChC,IAAA,IAAI,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACjC,QAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AACrD,KAAA;AACH,EAAC;MAEY,6BAA6B,GAAG,qBAAqB,CAAC,+BAA+B;;;;"}
|
package/dist/index.cjs.d.ts
CHANGED
|
@@ -37,8 +37,7 @@ declare const env: {
|
|
|
37
37
|
TARO_PLATFORM: string | undefined;
|
|
38
38
|
TARO_VERSION: string | undefined;
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
// export const canIUse = temporarilyNotSupport('canIUse')
|
|
40
|
+
declare const canIUse: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
42
41
|
declare function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
|
|
43
42
|
declare function base64ToArrayBuffer(base64: string): Uint8Array;
|
|
44
43
|
// 加密
|
|
@@ -310,6 +309,7 @@ declare const setWifiList: (option?: {}, ...args: any[]) => Promise<Partial<Taro
|
|
|
310
309
|
declare const onWifiConnectedWithPartialInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
311
310
|
declare const onWifiConnected: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
312
311
|
declare const onGetWifiList: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
312
|
+
declare const offWifiConnectedWithPartialInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
313
313
|
declare const offWifiConnected: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
314
314
|
declare const offGetWifiList: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
315
315
|
declare const getWifiList: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
@@ -475,6 +475,8 @@ declare const chooseMessageFile: (option?: {}, ...args: any[]) => Promise<Partia
|
|
|
475
475
|
* 从本地相册选择图片或使用相机拍照。
|
|
476
476
|
*/
|
|
477
477
|
declare const chooseImage: typeof Taro.chooseImage;
|
|
478
|
+
declare const editImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
479
|
+
declare const cropImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
478
480
|
// 实时音视频
|
|
479
481
|
declare const createLivePusherContext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
480
482
|
declare const createLivePlayerContext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
@@ -541,7 +543,7 @@ declare const offLocalServiceResolveFail: (option?: {}, ...args: any[]) => Promi
|
|
|
541
543
|
declare const offLocalServiceLost: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
542
544
|
declare const offLocalServiceFound: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
543
545
|
declare const offLocalServiceDiscoveryStop: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
544
|
-
declare const request:
|
|
546
|
+
declare const request: typeof Taro.request;
|
|
545
547
|
declare const addInterceptor: any;
|
|
546
548
|
declare const cleanInterceptors: any;
|
|
547
549
|
// TCP 通信
|
|
@@ -609,6 +611,8 @@ declare const checkIsSupportSoterAuthentication: (option?: {}, ...args: any[]) =
|
|
|
609
611
|
declare const checkIsSoterEnrolledInDevice: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
610
612
|
// 订阅消息
|
|
611
613
|
declare const requestSubscribeMessage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
614
|
+
// 订阅设备消息
|
|
615
|
+
declare const requestSubscribeDeviceMessage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
612
616
|
// 用户信息
|
|
613
617
|
declare const getUserProfile: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
614
618
|
declare const getUserInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
@@ -618,6 +622,8 @@ declare const getWeRunData: (option?: {}, ...args: any[]) => Promise<Partial<Tar
|
|
|
618
622
|
// 支付
|
|
619
623
|
declare const requestPayment: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
620
624
|
declare const requestOrderPayment: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
625
|
+
// 打开手Q说说发表界面
|
|
626
|
+
declare const openQzonePublish: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
621
627
|
// 转发
|
|
622
628
|
declare const updateShareMenu: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
623
629
|
declare const showShareMenu: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
@@ -759,10 +765,11 @@ declare const onWindowResize: typeof Taro.onWindowResize;
|
|
|
759
765
|
* 取消监听窗口尺寸变化事件
|
|
760
766
|
*/
|
|
761
767
|
declare const offWindowResize: typeof Taro.offWindowResize;
|
|
768
|
+
declare const checkIsPictureInPictureActive: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
762
769
|
// Worker
|
|
763
770
|
declare const createWorker: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
764
771
|
declare const createSelectorQuery: typeof Taro.createSelectorQuery;
|
|
765
772
|
declare const createIntersectionObserver: typeof Taro.createIntersectionObserver;
|
|
766
773
|
declare const createMediaQueryObserver: typeof Taro.createMediaQueryObserver;
|
|
767
|
-
export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, isVKSupport, createVKSession, getOpenUserInfo, env, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseVideo, chooseMedia, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, checkIsAddedToMyMiniProgram, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestOrderPayment, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
|
|
774
|
+
export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, isVKSupport, createVKSession, getOpenUserInfo, env, canIUse, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnectedWithPartialInfo, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, editImage, cropImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseVideo, chooseMedia, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, checkIsAddedToMyMiniProgram, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, requestSubscribeDeviceMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestOrderPayment, openQzonePublish, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, checkIsPictureInPictureActive, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
|
|
768
775
|
export { getCurrentPages, navigateBack, navigateTo, redirectTo, reLaunch, switchTab } from "@tarojs/router";
|