@lx-frontend/multi-ajax 0.2.9 → 0.2.10
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/README.md +13 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -0
package/README.md
CHANGED
|
@@ -296,3 +296,16 @@ webpackChain(chain) {
|
|
|
296
296
|
```
|
|
297
297
|
|
|
298
298
|
注意:只在web或小程序项目中使用该插件,node环境下无需使用。
|
|
299
|
+
|
|
300
|
+
## Axios
|
|
301
|
+
|
|
302
|
+
通过 axios 和 AxiosTypes 暴露了 axios 的相关内容 (v0.2.10)
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
import { axios, AxiosTypes } from '@lx-frontend/multi-ajax';
|
|
306
|
+
|
|
307
|
+
const normalizeErrorRes = (err: AxiosTypes.AxiosError) => {}
|
|
308
|
+
|
|
309
|
+
axios.isCancel(err)
|
|
310
|
+
axios.isAxiosError(err)
|
|
311
|
+
```
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
1
2
|
import type { AjaxInstance, AjaxOption } from './types';
|
|
3
|
+
import type * as AxiosTypes from 'axios';
|
|
4
|
+
export type { AxiosTypes };
|
|
5
|
+
export { axios };
|
|
2
6
|
export default function initAjax<CusOpts extends object, ResDataShape extends object = any>(options: AjaxOption & CusOpts): AjaxInstance<CusOpts, ResDataShape>;
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.axios = void 0;
|
|
3
4
|
var tslib_1 = require("tslib");
|
|
4
5
|
var axios_1 = tslib_1.__importDefault(require("axios"));
|
|
6
|
+
exports.axios = axios_1.default;
|
|
5
7
|
var index_1 = require("./adapters/index");
|
|
6
8
|
var compatibleMethods_1 = tslib_1.__importDefault(require("./compatibleMethods"));
|
|
7
9
|
var helpers_1 = require("./helpers");
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,wDAAyB;AAQhB,gBARF,eAAK,CAQE;AAPd,0CAA4C;AAC5C,kFAAsD;AACtD,qCAA+F;AAC/F,qCAA0C;AAQ1C,SAAS,OAAO;IACd,OAAO,OAAO,EAAE,KAAK,WAAW,IAAI,OAAO,EAAE,CAAC,OAAO,KAAK,UAAU,CAAA;AACtE,CAAC;AAED,SAAwB,QAAQ,CAC9B,OAA6B;IAE7B,IAAM,IAAI,GAAG,EAAyC,CAAA;IACtD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IAEvB,2BAA2B;IAC3B,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,iBAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAC5E,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAA;IAC/B,IAAI,CAAC,OAAO,GAAG,eAAK,CAAC,MAAM,EAAE,CAAA;IAE7B,IAAM,cAAc,GAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACxF,cAAc,CAAC,OAAO,CAAC,UAAC,IAAkB;QACxC,IAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAoB,CAAA;QAC/D,IAAI,CAAC,YAAY,CAAC,GAAG,IAAA,wBAAc,EAAwB,IAAI,EAAE,IAAI,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;IAEF,cAAc;IACd,IAAA,2BAAiB,EAAC,IAAI,CAAC,CAAA;IAEvB,6DAA6D;IAC7D,IAAA,iCAAuB,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAE3C,IAAA,2BAAoB,EAAC,IAAI,CAAC,CAAA;IAE1B,wBAAwB;IACxB,IAAA,iCAAuB,EAAC,IAAI,CAAC,CAAA;IAE7B,OAAO,IAAI,CAAA;AACb,CAAC;AA7BD,2BA6BC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -4,6 +4,9 @@ import addCompatibleMethods from './compatibleMethods'
|
|
|
4
4
|
import { addInstanceExtendMethod, proxyAjaxCanceler, proxyAxiosInstanceAttrs } from './helpers'
|
|
5
5
|
import { generateMethod } from './methods'
|
|
6
6
|
import type { AjaxInstance, AjaxOption, AxiosMethods, RequestMethods } from './types'
|
|
7
|
+
import type * as AxiosTypes from 'axios'
|
|
8
|
+
export type { AxiosTypes }
|
|
9
|
+
export { axios }
|
|
7
10
|
|
|
8
11
|
declare const wx: any
|
|
9
12
|
|