UNPKG

2.09 kBTypeScriptView Raw
1export = loader;
2/** @typedef {import("schema-utils/declarations/validate").Schema} Schema */
3/** @typedef {import("webpack").Compilation} Compilation */
4/**
5 * @template T
6 * @typedef {Object} LoaderOptions<T>
7 * @property {string} [severityError] Allows to choose how errors are displayed.
8 * @property {import("./index").Minimizer<T> | import("./index").Minimizer<T>[]} [minimizer]
9 * @property {import("./index").Generator<T>[]} [generator]
10 */
11/**
12 * @template T
13 * @this {import("webpack").LoaderContext<LoaderOptions<T>>}
14 * @param {Buffer} content
15 * @returns {Promise<Buffer | undefined>}
16 */
17declare function loader<T>(
18 this: import("webpack").LoaderContext<LoaderOptions<T>>,
19 content: Buffer
20): Promise<Buffer | undefined>;
21declare class loader<T> {
22 /** @typedef {import("schema-utils/declarations/validate").Schema} Schema */
23 /** @typedef {import("webpack").Compilation} Compilation */
24 /**
25 * @template T
26 * @typedef {Object} LoaderOptions<T>
27 * @property {string} [severityError] Allows to choose how errors are displayed.
28 * @property {import("./index").Minimizer<T> | import("./index").Minimizer<T>[]} [minimizer]
29 * @property {import("./index").Generator<T>[]} [generator]
30 */
31 /**
32 * @template T
33 * @this {import("webpack").LoaderContext<LoaderOptions<T>>}
34 * @param {Buffer} content
35 * @returns {Promise<Buffer | undefined>}
36 */
37 constructor(
38 this: import("webpack").LoaderContext<LoaderOptions<T>>,
39 content: Buffer
40 );
41 resourcePath: string | undefined;
42 resourceQuery: string | undefined;
43}
44declare namespace loader {
45 export { raw, Schema, Compilation, LoaderOptions };
46}
47/**
48 * <T>
49 */
50type LoaderOptions<T> = {
51 /**
52 * Allows to choose how errors are displayed.
53 */
54 severityError?: string | undefined;
55 minimizer?:
56 | import("./index").Minimizer<T>
57 | import("./index").Minimizer<T>[]
58 | undefined;
59 generator?: import("./index").Generator<T>[] | undefined;
60};
61declare var raw: boolean;
62type Schema = import("schema-utils/declarations/validate").Schema;
63type Compilation = import("webpack").Compilation;