diff --git a/node/node.d.ts b/node/node.d.ts index 7aa5964838..a57fb96d13 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -752,33 +752,33 @@ declare module "fs" { export function truncate(path: string, callback?: Function): void; export function truncate(path: string, len: number, callback?: Function): void; export function truncateSync(path: string, len?: number): void; - export function ftruncate(fd: string, callback?: Function): void; - export function ftruncate(fd: string, len: number, callback?: Function): void; - export function ftruncateSync(fd: string, len?: number): void; + export function ftruncate(fd: number, callback?: Function): void; + export function ftruncate(fd: number, len: number, callback?: Function): void; + export function ftruncateSync(fd: number, len?: number): void; export function chown(path: string, uid: number, gid: number, callback?: Function): void; export function chownSync(path: string, uid: number, gid: number): void; - export function fchown(fd: string, uid: number, gid: number, callback?: Function): void; - export function fchownSync(fd: string, uid: number, gid: number): void; + export function fchown(fd: number, uid: number, gid: number, callback?: Function): void; + export function fchownSync(fd: number, uid: number, gid: number): void; export function lchown(path: string, uid: number, gid: number, callback?: Function): void; export function lchownSync(path: string, uid: number, gid: number): void; export function chmod(path: string, mode: number, callback?: Function): void; export function chmod(path: string, mode: string, callback?: Function): void; export function chmodSync(path: string, mode: number): void; export function chmodSync(path: string, mode: string): void; - export function fchmod(fd: string, mode: number, callback?: Function): void; - export function fchmod(fd: string, mode: string, callback?: Function): void; - export function fchmodSync(fd: string, mode: number): void; - export function fchmodSync(fd: string, mode: string): void; + export function fchmod(fd: number, mode: number, callback?: Function): void; + export function fchmod(fd: number, mode: string, callback?: Function): void; + export function fchmodSync(fd: number, mode: number): void; + export function fchmodSync(fd: number, mode: string): void; export function lchmod(path: string, mode: number, callback?: Function): void; export function lchmod(path: string, mode: string, callback?: Function): void; export function lchmodSync(path: string, mode: number): void; export function lchmodSync(path: string, mode: string): void; export function stat(path: string, callback?: (err: Error, stats: Stats) => any): void; export function lstat(path: string, callback?: (err: Error, stats: Stats) => any): void; - export function fstat(fd: string, callback?: (err: Error, stats: Stats) => any): void; + export function fstat(fd: number, callback?: (err: Error, stats: Stats) => any): void; export function statSync(path: string): Stats; export function lstatSync(path: string): Stats; - export function fstatSync(fd: string): Stats; + export function fstatSync(fd: number): Stats; export function link(srcpath: string, dstpath: string, callback?: Function): void; export function linkSync(srcpath: string, dstpath: string): void; export function symlink(srcpath: string, dstpath: string, type?: string, callback?: Function): void; @@ -799,23 +799,23 @@ declare module "fs" { export function mkdirSync(path: string, mode?: string): void; export function readdir(path: string, callback?: (err: Error, files: string[]) => void): void; export function readdirSync(path: string): string[]; - export function close(fd: string, callback?: Function): void; - export function closeSync(fd: string): void; - export function open(path: string, flags: string, callback?: (err: Error, fd: string) => any): void; - export function open(path: string, flags: string, mode: number, callback?: (err: Error, fd: string) => any): void; - export function open(path: string, flags: string, mode: string, callback?: (err: Error, fd: string) => any): void; - export function openSync(path: string, flags: string, mode?: number): void; - export function openSync(path: string, flags: string, mode?: string): void; + export function close(fd: number, callback?: Function): void; + export function closeSync(fd: number): void; + export function open(path: string, flags: string, callback?: (err: Error, fd: number) => any): void; + export function open(path: string, flags: string, mode: number, callback?: (err: Error, fd: number) => any): void; + export function open(path: string, flags: string, mode: string, callback?: (err: Error, fd: number) => any): void; + export function openSync(path: string, flags: string, mode?: number): number; + export function openSync(path: string, flags: string, mode?: string): number; export function utimes(path: string, atime: number, mtime: number, callback?: Function): void; export function utimesSync(path: string, atime: number, mtime: number): void; - export function futimes(fd: string, atime: number, mtime: number, callback?: Function): void; - export function futimesSync(fd: string, atime: number, mtime: number): void; - export function fsync(fd: string, callback?: Function): void; - export function fsyncSync(fd: string): void; - export function write(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) =>any): void; - export function writeSync(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number): void; - export function read(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void; - export function readSync(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number): any[]; + export function futimes(fd: number, atime: number, mtime: number, callback?: Function): void; + export function futimesSync(fd: number, atime: number, mtime: number): void; + export function fsync(fd: number, callback?: Function): void; + export function fsyncSync(fd: number): void; + export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void; + export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; + export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void; + export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err: Error, data: any) => void): void; export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void; export function readFileSync(filename: string, options?: { flag?: string; }): NodeBuffer; @@ -830,11 +830,11 @@ declare module "fs" { export function appendFile(filename: string, data: any, callback?: (err: Error) => void): void; export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function watchFile(filename: string, listener: (curr: Stats, prev: Stats)=>void): void; - export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats)=>void): void; - export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats)=>void): void; - export function watch(filename: string, listener?: (event: string, filename: string) =>any): FSWatcher; - export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) =>any): FSWatcher; + export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; + export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; + export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; + export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; + export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; export function exists(path: string, callback?: (exists: boolean) => void): void; export function existsSync(path: string): boolean; export function createReadStream(path: string, options?: { @@ -1142,7 +1142,7 @@ declare module "assert" { declare module "tty" { import net = require("net"); - export function isatty(fd: string): boolean; + export function isatty(fd: number): boolean; export interface ReadStream extends net.NodeSocket { isRaw: boolean; setRawMode(mode: boolean): void;