1 | export = JsonMinimizerPlugin;
|
2 | /** @typedef {import("schema-utils/declarations/validate").Schema} Schema */
|
3 | /** @typedef {import("webpack").Compiler} Compiler */
|
4 | /** @typedef {import("webpack").Compilation} Compilation */
|
5 | /** @typedef {import("webpack").Asset} Asset */
|
6 | /** @typedef {import("webpack").WebpackError} WebpackError */
|
7 | /** @typedef {RegExp | string} Rule */
|
8 | /** @typedef {Rule[] | Rule} Rules */
|
9 | /**
|
10 | * @typedef {Object} JSONOptions
|
11 | * @property {(this: any, key: string, value: any) => any | (number | string)[] | null} [replacer]
|
12 | * @property {string | number} [space]
|
13 | */
|
14 | /**
|
15 | * @typedef {Object} BasePluginOptions
|
16 | * @property {Rule} [test]
|
17 | * @property {Rule} [include]
|
18 | * @property {Rule} [exclude]
|
19 | * @property {JSONOptions} [minimizerOptions]
|
20 | */
|
21 | /**
|
22 | * @typedef {Object} MinimizedResult
|
23 | * @property {string} code
|
24 | */
|
25 | /**
|
26 | * @typedef {Object} InternalOptions
|
27 | * @property {string} input
|
28 | * @property {JSONOptions} [minimizerOptions]
|
29 | */
|
30 | /**
|
31 | * @typedef {BasePluginOptions} InternalPluginOptions
|
32 | */
|
33 | declare class JsonMinimizerPlugin {
|
34 | /**
|
35 | * @param {any} error
|
36 | * @param {string} file
|
37 | * @param {string} context
|
38 | * @returns {Error}
|
39 | */
|
40 | static buildError(error: any, file: string, context: string): Error;
|
41 | /**
|
42 | * @param {BasePluginOptions} [options]
|
43 | */
|
44 | constructor(options?: BasePluginOptions | undefined);
|
45 | /**
|
46 | * @private
|
47 | * @type {InternalPluginOptions}
|
48 | */
|
49 | private options;
|
50 | /**
|
51 | * @private
|
52 | * @param {Compiler} compiler
|
53 | * @param {Compilation} compilation
|
54 | * @param {Record<string, import("webpack").sources.Source>} assets
|
55 | * @returns {Promise<void>}
|
56 | */
|
57 | private optimize;
|
58 | /**
|
59 | * @param {Compiler} compiler
|
60 | * @returns {void}
|
61 | */
|
62 | apply(compiler: Compiler): void;
|
63 | }
|
64 | declare namespace JsonMinimizerPlugin {
|
65 | export {
|
66 | Schema,
|
67 | Compiler,
|
68 | Compilation,
|
69 | Asset,
|
70 | WebpackError,
|
71 | Rule,
|
72 | Rules,
|
73 | JSONOptions,
|
74 | BasePluginOptions,
|
75 | MinimizedResult,
|
76 | InternalOptions,
|
77 | InternalPluginOptions,
|
78 | };
|
79 | }
|
80 | type Schema = import("schema-utils/declarations/validate").Schema;
|
81 | type Compiler = import("webpack").Compiler;
|
82 | type Compilation = import("webpack").Compilation;
|
83 | type Asset = import("webpack").Asset;
|
84 | type WebpackError = import("webpack").WebpackError;
|
85 | type Rule = RegExp | string;
|
86 | type Rules = Rule[] | Rule;
|
87 | type JSONOptions = {
|
88 | replacer?:
|
89 | | ((this: any, key: string, value: any) => any | (number | string)[] | null)
|
90 | | undefined;
|
91 | space?: string | number | undefined;
|
92 | };
|
93 | type BasePluginOptions = {
|
94 | test?: Rule | undefined;
|
95 | include?: Rule | undefined;
|
96 | exclude?: Rule | undefined;
|
97 | minimizerOptions?: JSONOptions | undefined;
|
98 | };
|
99 | type MinimizedResult = {
|
100 | code: string;
|
101 | };
|
102 | type InternalOptions = {
|
103 | input: string;
|
104 | minimizerOptions?: JSONOptions | undefined;
|
105 | };
|
106 | type InternalPluginOptions = BasePluginOptions;
|
107 |
|
\ | No newline at end of file |