Making changes to fs-extra-promise-es6 to update the node definitions and reuse some definitions per @andy-ms

This commit is contained in:
Joshua DeVinney
2016-09-20 10:18:53 -05:00
parent 0a7b57e864
commit a21f098c7c
+22 -43
View File
@@ -9,29 +9,7 @@
import stream = require("stream");
export interface Stats {
isFile(): boolean;
isDirectory(): boolean;
isBlockDevice(): boolean;
isCharacterDevice(): boolean;
isSymbolicLink(): boolean;
isFIFO(): boolean;
isSocket(): boolean;
dev: number;
ino: number;
mode: number;
nlink: number;
uid: number;
gid: number;
rdev: number;
size: number;
blksize: number;
blocks: number;
atime: Date;
mtime: Date;
ctime: Date;
}
import fs = require("fs");
export interface FSWatcher {
close(): void;
@@ -106,12 +84,12 @@ export declare function lchmod(path: string, mode: string, callback?: (err: Erro
export declare function lchmod(path: string, mode: number, callback?: (err: Error) => void): void;
export declare function lchmodSync(path: string, mode: number): void;
export declare function lchmodSync(path: string, mode: string): void;
export declare function stat(path: string, callback?: (err: Error, stats: Stats) => void): void;
export declare function lstat(path: string, callback?: (err: Error, stats: Stats) => void): void;
export declare function fstat(fd: number, callback?: (err: Error, stats: Stats) => void): void;
export declare function statSync(path: string): Stats;
export declare function lstatSync(path: string): Stats;
export declare function fstatSync(fd: number): Stats;
export declare function stat(path: string, callback?: (err: Error, stats: fs.Stats) => void): void;
export declare function lstat(path: string, callback?: (err: Error, stats: fs.Stats) => void): void;
export declare function fstat(fd: number, callback?: (err: Error, stats: fs.Stats) => void): void;
export declare function statSync(path: string): fs.Stats;
export declare function lstatSync(path: string): fs.Stats;
export declare function fstatSync(fd: number): fs.Stats;
export declare function link(srcpath: string, dstpath: string, callback?: (err: Error) => void): void;
export declare function linkSync(srcpath: string, dstpath: string): void;
export declare function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err: Error) => void): void;
@@ -158,9 +136,9 @@ export declare function appendFile(filename: string, data: any, encoding?: strin
export declare function appendFile(filename: string, data: any, option?: OpenOptions, callback?: (err: Error) => void): void;
export declare function appendFileSync(filename: string, data: any, encoding?: string): void;
export declare function appendFileSync(filename: string, data: any, option?: OpenOptions): void;
export declare function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void;
export declare function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void;
export declare function unwatchFile(filename: string, listener?: Stats): void;
export declare function watchFile(filename: string, listener: { curr: fs.Stats; prev: fs.Stats; }): void;
export declare function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: fs.Stats; prev: fs.Stats; }): void;
export declare function unwatchFile(filename: string, listener?: fs.Stats): void;
export declare function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
export declare function exists(path: string, callback?: (exists: boolean) => void): void;
export declare function existsSync(path: string): boolean;
@@ -172,20 +150,21 @@ export interface OpenOptions {
flag?: string;
}
export interface ReadStreamOptions {
export declare function createReadStream(path: string | Buffer, options?: {
flags?: string;
encoding?: string;
fd?: number;
mode?: number;
bufferSize?: number;
}
export interface WriteStreamOptions {
autoClose?: boolean;
start?: number;
end?: number;
}): ReadStream;
export declare function createWriteStream(path: string | Buffer, options?: {
flags?: string;
encoding?: string;
string?: string;
}
export declare function createReadStream(path: string, options?: ReadStreamOptions): ReadStream;
export declare function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream;
fd?: number;
mode?: number;
}): WriteStream;
@@ -228,9 +207,9 @@ export declare function fchmodAsync(fd: number, mode: number): Promise<void>;
export declare function fchmodAsync(fd: number, mode: string): Promise<void>;
export declare function lchmodAsync(path: string, mode: string): Promise<void>;
export declare function lchmodAsync(path: string, mode: number): Promise<void>;
export declare function statAsync(path: string): Promise<Stats>;
export declare function lstatAsync(path: string): Promise<Stats>;
export declare function fstatAsync(fd: number): Promise<Stats>;
export declare function statAsync(path: string): Promise<fs.Stats>;
export declare function lstatAsync(path: string): Promise<fs.Stats>;
export declare function fstatAsync(fd: number): Promise<fs.Stats>;
export declare function linkAsync(srcpath: string, dstpath: string): Promise<void>;
export declare function symlinkAsync(srcpath: string, dstpath: string, type?: string): Promise<void>;
export declare function readlinkAsync(path: string): Promise<string>;