Skip to content

Commit 7108584

Browse files
authored
fix(types): respect original types (#340)
1 parent 7280549 commit 7108584

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545
"url": "https://github.com/ykzts/node-xmlhttprequest.git"
4646
},
4747
"scripts": {
48-
"build": "microbundle --strict --target node src/index.ts src/browser.ts",
48+
"build": "microbundle --no-generate-types --strict --target node src/index.ts src/browser.ts",
4949
"format": "prettier --write .",
5050
"format-check": "prettier --check .",
5151
"lint": "eslint .",
5252
"prepare": "is-ci || husky install",
5353
"test": "jest"
5454
},
5555
"source": "./src/index.ts",
56-
"types": "./dist/index.d.ts",
56+
"types": "./types/index.d.ts",
5757
"unpkg": "./dist/index.umd.js",
5858
"version": "3.0.0"
5959
}

tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"compilerOptions": {
33
"allowJs": false,
44
"baseUrl": ".",
5+
"declaration": false,
6+
"declarationDir": null,
57
"esModuleInterop": true,
68
"module": "esnext",
79
"noEmit": true,

types/index.d.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export declare const XMLHttpRequest: {
2+
new (): XMLHttpRequest;
3+
prototype: XMLHttpRequest;
4+
readonly DONE: number;
5+
readonly HEADERS_RECEIVED: number;
6+
readonly LOADING: number;
7+
readonly OPENED: number;
8+
readonly UNSENT: number;
9+
};
10+
11+
export declare const XMLHttpRequestUpload: {
12+
new (): XMLHttpRequestUpload;
13+
prototype: XMLHttpRequestUpload;
14+
};
15+
16+
export declare const FormData: {
17+
new (form?: HTMLFormElement): FormData;
18+
prototype: FormData;
19+
};

0 commit comments

Comments
 (0)