Skip to content

Commit 63625c0

Browse files
fix: types
1 parent 3eb75bb commit 63625c0

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

types/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ declare namespace TerserPlugin {
7171
uglifyJsMinify,
7272
swcMinify,
7373
esbuildMinify,
74+
jsonMinify,
7475
Schema,
7576
Compiler,
7677
Compilation,
@@ -112,6 +113,7 @@ import { terserMinify } from "./utils";
112113
import { uglifyJsMinify } from "./utils";
113114
import { swcMinify } from "./utils";
114115
import { esbuildMinify } from "./utils";
116+
import { jsonMinify } from "./utils";
115117
type Schema = import("schema-utils/declarations/validate").Schema;
116118
type Compiler = import("webpack").Compiler;
117119
type Compilation = import("webpack").Compilation;
@@ -250,6 +252,10 @@ type MinimizeFunctionHelpers = {
250252
* true when minimizer support worker threads, otherwise false
251253
*/
252254
supportsWorkerThreads?: (() => boolean | undefined) | undefined;
255+
/**
256+
* true when minimizer support worker, otherwise false
257+
*/
258+
supportsWorker?: (() => boolean | undefined) | undefined;
253259
};
254260
type MinimizerImplementation<T> = BasicMinimizerImplementation<T> &
255261
MinimizeFunctionHelpers;

types/utils.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ export namespace esbuildMinify {
3333
*/
3434
function supportsWorkerThreads(): boolean | undefined;
3535
}
36+
/**
37+
* @param {Input} input input
38+
* @param {RawSourceMap=} sourceMap source map
39+
* @param {CustomOptions=} minimizerOptions options
40+
* @returns {Promise<MinimizedResult>} minimized result
41+
*/
42+
export function jsonMinify(
43+
input: Input,
44+
sourceMap?: RawSourceMap | undefined,
45+
minimizerOptions?: CustomOptions | undefined,
46+
): Promise<MinimizedResult>;
47+
export namespace jsonMinify {
48+
function getMinimizerVersion(): string;
49+
function supportsWorker(): boolean;
50+
function supportsWorkerThreads(): boolean;
51+
}
3652
/**
3753
* @template T
3854
* @typedef {() => T} FunctionReturning

0 commit comments

Comments
 (0)