easy-tinypng-new-cli
Version:
A cli can be used to compress images with tinypng.com
26 lines (25 loc) • 1.01 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import fs from 'node:fs';
import type { Encoding } from 'node:crypto';
export declare const isBoolean: (arg: unknown) => arg is boolean;
export declare const isNotFalse: (arg: unknown) => arg is boolean;
export declare const isImageExp: (fileName: string) => boolean;
export declare function debug(...args: any[]): void;
export declare function walkSync(currentDirPath: string, callback: (filePath: string, dirent: fs.Dirent) => void): void;
/**
* 获得内容的hash值
*
* @param {String} content 文件内容
* @param {String} encoding 文件的编码,例如:'utf8' 等
* @param {String} type hash算法,例如:'md5'、'sha1'、'sha256'、'sha512' 等
* @returns {String}
*/
export declare function getHash(content: any, encoding: Encoding, type: string): string;
/**
* 获得文件的hash值
*
* @param {String} filePath 文件路径
* @returns {String}
*/
export declare function getHashOfFile(filePath: string): string;