Skip to content

Commit c26745f

Browse files
committed
chore: fix types
1 parent 90ba772 commit c26745f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

types/index.d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ declare class HtmlMinimizerPlugin<
1313
> {
1414
/**
1515
* @private
16-
* @param {any} warning The warning to build
16+
* @param {EXPECTED_ANY} warning The warning to build
1717
* @param {string} file The file path
1818
* @returns {Error & { hideStack?: boolean, file?: string } | undefined} The built warning
1919
*/
2020
private static buildWarning;
2121
/**
2222
* @private
23-
* @param {any} error The error to build
23+
* @param {EXPECTED_ANY} error The error to build
2424
* @param {string} file The file path
2525
* @returns {Error} The built error
2626
*/
@@ -76,6 +76,7 @@ declare namespace HtmlMinimizerPlugin {
7676
JestWorker,
7777
Rule,
7878
Rules,
79+
EXPECTED_ANY,
7980
Warning,
8081
WarningObject,
8182
ErrorObject,
@@ -110,6 +111,7 @@ type Asset = import("webpack").Asset;
110111
type JestWorker = import("jest-worker").Worker;
111112
type Rule = RegExp | string;
112113
type Rules = Rule[] | Rule;
114+
type EXPECTED_ANY = any;
113115
type Warning =
114116
| (Error & {
115117
plugin?: string;
@@ -176,7 +178,7 @@ type Input = {
176178
[file: string]: string;
177179
};
178180
type CustomOptions = {
179-
[key: string]: any;
181+
[key: string]: EXPECTED_ANY;
180182
};
181183
type InferDefaultType<T> = T extends infer U ? U : CustomOptions;
182184
type MinimizerOptions<T> = T extends any[]

types/utils.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export type Task<T> = () => Promise<T>;
22
export type MinimizedResult = import("./index.js").MinimizedResult;
33
export type CustomOptions = import("./index.js").CustomOptions;
44
export type Input = import("./index.js").Input;
5+
export type EXPECTED_ANY = any;
56
/**
67
* @param {Input} input The input to minify
78
* @param {CustomOptions=} minimizerOptions The minimizer options
@@ -24,10 +25,10 @@ export namespace htmlMinifierTerser {
2425
}
2526
/**
2627
* @template T
27-
* @param {(() => any) | undefined} fn The function to memoize
28+
* @param {(() => EXPECTED_ANY) | undefined} fn The function to memoize
2829
* @returns {() => T} The memoized function
2930
*/
30-
export function memoize<T>(fn: (() => any) | undefined): () => T;
31+
export function memoize<T>(fn: (() => EXPECTED_ANY) | undefined): () => T;
3132
/**
3233
* @param {Input} input The input to minify
3334
* @param {CustomOptions=} minimizerOptions The minimizer options

0 commit comments

Comments
 (0)