@fairys/taro-tools-react 1.0.4 → 1.0.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.
Files changed (50) hide show
  1. package/esm/context/auth.data.instance.d.ts +3 -3
  2. package/esm/context/auth.data.instance.js +6 -6
  3. package/esm/context/global.data.instance.d.ts +4 -0
  4. package/esm/context/global.data.instance.js +5 -0
  5. package/esm/context/page.info.data.instance.d.ts +1 -1
  6. package/lib/components/EnterLoading/index.d.ts +14 -0
  7. package/lib/components/EnterLoading/index.js +112 -0
  8. package/lib/components/MainPage/index.d.ts +10 -0
  9. package/lib/components/MainPage/index.js +102 -0
  10. package/lib/components/Mesage/index.d.ts +48 -0
  11. package/lib/components/Mesage/index.js +172 -0
  12. package/lib/components/Portal/index.d.ts +8 -0
  13. package/lib/components/Portal/index.js +45 -0
  14. package/lib/components/Toast/index.d.ts +1 -0
  15. package/lib/components/Toast/index.js +54 -0
  16. package/lib/components/connectToastMessage/index.d.ts +10 -0
  17. package/lib/components/connectToastMessage/index.js +62 -0
  18. package/lib/components/index.d.ts +6 -0
  19. package/lib/components/index.js +105 -0
  20. package/lib/context/auth.data.instance.d.ts +81 -0
  21. package/lib/context/auth.data.instance.js +155 -0
  22. package/lib/context/global.data.instance.d.ts +54 -0
  23. package/lib/context/global.data.instance.js +122 -0
  24. package/lib/context/global.setting.data.instance.d.ts +56 -0
  25. package/lib/context/global.setting.data.instance.js +79 -0
  26. package/lib/context/index.d.ts +5 -0
  27. package/lib/context/index.js +96 -0
  28. package/lib/context/page.data.instance.d.ts +151 -0
  29. package/lib/context/page.data.instance.js +382 -0
  30. package/lib/context/page.info.data.instance.d.ts +93 -0
  31. package/lib/context/page.info.data.instance.js +226 -0
  32. package/lib/index.d.ts +3 -0
  33. package/lib/styles/index.css +715 -0
  34. package/lib/utils/index.d.ts +4 -0
  35. package/lib/utils/index.js +87 -0
  36. package/lib/utils/navigate.d.ts +109 -0
  37. package/lib/utils/navigate.js +99 -0
  38. package/lib/utils/request.d.ts +179 -0
  39. package/lib/utils/request.js +358 -0
  40. package/lib/utils/useId.d.ts +2 -0
  41. package/lib/utils/useId.js +50 -0
  42. package/lib/utils/valtio/index.d.ts +9 -0
  43. package/lib/utils/valtio/index.js +99 -0
  44. package/lib/utils/valtio/instance.d.ts +17 -0
  45. package/lib/utils/valtio/instance.js +80 -0
  46. package/package.json +4 -3
  47. package/src/context/auth.data.instance.ts +6 -6
  48. package/src/context/global.data.instance.ts +11 -0
  49. package/src/context/page.info.data.instance.tsx +1 -1
  50. package/src/utils/navigate.ts +1 -0
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __webpack_modules__ = {
3
+ "./navigate": function(module) {
4
+ module.exports = require("./navigate.js");
5
+ },
6
+ "./request": function(module) {
7
+ module.exports = require("./request.js");
8
+ },
9
+ "./useId": function(module) {
10
+ module.exports = require("./useId.js");
11
+ },
12
+ "./valtio": function(module) {
13
+ module.exports = require("./valtio/index.js");
14
+ }
15
+ };
16
+ var __webpack_module_cache__ = {};
17
+ function __webpack_require__(moduleId) {
18
+ var cachedModule = __webpack_module_cache__[moduleId];
19
+ if (void 0 !== cachedModule) return cachedModule.exports;
20
+ var module = __webpack_module_cache__[moduleId] = {
21
+ exports: {}
22
+ };
23
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
24
+ return module.exports;
25
+ }
26
+ (()=>{
27
+ __webpack_require__.n = (module)=>{
28
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
29
+ __webpack_require__.d(getter, {
30
+ a: getter
31
+ });
32
+ return getter;
33
+ };
34
+ })();
35
+ (()=>{
36
+ __webpack_require__.d = (exports1, definition)=>{
37
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
38
+ enumerable: true,
39
+ get: definition[key]
40
+ });
41
+ };
42
+ })();
43
+ (()=>{
44
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
45
+ })();
46
+ (()=>{
47
+ __webpack_require__.r = (exports1)=>{
48
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
49
+ value: 'Module'
50
+ });
51
+ Object.defineProperty(exports1, '__esModule', {
52
+ value: true
53
+ });
54
+ };
55
+ })();
56
+ var __webpack_exports__ = {};
57
+ (()=>{
58
+ __webpack_require__.r(__webpack_exports__);
59
+ var _valtio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./valtio");
60
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
61
+ for(var __WEBPACK_IMPORT_KEY__ in _valtio__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
62
+ return _valtio__WEBPACK_IMPORTED_MODULE_0__[key];
63
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
64
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
65
+ var _useId__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./useId");
66
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
67
+ for(var __WEBPACK_IMPORT_KEY__ in _useId__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
68
+ return _useId__WEBPACK_IMPORTED_MODULE_1__[key];
69
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
70
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
71
+ var _navigate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./navigate");
72
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
73
+ for(var __WEBPACK_IMPORT_KEY__ in _navigate__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
74
+ return _navigate__WEBPACK_IMPORTED_MODULE_2__[key];
75
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
76
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
77
+ var _request__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./request");
78
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
79
+ for(var __WEBPACK_IMPORT_KEY__ in _request__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
80
+ return _request__WEBPACK_IMPORTED_MODULE_3__[key];
81
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
82
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
83
+ })();
84
+ for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
85
+ Object.defineProperty(exports, '__esModule', {
86
+ value: true
87
+ });
@@ -0,0 +1,109 @@
1
+ import Taro from '@tarojs/taro';
2
+ declare class NavigateInstance {
3
+ /**判断是否已登录(方法需要在项目入口文件中进行挂载,如果不挂载,默认使用 authDataInstance.hasMenuPermission 判断是否有菜单权限)*/
4
+ isAuth: (url: string) => Promise<boolean> | boolean;
5
+ private _isAuth;
6
+ /**
7
+ * 判断是否当前页面
8
+ */
9
+ isCurrentPage: (route: string) => boolean;
10
+ /** 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
11
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
12
+ * @example
13
+ * ```json
14
+ * {
15
+ * "tabBar": {
16
+ * "list": [{
17
+ * "pagePath": "index",
18
+ * "text": "首页"
19
+ * },{
20
+ * "pagePath": "other",
21
+ * "text": "其他"
22
+ * }]
23
+ * }
24
+ * }
25
+ * ```
26
+ *
27
+ * ```tsx
28
+ * Taro.switchTab({
29
+ * url: '/index'
30
+ * })
31
+ * ```
32
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.switchTab.html
33
+ */
34
+ switchTab: (options: Taro.switchTab.Option) => Promise<TaroGeneral.CallbackResult>;
35
+ /** 关闭所有页面,打开到应用内的某个页面
36
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
37
+ * @example
38
+ * ```tsx
39
+ * Taro.reLaunch({
40
+ * url: 'test?id=1'
41
+ * })
42
+ * ```
43
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.reLaunch.html
44
+ */
45
+ reLaunch: (options: Taro.reLaunch.Option) => Promise<TaroGeneral.CallbackResult>;
46
+ /** 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。
47
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
48
+ * @h5 未针对 tabbar 页面做限制处理
49
+ * @example
50
+ * ```tsx
51
+ * Taro.redirectTo({
52
+ * url: 'test?id=1'
53
+ * })
54
+ * ```
55
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.redirectTo.html
56
+ */
57
+ redirectTo: (options: Taro.redirectTo.Option) => Promise<TaroGeneral.CallbackResult>;
58
+ /** 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 Taro.navigateBack 可以返回到原页面。小程序中页面栈最多十层。
59
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
60
+ * @h5 未针对 tabbar 页面做限制处理
61
+ * @example
62
+ * ```tsx
63
+ * Taro.navigateTo({
64
+ * url: 'test?id=1',
65
+ * events: {
66
+ * // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
67
+ * acceptDataFromOpenedPage: function(data) {
68
+ * console.log(data)
69
+ * },
70
+ * someEvent: function(data) {
71
+ * console.log(data)
72
+ * }
73
+ * ...
74
+ * },
75
+ * success: function (res) {
76
+ * // 通过eventChannel向被打开页面传送数据
77
+ * res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
78
+ * }
79
+ * })
80
+ * ```
81
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html
82
+ */
83
+ navigateTo: (options: Taro.navigateTo.Option) => Promise<TaroGeneral.CallbackResult>;
84
+ /** 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages 获取当前的页面栈,决定需要返回几层。
85
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
86
+ * @h5 若入参 delta 大于现有页面数时,返回应用打开的第一个页面(如果想要返回首页请使用 reLaunch 方法)。
87
+ * @example
88
+ * ```tsx
89
+ * // 注意:调用 navigateTo 跳转时,调用该方法的页面会被加入堆栈,而 redirectTo 方法则不会。见下方示例代码
90
+ * // 此处是A页面
91
+ * Taro.navigateTo({
92
+ * url: 'B?id=1'
93
+ * })
94
+ * // 此处是B页面
95
+ * Taro.navigateTo({
96
+ * url: 'C?id=1'
97
+ * })
98
+ * // 在C页面内 navigateBack,将返回A页面
99
+ * Taro.navigateBack({
100
+ * delta: 2
101
+ * })
102
+ * ```
103
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html
104
+ */
105
+ navigateBack: (options?: Taro.navigateBack.Option) => Promise<TaroGeneral.CallbackResult>;
106
+ }
107
+ /**路由跳转*/
108
+ export declare const navigate: NavigateInstance;
109
+ export default navigate;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ default: ()=>utils_navigate,
37
+ navigate: ()=>navigate_navigate
38
+ });
39
+ const taro_namespaceObject = require("@tarojs/taro");
40
+ var taro_default = /*#__PURE__*/ __webpack_require__.n(taro_namespaceObject);
41
+ const global_setting_data_instance_js_namespaceObject = require("../context/global.setting.data.instance.js");
42
+ const auth_data_instance_js_namespaceObject = require("../context/auth.data.instance.js");
43
+ class NavigateInstance {
44
+ isAuth;
45
+ _isAuth = async (url)=>{
46
+ let isAuthTo = true;
47
+ const isIgnoreAuthRoutes = global_setting_data_instance_js_namespaceObject.globalSettingDataInstance.isIgnoreAuthRoutes(url);
48
+ const useAuthHasMenuPermission = global_setting_data_instance_js_namespaceObject.globalSettingDataInstance.store.useAuthHasMenuPermission;
49
+ const isEnableAuth = global_setting_data_instance_js_namespaceObject.globalSettingDataInstance.store.isEnableAuth;
50
+ let isAuthFunction = this.isAuth;
51
+ if (useAuthHasMenuPermission && 'function' != typeof isAuthFunction && isEnableAuth) isAuthFunction = auth_data_instance_js_namespaceObject.authDataInstance.hasMenuPermission;
52
+ if (url && 'function' == typeof isAuthFunction && !isIgnoreAuthRoutes && isEnableAuth) isAuthTo = await isAuthFunction(url);
53
+ if (false === isAuthTo) {
54
+ taro_default().showToast({
55
+ title: `${url} \u{65E0}\u{6743}\u{8BBF}\u{95EE}`,
56
+ icon: 'none'
57
+ });
58
+ return false;
59
+ }
60
+ return true;
61
+ };
62
+ isCurrentPage = (route)=>{
63
+ const _route = route.replace(/^\//, '');
64
+ const currentPath = (taro_default().getCurrentInstance().router?.path || '').replace(/^\//, '');
65
+ return currentPath === _route;
66
+ };
67
+ switchTab = async (options)=>{
68
+ const isAuthTo = await this._isAuth(options.url);
69
+ if (false === isAuthTo) return;
70
+ return taro_default().switchTab(options);
71
+ };
72
+ reLaunch = async (options)=>{
73
+ const isAuthTo = await this._isAuth(options.url);
74
+ if (false === isAuthTo) return;
75
+ return taro_default().reLaunch(options);
76
+ };
77
+ redirectTo = async (options)=>{
78
+ const isAuthTo = await this._isAuth(options.url);
79
+ if (false === isAuthTo) return;
80
+ return taro_default().redirectTo(options);
81
+ };
82
+ navigateTo = async (options)=>{
83
+ const isAuthTo = await this._isAuth(options.url);
84
+ if (false === isAuthTo) return;
85
+ return taro_default().navigateTo(options);
86
+ };
87
+ navigateBack = (options)=>taro_default().navigateBack(options);
88
+ }
89
+ const navigate_navigate = new NavigateInstance();
90
+ const utils_navigate = navigate_navigate;
91
+ exports["default"] = __webpack_exports__["default"];
92
+ exports.navigate = __webpack_exports__.navigate;
93
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
94
+ "default",
95
+ "navigate"
96
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
97
+ Object.defineProperty(exports, '__esModule', {
98
+ value: true
99
+ });
@@ -0,0 +1,179 @@
1
+ import Taro from '@tarojs/taro';
2
+ export interface TaroRequestOption {
3
+ /**模块名称*/
4
+ module?: string;
5
+ /**是否忽略token*/
6
+ isIgnoreToken?: boolean;
7
+ /**是否提示错误信息*/
8
+ isShowErrorMessage?: boolean;
9
+ }
10
+ export interface RequestInstanceOptions extends Taro.request.Option<any, any>, TaroRequestOption {
11
+ }
12
+ export interface DownloadFileOptions extends Taro.downloadFile.Option, TaroRequestOption {
13
+ /**下载进度回调*/
14
+ onProgress?: Taro.DownloadTask.OnProgressUpdateCallback;
15
+ }
16
+ export interface UploadFileOptions extends Taro.uploadFile.Option, TaroRequestOption {
17
+ /**上传进度回调*/
18
+ onProgress?: Taro.UploadTask.OnProgressUpdateCallback;
19
+ }
20
+ export interface RequestInstanceCreateOptions {
21
+ /**
22
+ * 公共请求配置
23
+ * @default {}
24
+ */
25
+ commonOptions?: Omit<Taro.request.Option<any, any>, 'url'>;
26
+ /**
27
+ * 请求IP地址
28
+ * @default ''
29
+ */
30
+ IP?: string | ((url: string, module?: string, env?: string) => string);
31
+ /**
32
+ * 简单的代理配置
33
+ * @default {}
34
+ */
35
+ proxy?: {
36
+ default?: {
37
+ dev?: string;
38
+ pro?: string;
39
+ };
40
+ dev: Record<string, string | {
41
+ target: string;
42
+ pathRewrite: Record<string, string>;
43
+ }>;
44
+ pro: Record<string, string | {
45
+ target: string;
46
+ pathRewrite: Record<string, string>;
47
+ }>;
48
+ };
49
+ }
50
+ export declare class RequestInstance {
51
+ /**请求IP地址*/
52
+ IP?: string | ((url: string, module?: string, env?: string) => string);
53
+ /**简单的代理配置*/
54
+ proxy?: RequestInstanceCreateOptions['proxy'];
55
+ /**公共请求配置*/
56
+ commonOptions: Omit<Taro.request.Option<any, any>, 'url'>;
57
+ constructor(options?: RequestInstanceCreateOptions);
58
+ /**创建实例*/
59
+ static create(options?: RequestInstanceCreateOptions): RequestInstance;
60
+ /**扩展请求配置*/
61
+ extends: (options?: RequestInstanceCreateOptions) => this;
62
+ /**获取请求地址*/
63
+ getHttpPath: (url: string, module?: string) => string;
64
+ /**获取转换后地址*/
65
+ getProxyHost: (url: string, module?: string) => {
66
+ host: string;
67
+ url: string;
68
+ };
69
+ /**格式化地址*/
70
+ formatUrl: (url: string, module?: string) => string;
71
+ formatRequestOptions: (options: RequestInstanceOptions | DownloadFileOptions | UploadFileOptions) => {
72
+ url: string;
73
+ data?: any;
74
+ timeout?: number;
75
+ method?: keyof Taro.request.Method;
76
+ dataType?: keyof Taro.request.DataType | string;
77
+ responseType?: keyof Taro.request.ResponseType;
78
+ enableHttp2?: boolean;
79
+ enableQuic?: boolean;
80
+ enableCache?: boolean;
81
+ enableHttpDNS?: boolean;
82
+ httpDNSServiceId?: string;
83
+ enableChunked?: boolean;
84
+ forceCellularNetwork?: boolean;
85
+ enableCookie?: boolean;
86
+ referrerStrategy?: keyof Taro.request.ReferrerStrategy;
87
+ success?: (result: Taro.request.SuccessCallbackResult<any>) => void;
88
+ fail?: (res: TaroGeneral.CallbackResult) => void;
89
+ complete?: (res: Partial<Taro.request.SuccessCallbackResult> & TaroGeneral.CallbackResult) => void;
90
+ jsonp?: boolean | string;
91
+ jsonpCache?: RequestCache;
92
+ mode?: keyof Taro.request.CorsMode;
93
+ credentials?: keyof Taro.request.Credentials;
94
+ cache?: keyof Taro.request.Cache;
95
+ retryTimes?: number;
96
+ backup?: string | string[];
97
+ signal?: AbortSignal;
98
+ dataCheck?(): boolean;
99
+ useStore?: boolean;
100
+ storeCheckKey?: string;
101
+ storeSign?: string;
102
+ storeCheck?(): boolean;
103
+ header: {
104
+ [x: string]: any;
105
+ };
106
+ } | {
107
+ url: string;
108
+ /**下载进度回调*/
109
+ onProgress?: Taro.DownloadTask.OnProgressUpdateCallback;
110
+ filePath?: string;
111
+ timeout?: number;
112
+ withCredentials?: boolean;
113
+ complete?: (res: TaroGeneral.CallbackResult) => void;
114
+ fail?: (res: TaroGeneral.CallbackResult) => void;
115
+ success?: (result: Taro.downloadFile.FileSuccessCallbackResult) => void;
116
+ header: {
117
+ [x: string]: any;
118
+ };
119
+ } | {
120
+ url: string;
121
+ /**上传进度回调*/
122
+ onProgress?: Taro.UploadTask.OnProgressUpdateCallback;
123
+ filePath: string;
124
+ name: string;
125
+ formData?: TaroGeneral.IAnyObject;
126
+ timeout?: number;
127
+ fileName?: string;
128
+ withCredentials?: boolean;
129
+ complete?: (res: TaroGeneral.CallbackResult) => void;
130
+ fail?: (res: TaroGeneral.CallbackResult) => void;
131
+ success?: (result: Taro.uploadFile.SuccessCallbackResult) => void;
132
+ header: {
133
+ [x: string]: any;
134
+ };
135
+ };
136
+ /**发送请求,返回 Taro.RequestTask */
137
+ requestBase: (options: RequestInstanceOptions) => Taro.RequestTask<any>;
138
+ /**发送请求,返回 Promise */
139
+ request: (options: RequestInstanceOptions) => Promise<{
140
+ code?: number;
141
+ data?: any;
142
+ message?: string;
143
+ }>;
144
+ /**GET请求*/
145
+ GET: (options: RequestInstanceOptions) => Promise<{
146
+ code?: number;
147
+ data?: any;
148
+ message?: string;
149
+ }>;
150
+ /**POST请求*/
151
+ POST: (options: RequestInstanceOptions) => Promise<{
152
+ code?: number;
153
+ data?: any;
154
+ message?: string;
155
+ }>;
156
+ /**发送formData格式数据*/
157
+ formData: (options: RequestInstanceOptions) => Promise<{
158
+ code?: number;
159
+ data?: any;
160
+ message?: string;
161
+ }>;
162
+ /**发送x-www-form-urlencoded格式数据*/
163
+ xFormUrlEncoded: (options: RequestInstanceOptions) => Promise<{
164
+ code?: number;
165
+ data?: any;
166
+ message?: string;
167
+ }>;
168
+ /**下载文件(返回 Taro.DownloadTask.DownloadTaskPromise ,可显示下载进度)*/
169
+ downloadFileTask: (options: DownloadFileOptions) => Taro.DownloadTask.DownloadTaskPromise | undefined;
170
+ /**下载文件*/
171
+ downloadFile: (options: DownloadFileOptions) => Promise<Taro.downloadFile.FileSuccessCallbackResult>;
172
+ /**上传文件(返回 Taro.UploadTask.UploadTaskPromise ,可显示上传进度)*/
173
+ uploadFileTask: (options: UploadFileOptions) => Taro.UploadTask.UploadTaskPromise;
174
+ /**上传文件*/
175
+ uploadFile: (options: UploadFileOptions) => Promise<Taro.uploadFile.SuccessCallbackResult>;
176
+ }
177
+ /** 请求*/
178
+ export declare const request: RequestInstance;
179
+ export default request;