[@types/browserslist] Added error.d.ts to browserslist (#33772)

* Added error.d.ts to browserslist

* Upgrade browserslist version number

* Added type test

* Removed patch version and add space to test

* Set browserslist to always be true
This commit is contained in:
Andrew Leedham
2019-03-11 13:21:07 -07:00
committed by Wesley Wigham
parent 79863ec50a
commit 1e3e89fe6f
4 changed files with 12 additions and 2 deletions
+3
View File
@@ -1,4 +1,5 @@
import browserslist from "browserslist";
import BrowserslistError from "browserslist/error";
browserslist(); // $ExpectType string[]
browserslist(""); // $ExpectType string[]
@@ -20,3 +21,5 @@ for (const opt of opts) {
browserslist.coverage([""]); // $ExpectType number
browserslist.coverage([""], { "": { "": 0 } }); // $ExpectType number
new BrowserslistError('error'); // $ExpectType BrowserslistError
+6
View File
@@ -0,0 +1,6 @@
declare class BrowserslistError extends Error {
constructor(message: any);
browserslist: true;
}
export = BrowserslistError;
+2 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for browserslist 4.3
// Type definitions for browserslist 4.4
// Project: https://github.com/browserslist/browserslist#readme
// Definitions by: Dave Cardwell <https://github.com/davecardwell>
// Andrew Leedham <https://github.com/AndrewLeedham>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
+1 -1
View File
@@ -13,5 +13,5 @@
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": ["index.d.ts", "browserslist-tests.ts"]
"files": ["index.d.ts", "browserslist-tests.ts", "error.d.ts"]
}