/// /// /// /// import stream from 'node:stream'; import fs from 'fs-extra'; export declare const pipeline: typeof stream.pipeline.__promisify__; export declare function getParentDir(fileName: string): string; export declare function getSiblingFileName(fileName: string, siblingName: string): string; export declare function readLocalFile(fileName: string): Promise; export declare function readLocalFile(fileName: string, encoding: 'utf8'): Promise; export declare function readLocalSymlink(fileName: string): Promise; export declare function writeLocalFile(fileName: string, fileContent: string | Buffer): Promise; export declare function deleteLocalFile(fileName: string): Promise; export declare function renameLocalFile(fromFile: string, toFile: string): Promise; export declare function ensureDir(dirName: string): Promise; export declare function ensureLocalDir(dirName: string): Promise; export declare function ensureCacheDir(name: string): Promise; /** * Return the path of the private cache directory. This directory is wiped * between repositories, so they can be used to store private registries' index * without risk of that information leaking to other repositories/users. */ export declare function privateCacheDir(): string; export declare function localPathExists(pathName: string): Promise; /** * Validate local path without throwing. * @param path Path to check * @returns `true` if given `path` is a valid local path, otherwise `false`. */ export declare function isValidLocalPath(path: string): boolean; /** * Tries to find `otherFileName` in the directory where * `existingFileNameWithPath` is, then in its parent directory, then in the * grandparent, until we reach the top-level directory. All paths * must be relative to `localDir`. */ export declare function findLocalSiblingOrParent(existingFileNameWithPath: string, otherFileName: string): Promise; /** * Get files by name from directory */ export declare function readLocalDirectory(path: string): Promise; export declare function createCacheWriteStream(path: string): fs.WriteStream; export declare function localPathIsFile(pathName: string): Promise; export declare function localPathIsSymbolicLink(pathName: string): Promise; /** * Find a file or directory by walking up parent directories within localDir */ export declare function findUpLocal(fileName: string | string[], cwd: string): Promise; export declare function chmodLocalFile(fileName: string, mode: string | number): Promise; export declare function statLocalFile(fileName: string): Promise; export declare function listCacheDir(path: string, options?: { recursive: boolean; }): Promise; export declare function rmCache(path: string): Promise; export declare function cachePathExists(pathName: string): Promise; export declare function cachePathIsFile(pathName: string): Promise; export declare function readCacheFile(fileName: string): Promise; export declare function readCacheFile(fileName: string, encoding: 'utf8'): Promise; export declare function outputCacheFile(file: string, data: string | NodeJS.ArrayBufferView): Promise; export declare function readSystemFile(fileName: string): Promise; export declare function readSystemFile(fileName: string, encoding: 'utf8'): Promise; export declare function writeSystemFile(fileName: string, data: string | Buffer): Promise; export declare function getLocalFiles(fileNames: string[]): Promise>;