Skip to content

Commit

Permalink
fix: resolve mismatch with types declaration and docs for resourceQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
bolariin committed May 3, 2021
1 parent a73bcc5 commit 9749b08
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 113 deletions.
6 changes: 3 additions & 3 deletions declarations/WebpackOptions.d.ts
Expand Up @@ -244,15 +244,15 @@ export type RuleSetCondition =
/**
* Logical AND.
*/
and?: RuleSetConditions;
and?: RuleSetCondition;
/**
* Logical NOT.
*/
not?: RuleSetConditions;
not?: RuleSetCondition;
/**
* Logical OR.
*/
or?: RuleSetConditions;
or?: RuleSetCondition;
}
| ((value: string) => boolean)
| RuleSetConditions;
Expand Down
2 changes: 1 addition & 1 deletion schemas/WebpackOptions.check.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions schemas/WebpackOptions.json
Expand Up @@ -3380,23 +3380,23 @@
"description": "Logical AND.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditions"
"$ref": "#/definitions/RuleSetCondition"
}
]
},
"not": {
"description": "Logical NOT.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditions"
"$ref": "#/definitions/RuleSetCondition"
}
]
},
"or": {
"description": "Logical OR.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditions"
"$ref": "#/definitions/RuleSetCondition"
}
]
}
Expand Down
165 changes: 59 additions & 106 deletions types.d.ts
Expand Up @@ -8989,15 +8989,30 @@ type RuleSetCondition =
/**
* Logical AND.
*/
and?: RuleSetCondition[];
and?:
| string
| RegExp
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];
/**
* Logical NOT.
*/
not?: RuleSetCondition[];
not?:
| string
| RegExp
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];
/**
* Logical OR.
*/
or?: RuleSetCondition[];
or?:
| string
| RegExp
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];
}
| ((value: string) => boolean)
| RuleSetCondition[];
Expand All @@ -9023,20 +9038,7 @@ type RuleSetConditionAbsolute =
type RuleSetConditionOrConditions =
| string
| RegExp
| {
/**
* Logical AND.
*/
and?: RuleSetCondition[];
/**
* Logical NOT.
*/
not?: RuleSetCondition[];
/**
* Logical OR.
*/
or?: RuleSetCondition[];
}
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];

Expand All @@ -9050,20 +9052,7 @@ declare interface RuleSetRule {
compiler?:
| string
| RegExp
| {
/**
* Logical AND.
*/
and?: RuleSetCondition[];
/**
* Logical NOT.
*/
not?: RuleSetCondition[];
/**
* Logical OR.
*/
or?: RuleSetCondition[];
}
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];

Expand All @@ -9073,20 +9062,7 @@ declare interface RuleSetRule {
dependency?:
| string
| RegExp
| {
/**
* Logical AND.
*/
and?: RuleSetCondition[];
/**
* Logical NOT.
*/
not?: RuleSetCondition[];
/**
* Logical OR.
*/
or?: RuleSetCondition[];
}
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];

Expand Down Expand Up @@ -9180,20 +9156,7 @@ declare interface RuleSetRule {
issuerLayer?:
| string
| RegExp
| {
/**
* Logical AND.
*/
and?: RuleSetCondition[];
/**
* Logical NOT.
*/
not?: RuleSetCondition[];
/**
* Logical OR.
*/
or?: RuleSetCondition[];
}
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];

Expand All @@ -9213,20 +9176,7 @@ declare interface RuleSetRule {
mimetype?:
| string
| RegExp
| {
/**
* Logical AND.
*/
and?: RuleSetCondition[];
/**
* Logical NOT.
*/
not?: RuleSetCondition[];
/**
* Logical OR.
*/
or?: RuleSetCondition[];
}
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];

Expand Down Expand Up @@ -9302,20 +9252,7 @@ declare interface RuleSetRule {
resourceFragment?:
| string
| RegExp
| {
/**
* Logical AND.
*/
and?: RuleSetCondition[];
/**
* Logical NOT.
*/
not?: RuleSetCondition[];
/**
* Logical OR.
*/
or?: RuleSetCondition[];
}
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];

Expand All @@ -9325,20 +9262,7 @@ declare interface RuleSetRule {
resourceQuery?:
| string
| RegExp
| {
/**
* Logical AND.
*/
and?: RuleSetCondition[];
/**
* Logical NOT.
*/
not?: RuleSetCondition[];
/**
* Logical OR.
*/
or?: RuleSetCondition[];
}
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];

Expand Down Expand Up @@ -9425,7 +9349,7 @@ declare interface RuleSetRule {
*/
options?: string | { [index: string]: any };
}
| __TypeWebpackOptions
| __TypeWebpackOptionsFunction
| RuleSetUseItem[]);
}
type RuleSetUse =
Expand All @@ -9452,7 +9376,7 @@ type RuleSetUse =
*/
options?: string | { [index: string]: any };
}
| __TypeWebpackOptions;
| __TypeWebpackOptionsFunction;
type RuleSetUseItem =
| string
| {
Expand All @@ -9469,7 +9393,7 @@ type RuleSetUseItem =
*/
options?: string | { [index: string]: any };
}
| __TypeWebpackOptions;
| __TypeWebpackOptionsFunction;
declare class RuntimeChunkPlugin {
constructor(options?: any);
options: any;
Expand Down Expand Up @@ -11585,7 +11509,36 @@ declare interface WithOptions {
declare interface WriteOnlySet<T> {
add: (T?: any) => void;
}
type __TypeWebpackOptions = (
type __TypeWebpackOptions = {
/**
* Logical AND.
*/
and?:
| string
| RegExp
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];
/**
* Logical NOT.
*/
not?:
| string
| RegExp
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];
/**
* Logical OR.
*/
or?:
| string
| RegExp
| __TypeWebpackOptions
| ((value: string) => boolean)
| RuleSetCondition[];
};
type __TypeWebpackOptionsFunction = (
data: object
) =>
| string
Expand All @@ -11603,7 +11556,7 @@ type __TypeWebpackOptions = (
*/
options?: string | { [index: string]: any };
}
| __TypeWebpackOptions
| __TypeWebpackOptionsFunction
| RuleSetUseItem[];
declare function exports(
options: Configuration,
Expand Down

0 comments on commit 9749b08

Please sign in to comment.