2025-05-12 05:38:44 +09:00

65 lines
1.8 KiB
TypeScript

import fs from "fs";
declare function writeStream(filename: any, st: any): any;
declare function fileExists(filename: any): any;
declare function genTmpFile(opts: any): any;
/**
* Generate temporary dir
* @deprecated use tmpdir.ts
* @param opts
*/
declare function genTmpDir(opts: any): any;
declare function download(uri: string, destFilePath: string): Promise<any>;
declare function uniqueFilename(base: any, filename: any): any;
declare function ensureFile(filename: any): any;
declare function rmDir(base: any): any;
/**
Assert a file, if it doesn't exist, call "generator"
@param {string} filePath
@param {Function} generator
@return {Promise}
*/
declare function assertFile(filePath: any, generator: any): any;
/**
Pick a file, returns the absolute path if exists, undefined otherwise
@param {string} rootFolder
@param {string} fileName
@return {string}
*/
declare function pickFile(rootFolder: any, fileName: any): string;
/**
Ensure that a directory exists and is empty
@param {string} folder
@return {Promise}
*/
declare function ensureFolder(rootFolder: any): any;
declare const _default: {
exists: typeof fileExists;
existsSync: typeof fs.existsSync;
mkdirp: any;
readFile: any;
writeFile: (filePath: any, content: any) => any;
assertFile: typeof assertFile;
pickFile: typeof pickFile;
stat: any;
statSync: fs.StatSyncFn;
readdir: any;
writeStream: typeof writeStream;
readStream: typeof fs.createReadStream;
copy: any;
copyDir: any;
tmpFile: typeof genTmpFile;
/**
* @deprecated use tmpdir.ts
*/
tmpDir: typeof genTmpDir;
download: typeof download;
uniqueFilename: typeof uniqueFilename;
ensureFile: typeof ensureFile;
ensureFolder: typeof ensureFolder;
rmDir: typeof rmDir;
};
export default _default;
//# sourceMappingURL=fs.d.ts.map