mirror of https://github.com/webpack/webpack.git
refactor: fix types
This commit is contained in:
parent
7176437d19
commit
591d3f4bd4
|
@ -221,7 +221,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin {
|
|||
}
|
||||
case "fetchPriority": {
|
||||
const expr = parser.evaluateExpression(
|
||||
/** @type {ExpressionNode} */ (prop.value)
|
||||
/** @type {Expression} */ (prop.value)
|
||||
);
|
||||
if (expr.isBoolean()) {
|
||||
groupOptions.fetchPriority = "auto";
|
||||
|
@ -229,7 +229,10 @@ module.exports = class ImportMetaContextDependencyParserPlugin {
|
|||
expr.isString() &&
|
||||
["high", "low", "auto"].includes(expr.string)
|
||||
) {
|
||||
groupOptions.fetchPriority = expr.string;
|
||||
groupOptions.fetchPriority =
|
||||
/** @type {RawChunkGroupOptions["fetchPriority"]} */ (
|
||||
expr.string
|
||||
);
|
||||
} else {
|
||||
errors.push(
|
||||
createPropertyParseError(
|
||||
|
|
|
@ -8,9 +8,9 @@ const RuntimeGlobals = require("../RuntimeGlobals");
|
|||
const RuntimeModule = require("../RuntimeModule");
|
||||
const Template = require("../Template");
|
||||
|
||||
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
||||
/** @typedef {import("../Chunk")} Chunk */
|
||||
/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
|
||||
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
||||
|
||||
class ChunkFetchPriorityFunctionRuntimeModule extends RuntimeModule {
|
||||
/**
|
||||
|
|
|
@ -12,9 +12,9 @@ const ChunkPrefetchStartupRuntimeModule = require("./ChunkPrefetchStartupRuntime
|
|||
const ChunkPrefetchTriggerRuntimeModule = require("./ChunkPrefetchTriggerRuntimeModule");
|
||||
const ChunkPreloadTriggerRuntimeModule = require("./ChunkPreloadTriggerRuntimeModule");
|
||||
|
||||
/** @typedef {import("../Compiler")} Compiler */
|
||||
/** @typedef {import("../Chunk")} Chunk */
|
||||
/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
|
||||
/** @typedef {import("../Compiler")} Compiler */
|
||||
|
||||
class ChunkPrefetchPreloadPlugin {
|
||||
/**
|
||||
|
|
|
@ -9905,7 +9905,7 @@ declare interface ProvidesObject {
|
|||
declare interface RawChunkGroupOptions {
|
||||
preloadOrder?: number;
|
||||
prefetchOrder?: number;
|
||||
fetchPriority?: string;
|
||||
fetchPriority?: "auto" | "low" | "high";
|
||||
}
|
||||
type RawLoaderDefinition<
|
||||
OptionsType = {},
|
||||
|
|
Loading…
Reference in New Issue