UNPKG

@microsoft.azure/async-io

Version:

Promisify'd asnyc wrappers (for Azure Open Source Projects)

37 lines 1.74 kB
/// <reference types="node" /> import { Exception } from '@microsoft.azure/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: (path: string | Buffer) => Promise<boolean>; 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 mkdir(dirPath: string): Promise<void>; export declare function readFile(filename: string): Promise<string>; export declare function isDirectory(dirPath: string): Promise<boolean>; export declare function isFile(filePath: string): Promise<boolean>; export declare function rmdir(dirPath: string): Promise<void>; export declare function rmFile(filePath: string): Promise<void>; //# sourceMappingURL=file-io.d.ts.map