Skip to content

Commit

Permalink
get rid of some hacks in declarations file for webpack-4
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffin143 committed Jan 12, 2020
1 parent 45ecebc commit 148c4be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 38 deletions.
32 changes: 0 additions & 32 deletions declarations.d.ts
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions declarations/WebpackOptions.d.ts
Expand Up @@ -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
*
Expand Down Expand Up @@ -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".
Expand Down
6 changes: 2 additions & 4 deletions schemas/WebpackOptions.json
Expand Up @@ -1428,8 +1428,7 @@
"$ref": "#/definitions/RuleSetCondition"
}
]
},
"tsType": "RuleSetConditionsRecursive"
}
},
"RuleSetConditionsAbsolute": {
"type": "array",
Expand All @@ -1440,8 +1439,7 @@
"$ref": "#/definitions/RuleSetConditionAbsolute"
}
]
},
"tsType": "RuleSetConditionsAbsoluteRecursive"
}
},
"RuleSetLoader": {
"type": "string",
Expand Down

0 comments on commit 148c4be

Please sign in to comment.