mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #65644 [xmlhttprequest] Add types for xmlhttprequest by @CruseCtrl
This commit is contained in:
8
types/xmlhttprequest/index.d.ts
vendored
Normal file
8
types/xmlhttprequest/index.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Type definitions for xmlhttprequest 1.8
|
||||
// Project: https://github.com/driverdan/node-XMLHttpRequest
|
||||
// Definitions by: Harry Cruse <https://github.com/CruseCtrl>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type XHR = XMLHttpRequest;
|
||||
|
||||
export { XHR as XMLHttpRequest };
|
||||
16
types/xmlhttprequest/tsconfig.json
Normal file
16
types/xmlhttprequest/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "xmlhttprequest-tests.ts"]
|
||||
}
|
||||
1
types/xmlhttprequest/tslint.json
Normal file
1
types/xmlhttprequest/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
||||
6
types/xmlhttprequest/xmlhttprequest-tests.ts
Normal file
6
types/xmlhttprequest/xmlhttprequest-tests.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { XMLHttpRequest } from 'xmlhttprequest';
|
||||
|
||||
const { OPENED, HEADERS_RECEIVED, LOADING, DONE } = XMLHttpRequest;
|
||||
|
||||
const x = new XMLHttpRequest();
|
||||
x.open('GET', 'https://example.com');
|
||||
Reference in New Issue
Block a user