From a0ffa74fd9f2400b1faf4829a1be67080ea0a1cf Mon Sep 17 00:00:00 2001 From: Joshua DeVinney Date: Tue, 20 Sep 2016 07:55:39 -0500 Subject: [PATCH] Adding back the Stats interface, just extending it from fs.Stats instead --- fs-extra-promise-es6/index.d.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/fs-extra-promise-es6/index.d.ts b/fs-extra-promise-es6/index.d.ts index e67503e559..3c9e227fbb 100644 --- a/fs-extra-promise-es6/index.d.ts +++ b/fs-extra-promise-es6/index.d.ts @@ -11,6 +11,9 @@ import stream = require("stream"); import fs = require("fs"); +export interface Stats extends fs.Stats { +} + export interface FSWatcher { close(): void; } @@ -84,12 +87,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: 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 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 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; @@ -136,9 +139,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: 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 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 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; @@ -207,9 +210,9 @@ export declare function fchmodAsync(fd: number, mode: number): Promise; export declare function fchmodAsync(fd: number, mode: string): Promise; export declare function lchmodAsync(path: string, mode: string): Promise; export declare function lchmodAsync(path: string, mode: number): Promise; -export declare function statAsync(path: string): Promise; -export declare function lstatAsync(path: string): Promise; -export declare function fstatAsync(fd: number): Promise; +export declare function statAsync(path: string): Promise; +export declare function lstatAsync(path: string): Promise; +export declare function fstatAsync(fd: number): Promise; export declare function linkAsync(srcpath: string, dstpath: string): Promise; export declare function symlinkAsync(srcpath: string, dstpath: string, type?: string): Promise; export declare function readlinkAsync(path: string): Promise;