get rid of some hacks in declarations file for webpack-4

This commit is contained in:
jeffin143 2020-01-12 22:06:01 +05:30
parent 45ecebc9f0
commit 148c4be6e6
3 changed files with 4 additions and 38 deletions

32
declarations.d.ts vendored
View File

@ -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<import("./declarations/WebpackOptions").RuleSetCondition> {}
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;

View File

@ -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".

View File

@ -1428,8 +1428,7 @@
"$ref": "#/definitions/RuleSetCondition"
}
]
},
"tsType": "RuleSetConditionsRecursive"
}
},
"RuleSetConditionsAbsolute": {
"type": "array",
@ -1440,8 +1439,7 @@
"$ref": "#/definitions/RuleSetConditionAbsolute"
}
]
},
"tsType": "RuleSetConditionsAbsoluteRecursive"
}
},
"RuleSetLoader": {
"type": "string",