UNPKG

@microsoft.azure/async-io

Version:

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

35 lines (34 loc) 1.59 kB
/// <reference types="node" /> import * as fs from "fs"; import { Exception } from '@microsoft.azure/tasks'; 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 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) => 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>;