1 | export type Task<T> = () => Promise<T>;
|
2 | export type WorkerResult = import("./index").WorkerResult;
|
3 | export type SquooshOptions = import("./index").SquooshOptions;
|
4 | export type ImageminOptions = import("imagemin").Options;
|
5 | export type WebpackError = import("webpack").WebpackError;
|
6 | export type Uint8ArrayUtf8ByteString = (
|
7 | array: number[] | Uint8Array,
|
8 | start: number,
|
9 | end: number
|
10 | ) => string;
|
11 | export type StringToBytes = (string: string) => number[];
|
12 | export type MetaData = {
|
13 | warnings: Array<Error>;
|
14 | errors: Array<Error>;
|
15 | };
|
16 | export type SharpLib = typeof import("sharp");
|
17 | export type Sharp = import("sharp").Sharp;
|
18 | export type ResizeOptions = import("sharp").ResizeOptions & {
|
19 | enabled?: boolean;
|
20 | };
|
21 | export type SharpEncodeOptions = {
|
22 | avif?: import("sharp").AvifOptions | undefined;
|
23 | gif?: import("sharp").GifOptions | undefined;
|
24 | heif?: import("sharp").HeifOptions | undefined;
|
25 | jpeg?: import("sharp").JpegOptions | undefined;
|
26 | jpg?: import("sharp").JpegOptions | undefined;
|
27 | png?: import("sharp").PngOptions | undefined;
|
28 | webp?: import("sharp").WebpOptions | undefined;
|
29 | };
|
30 | export type SharpFormat = keyof SharpEncodeOptions;
|
31 | export type SharpOptions = {
|
32 | resize?: ResizeOptions | undefined;
|
33 | rotate?: number | "auto" | undefined;
|
34 | sizeSuffix?: SizeSuffix | undefined;
|
35 | encodeOptions?: SharpEncodeOptions | undefined;
|
36 | };
|
37 | export type SizeSuffix = (width: number, height: number) => string;
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | export function throttleAll<T>(limit: number, tasks: Task<T>[]): Promise<T[]>;
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | export function isAbsoluteURL(url: string): boolean;
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | export function imageminNormalizeConfig<T>(
|
61 | imageminConfig: ImageminOptions
|
62 | ): Promise<ImageminOptions>;
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | export function imageminMinify<T>(
|
70 | original: WorkerResult,
|
71 | options: T
|
72 | ): Promise<WorkerResult>;
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | export function imageminGenerate<T>(
|
80 | original: WorkerResult,
|
81 | minimizerOptions: T
|
82 | ): Promise<WorkerResult>;
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | export function squooshMinify<T>(
|
90 | original: WorkerResult,
|
91 | options: T
|
92 | ): Promise<WorkerResult>;
|
93 | export namespace squooshMinify {
|
94 | export { squooshImagePoolSetup as setup };
|
95 | export { squooshImagePoolTeardown as teardown };
|
96 | }
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | export function squooshGenerate<T>(
|
104 | original: WorkerResult,
|
105 | minifyOptions: T
|
106 | ): Promise<WorkerResult>;
|
107 | export namespace squooshGenerate {
|
108 | export { squooshImagePoolSetup as setup };
|
109 | export { squooshImagePoolTeardown as teardown };
|
110 | }
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 | export function sharpMinify<T>(
|
118 | original: WorkerResult,
|
119 | options: T
|
120 | ): Promise<WorkerResult>;
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | export function sharpGenerate<T>(
|
128 | original: WorkerResult,
|
129 | minimizerOptions: T
|
130 | ): Promise<WorkerResult>;
|
131 | declare function squooshImagePoolSetup(): void;
|
132 | declare function squooshImagePoolTeardown(): Promise<void>;
|
133 | export {};
|