Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
fix: 修复 ts 类型构建后被覆盖问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhbhun committed Feb 25, 2021
1 parent b3b438b commit 59c3013
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
11 changes: 8 additions & 3 deletions src/index.d.ts → index.d.ts
@@ -1,4 +1,4 @@
interface EaxiosErrorCode {
export interface EaxiosErrorCode {
REQUEST_OFFLINE: string;
REQUEST_TIMEOUT: string;
SERVER_ERROR: string;
Expand Down Expand Up @@ -81,7 +81,7 @@ export interface EaxiosRequestConfig<ResponseData = any, RequestData = any> {
withCredentials?: boolean;
adapter?: EaxiosAdapter;
auth?: EaxiosBasicCredentials;
responseError?: EaxiosError;
responseError?: EaxiosErrorCode;
responseType?: ResponseType;
xsrfCookieName?: string;
xsrfHeaderName?: string;
Expand Down Expand Up @@ -111,7 +111,7 @@ export interface EaxiosError<T = any> extends Error {
code?: string;
request?: any;
response?: EaxiosResponse<T>;
isEaxiosError: boolean;
isAxiosError: boolean;
toJSON: () => object;
}

Expand Down Expand Up @@ -205,6 +205,11 @@ export interface EaxiosInstance {

export interface EaxiosStatic extends EaxiosInstance {
create(config?: EaxiosRequestConfig): EaxiosInstance;
createError(
message: string,
code: string,
response: EaxiosResponse,
): EaxiosError;
Cancel: CancelStatic;
CancelToken: CancelTokenStatic;
isCancel(value: any): boolean;
Expand Down
1 change: 1 addition & 0 deletions index.js
@@ -0,0 +1 @@
module.exports = require('./lib/index');
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -26,6 +26,8 @@
"files": [
"dist",
"lib",
"index.d.ts",
"index.js",
"errors.svg"
],
"scripts": {
Expand All @@ -39,7 +41,7 @@
"test:watch": "jest --watch"
},
"dependencies": {
"axios": "~0.19.2"
"axios": "^0.19.2"
},
"devDependencies": {
"@semantic-release/changelog": "^5.0.1",
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.release.json
Expand Up @@ -3,9 +3,9 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"declaration": true,
"removeComments": true,
"declaration": false,
"removeComments": false,
"sourceMap": false
},
"include": ["src/**/*"]
"include": ["index.d.ts", "src/**/*"]
}

0 comments on commit 59c3013

Please sign in to comment.