32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { OptionsPossible, Settings, MinifierOptions } from '@node-minify/types';
|
|
|
|
/*!
|
|
* node-minify
|
|
* Copyright(c) 2011-2023 Rodolphe Stoclin
|
|
* MIT Licensed
|
|
*/
|
|
|
|
type Utils = {
|
|
readFile: (file: string) => string;
|
|
writeFile: ({ file, content, index }: WriteFile) => string;
|
|
deleteFile: (file: string) => void;
|
|
buildArgs: (options: Record<string, OptionsPossible>) => any;
|
|
clone: (obj: object) => object;
|
|
getFilesizeInBytes: (file: string) => string;
|
|
getFilesizeGzippedInBytes: (file: string) => Promise<string>;
|
|
prettyBytes: (num: number) => string;
|
|
setFileNameMin: (file: string, output: string, publicFolder?: string, replaceInPlace?: boolean) => string;
|
|
compressSingleFile: (settings: Settings) => string | Promise<string>;
|
|
getContentFromFiles: (input: string | string[]) => string;
|
|
runSync: ({ settings, content, index }: MinifierOptions) => string;
|
|
runAsync: ({ settings, content, index }: MinifierOptions) => Promise<string>;
|
|
};
|
|
type WriteFile = {
|
|
file: string;
|
|
content: any;
|
|
index?: number;
|
|
};
|
|
declare const utils: Utils;
|
|
|
|
export { utils };
|