blob: 1c9917a0b977eab128a316ab4d2ab9fc655bb145 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/**
* Module convert fs functions to promise based functions
*/
/// <reference types="node" />
import * as fs from 'fs';
export interface IReadResult {
bytesRead: number;
buffer: Buffer;
}
export declare const pathExists: typeof fs.existsSync;
export declare const createReadStream: typeof fs.createReadStream;
export declare function stat(path: fs.PathLike): Promise<fs.Stats>;
export declare function close(fd: number): Promise<void>;
export declare function open(path: fs.PathLike, mode?: string): Promise<number>;
export declare function read(fd: number, buffer: Buffer, offset: number, length: number, position: number): Promise<IReadResult>;
export declare function writeFile(path: fs.PathLike, data: Buffer | string): Promise<void>;
export declare function writeFileSync(path: fs.PathLike, data: Buffer | string): void;
export declare function readFile(path: fs.PathLike): Promise<Buffer>;
|