Skip to content

Commit

Permalink
Merge pull request webpack#10531 from webpack/schema/improve-descript…
Browse files Browse the repository at this point in the history
…ions

improve schema descriptions
  • Loading branch information
sokra committed Mar 11, 2020
2 parents fcd63bc + df81e14 commit 361cd7a
Show file tree
Hide file tree
Showing 37 changed files with 1,002 additions and 961 deletions.
688 changes: 344 additions & 344 deletions declarations/WebpackOptions.d.ts

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions declarations/plugins/AssetModulesPluginGenerator.d.ts
Expand Up @@ -5,7 +5,7 @@
*/

/**
* Function that executes for module and should return an DataUrl string
* Function that executes for module and should return an DataUrl string.
*/
export type DataUrlFunction = (
source: string | Buffer,
Expand All @@ -14,11 +14,11 @@ export type DataUrlFunction = (

export interface AssetModulesPluginGeneratorOptions {
/**
* The options for data url generator
* The options for data url generator.
*/
dataUrl?: DataUrlOptions | DataUrlFunction;
/**
* Template for asset filename
* Template for asset filename.
*/
filename?:
| string
Expand All @@ -28,15 +28,15 @@ export interface AssetModulesPluginGeneratorOptions {
) => string);
}
/**
* Options object for data url generation
* Options object for data url generation.
*/
export interface DataUrlOptions {
/**
* Asset encoding (defaults to base64)
* Asset encoding (defaults to base64).
*/
encoding?: false | "base64";
/**
* Asset mimetype (getting from file extension by default)
* Asset mimetype (getting from file extension by default).
*/
mimetype?: string;
}
8 changes: 4 additions & 4 deletions declarations/plugins/AssetModulesPluginParser.d.ts
Expand Up @@ -5,7 +5,7 @@
*/

/**
* Function that executes for module and should return whenever asset should be inlined as DataUrl
* Function that executes for module and should return whenever asset should be inlined as DataUrl.
*/
export type DataUrlFunction = (
source: string | Buffer,
Expand All @@ -14,16 +14,16 @@ export type DataUrlFunction = (

export interface AssetModulesPluginParserOptions {
/**
* The condition for inlining the asset as DataUrl
* The condition for inlining the asset as DataUrl.
*/
dataUrlCondition?: DataUrlOptions | DataUrlFunction;
}
/**
* Options object for DataUrl condition
* Options object for DataUrl condition.
*/
export interface DataUrlOptions {
/**
* Maximum size of asset that should be inline as modules. Default: 8kb
* Maximum size of asset that should be inline as modules. Default: 8kb.
*/
maxSize?: number;
}
18 changes: 9 additions & 9 deletions declarations/plugins/BannerPlugin.d.ts
Expand Up @@ -9,45 +9,45 @@ export type BannerPluginArgument =
| BannerFunction
| string;
/**
* The banner as function, it will be wrapped in a comment
* The banner as function, it will be wrapped in a comment.
*/
export type BannerFunction = (data: {
hash: string;
chunk: import("../../lib/Chunk");
filename: string;
}) => string;
/**
* Filtering rules
* Filtering rules.
*/
export type Rules = Rule[] | Rule;
/**
* Filtering rule as regex or string
* Filtering rule as regex or string.
*/
export type Rule = RegExp | string;

export interface BannerPluginOptions {
/**
* Specifies the banner
* Specifies the banner.
*/
banner: BannerFunction | string;
/**
* If true, the banner will only be added to the entry chunks
* If true, the banner will only be added to the entry chunks.
*/
entryOnly?: boolean;
/**
* Exclude all modules matching any of these conditions
* Exclude all modules matching any of these conditions.
*/
exclude?: Rules;
/**
* Include all modules matching any of these conditions
* Include all modules matching any of these conditions.
*/
include?: Rules;
/**
* If true, banner will not be wrapped in a comment
* If true, banner will not be wrapped in a comment.
*/
raw?: boolean;
/**
* Include all modules that pass test assertion
* Include all modules that pass test assertion.
*/
test?: Rules;
}
12 changes: 6 additions & 6 deletions declarations/plugins/DllPlugin.d.ts
Expand Up @@ -6,27 +6,27 @@

export interface DllPluginOptions {
/**
* Context of requests in the manifest file (defaults to the webpack context)
* Context of requests in the manifest file (defaults to the webpack context).
*/
context?: string;
/**
* If true, only entry points will be exposed (default: true)
* If true, only entry points will be exposed (default: true).
*/
entryOnly?: boolean;
/**
* If true, manifest json file (output) will be formatted
* If true, manifest json file (output) will be formatted.
*/
format?: boolean;
/**
* Name of the exposed dll function (external name, use value of 'output.library')
* Name of the exposed dll function (external name, use value of 'output.library').
*/
name?: string;
/**
* Absolute path to the manifest json file (output)
* Absolute path to the manifest json file (output).
*/
path: string;
/**
* Type of the dll bundle (external type, use value of 'output.libraryTarget')
* Type of the dll bundle (external type, use value of 'output.libraryTarget').
*/
type?: string;
}
48 changes: 24 additions & 24 deletions declarations/plugins/DllReferencePlugin.d.ts
Expand Up @@ -7,66 +7,66 @@
export type DllReferencePluginOptions =
| {
/**
* (absolute path) context of requests in the manifest (or content property)
* Context of requests in the manifest (or content property) as absolute path.
*/
context?: string;
/**
* Extensions used to resolve modules in the dll bundle (only used when using 'scope')
* Extensions used to resolve modules in the dll bundle (only used when using 'scope').
*/
extensions?: string[];
/**
* An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation
* An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
*/
manifest: DllReferencePluginOptionsManifest | string;
/**
* The name where the dll is exposed (external name, defaults to manifest.name)
* The name where the dll is exposed (external name, defaults to manifest.name).
*/
name?: string;
/**
* Prefix which is used for accessing the content of the dll
* Prefix which is used for accessing the content of the dll.
*/
scope?: string;
/**
* How the dll is exposed (libraryTarget, defaults to manifest.type)
* How the dll is exposed (libraryTarget, defaults to manifest.type).
*/
sourceType?: DllReferencePluginOptionsSourceType;
/**
* The way how the export of the dll bundle is used
* The way how the export of the dll bundle is used.
*/
type?: "require" | "object";
}
| {
/**
* The mappings from request to module info
* The mappings from request to module info.
*/
content: DllReferencePluginOptionsContent;
/**
* (absolute path) context of requests in the manifest (or content property)
* Context of requests in the manifest (or content property) as absolute path.
*/
context?: string;
/**
* Extensions used to resolve modules in the dll bundle (only used when using 'scope')
* Extensions used to resolve modules in the dll bundle (only used when using 'scope').
*/
extensions?: string[];
/**
* The name where the dll is exposed (external name)
* The name where the dll is exposed (external name).
*/
name: string;
/**
* Prefix which is used for accessing the content of the dll
* Prefix which is used for accessing the content of the dll.
*/
scope?: string;
/**
* How the dll is exposed (libraryTarget)
* How the dll is exposed (libraryTarget).
*/
sourceType?: DllReferencePluginOptionsSourceType;
/**
* The way how the export of the dll bundle is used
* The way how the export of the dll bundle is used.
*/
type?: "require" | "object";
};
/**
* The type how the dll is exposed (external type)
* The type how the dll is exposed (external type).
*/
export type DllReferencePluginOptionsSourceType =
| "var"
Expand All @@ -84,42 +84,42 @@ export type DllReferencePluginOptionsSourceType =
| "jsonp";

/**
* An object containing content, name and type
* An object containing content, name and type.
*/
export interface DllReferencePluginOptionsManifest {
/**
* The mappings from request to module info
* The mappings from request to module info.
*/
content: DllReferencePluginOptionsContent;
/**
* The name where the dll is exposed (external name)
* The name where the dll is exposed (external name).
*/
name?: string;
/**
* The type how the dll is exposed (external type)
* The type how the dll is exposed (external type).
*/
type?: DllReferencePluginOptionsSourceType;
}
/**
* The mappings from request to module info
* The mappings from request to module info.
*/
export interface DllReferencePluginOptionsContent {
/**
* Module info
* Module info.
*/
[k: string]: {
/**
* Meta information about the module
* Meta information about the module.
*/
buildMeta?: {
[k: string]: any;
};
/**
* Information about the provided exports of the module
* Information about the provided exports of the module.
*/
exports?: true | string[];
/**
* Module ID
* Module ID.
*/
id: number | string;
};
Expand Down
6 changes: 3 additions & 3 deletions declarations/plugins/IgnorePlugin.d.ts
Expand Up @@ -7,17 +7,17 @@
export type IgnorePluginOptions =
| {
/**
* A RegExp to test the context (directory) against
* A RegExp to test the context (directory) against.
*/
contextRegExp?: RegExp;
/**
* A RegExp to test the request against
* A RegExp to test the request against.
*/
resourceRegExp?: RegExp;
}
| {
/**
* A filter function for resource and context
* A filter function for resource and context.
*/
checkResource?: (resource: string, context: string) => boolean;
};
2 changes: 1 addition & 1 deletion declarations/plugins/JsonModulesPluginParser.d.ts
Expand Up @@ -6,7 +6,7 @@

export interface JsonModulesPluginParserOptions {
/**
* Function that executes for a module source string and should return json-compatible data
* Function that executes for a module source string and should return json-compatible data.
*/
parse?: (input: string) => any;
}
8 changes: 4 additions & 4 deletions declarations/plugins/LoaderOptionsPlugin.d.ts
Expand Up @@ -6,19 +6,19 @@

export interface LoaderOptionsPluginOptions {
/**
* Whether loaders should be in debug mode or not. debug will be removed as of webpack 3
* Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
*/
debug?: boolean;
/**
* Where loaders can be switched to minimize mode
* Where loaders can be switched to minimize mode.
*/
minimize?: boolean;
/**
* A configuration object that can be used to configure older loaders
* A configuration object that can be used to configure older loaders.
*/
options?: {
/**
* The context that can be used to configure older loaders
* The context that can be used to configure older loaders.
*/
context?: string;
[k: string]: any;
Expand Down

0 comments on commit 361cd7a

Please sign in to comment.