@tripian/core 6.0.57 → 6.0.62
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/api/API.d.ts +3 -0
- package/api/const/ApiConstModel.d.ts +3 -0
- package/data/dataModel.d.ts +1 -0
- package/easy/handle/cache/Cached.d.ts +1 -0
- package/index.js +54 -54
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/providers/bb/API.d.ts +1 -0
- package/tcore.umd.js +54 -54
- package/tcore.umd.js.map +1 -1
- package/xhr/xhrFetch.d.ts +28 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import 'cross-fetch/polyfill';
|
|
2
|
+
import Model from '@tripian/model';
|
|
3
|
+
import { AxiosInstance } from 'axios';
|
|
4
|
+
import IXhrOptions from './IXhrOptions';
|
|
5
|
+
declare class XHR {
|
|
6
|
+
private static instance;
|
|
7
|
+
private axios;
|
|
8
|
+
private baseURL;
|
|
9
|
+
private xApiKey;
|
|
10
|
+
private timeout;
|
|
11
|
+
private authorization?;
|
|
12
|
+
private token?;
|
|
13
|
+
getToken: () => Model.Token | undefined;
|
|
14
|
+
setToken: (token: Model.Token) => void;
|
|
15
|
+
removeToken: () => void;
|
|
16
|
+
private constructor();
|
|
17
|
+
static getInstance: (xhrOptions: IXhrOptions) => XHR;
|
|
18
|
+
static refreshXhrToken: () => Promise<Model.Token> | undefined;
|
|
19
|
+
private get;
|
|
20
|
+
private getWithPage;
|
|
21
|
+
private post;
|
|
22
|
+
private put;
|
|
23
|
+
private delete;
|
|
24
|
+
req: (httpMethod: string) => <T>(url: string, dataKey: string, params?: any, customHeaders?: any) => Promise<T>;
|
|
25
|
+
reqAxios: () => AxiosInstance;
|
|
26
|
+
reqWithPage: (httpMethod: string) => <T>(url: string, dataKey: string, params?: any) => Promise<Model.DataPayload<T>>;
|
|
27
|
+
}
|
|
28
|
+
export default XHR;
|