@azure-tools/async-io
Version:
Asynchronous IO (for Azure Open Source Projects)
38 lines • 1.82 kB
TypeScript
/// <reference types="node" />
import { Exception } from '@azure-tools/tasks';
import * as fs from 'fs';
import { Url, URL } from 'url';
export declare class PathNotFoundException extends Exception {
exitCode: number;
constructor(path: string, exitCode?: number);
}
export declare class PathIsNotFileException extends Exception {
exitCode: number;
constructor(path: string, exitCode?: number);
}
export declare class PathIsNotDirectoryException extends Exception {
exitCode: number;
constructor(path: string, exitCode?: number);
}
export declare class UnableToRemoveException extends Exception {
exitCode: number;
constructor(path: string, exitCode?: number);
}
export declare class UnableToMakeDirectoryException extends Exception {
exitCode: number;
constructor(path: string, exitCode?: number);
}
export declare function filePath(path: string | Buffer | Url | URL): string;
export declare const exists: typeof fs.exists.__promisify__;
export declare const readdir: (path: string | Buffer) => Promise<Array<string>>;
export declare const close: (fd: number) => Promise<void>;
export declare const writeFile: (filename: string, content: string | Buffer) => Promise<void>;
export declare const lstat: (path: string | Buffer) => Promise<fs.Stats>;
export declare function isDirectory(dirPath: string): Promise<boolean>;
export declare function mkdir(dirPath: string): Promise<void>;
export declare function readFile(filename: string): Promise<string>;
export declare function readBinaryFile(filename: string): Promise<string>;
export declare function isFile(filePath: string): Promise<boolean>;
export declare function rmdir(dirPath: string, exceptions?: Set<string>): Promise<void>;
export declare function rmFile(filePath: string): Promise<void>;
//# sourceMappingURL=file-io.d.ts.map