From 148c4be6e61171b6c0059597f049bdb3479b4d3c Mon Sep 17 00:00:00 2001 From: jeffin143 Date: Sun, 12 Jan 2020 22:06:01 +0530 Subject: [PATCH] get rid of some hacks in declarations file for webpack-4 --- declarations.d.ts | 32 -------------------------------- declarations/WebpackOptions.d.ts | 4 ++-- schemas/WebpackOptions.json | 6 ++---- 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/declarations.d.ts b/declarations.d.ts index 83b612e4cad..770212b6768 100644 --- a/declarations.d.ts +++ b/declarations.d.ts @@ -228,36 +228,4 @@ declare module "@webassemblyjs/ast" { export function isFuncImportDescr(n: Node): boolean; } -// This "hack" is needed because typescript doesn't support recursive type definitions -// It's referenced from "ruleSet-conditions" in schemas/WebpackOptions.json -interface RuleSetConditionsRecursive - extends Array {} -interface RuleSetConditionsAbsoluteRecursive - extends Array< - import("./declarations/WebpackOptions").RuleSetConditionAbsolute - > {} - -/** - * Global variable declarations - * @todo Once this issue is resolved, remove these globals and add JSDoc onsite instead - * https://github.com/Microsoft/TypeScript/issues/15626 - */ -declare const $hash$; -declare const $requestTimeout$; -declare const installedModules; -declare const $require$; -declare const hotDownloadManifest; -declare const hotDownloadUpdateChunk; -declare const hotDisposeChunk; -declare const modules; -declare const installedChunks; -declare const hotAddUpdateChunk; -declare const parentHotUpdateCallback; -declare const $hotChunkFilename$; -declare const $hotMainFilename$; -declare namespace WebAssembly {} -declare const importScripts; -declare const $crossOriginLoading$; -declare const chunkId; - type TODO = any; diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 57f9df076c3..a0bdde054d1 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -132,7 +132,7 @@ export type RuleSetCondition = * This interface was referenced by `WebpackOptions`'s JSON-Schema * via the `definition` "RuleSetConditions". */ -export type RuleSetConditions = RuleSetConditionsRecursive; +export type RuleSetConditions = RuleSetCondition[] /** * One or multiple rule conditions * @@ -181,7 +181,7 @@ export type RuleSetConditionAbsolute = * This interface was referenced by `WebpackOptions`'s JSON-Schema * via the `definition` "RuleSetConditionsAbsolute". */ -export type RuleSetConditionsAbsolute = RuleSetConditionsAbsoluteRecursive; +export type RuleSetConditionsAbsolute = RuleSetConditionAbsolute[]; /** * This interface was referenced by `WebpackOptions`'s JSON-Schema * via the `definition` "RuleSetLoader". diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 310e3388085..1fd61706d84 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -1428,8 +1428,7 @@ "$ref": "#/definitions/RuleSetCondition" } ] - }, - "tsType": "RuleSetConditionsRecursive" + } }, "RuleSetConditionsAbsolute": { "type": "array", @@ -1440,8 +1439,7 @@ "$ref": "#/definitions/RuleSetConditionAbsolute" } ] - }, - "tsType": "RuleSetConditionsAbsoluteRecursive" + } }, "RuleSetLoader": { "type": "string",