From aed3e0fc50c4ff560dd8d412256565c928c0398d Mon Sep 17 00:00:00 2001 From: John Vilk Date: Fri, 27 Sep 2013 14:46:39 -0400 Subject: [PATCH] Adding missing method signatures and fixing incorrect method signatures. The following missing methods were added: * fs.readlinkSync * fs.ftruncate * fs.ftruncateSync The following method signatures were fixed: * path.resolve: Takes an array of arbitrary length. This does not necessarily need to be a string array; resolve skips any non-string elements. * process.cwd: Returns a string, not void. --- node/node.d.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 9ae2d75ae..341b63c46 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -106,7 +106,7 @@ interface NodeProcess extends EventEmitter { execPath: string; abort(): void; chdir(directory: string): void; - cwd(): void; + cwd(): string; env: any; exit(code?: number): void; getgid(): number; @@ -725,8 +725,10 @@ declare module "fs" { export function rename(oldPath: string, newPath: string, callback?: Function): void; export function renameSync(oldPath: string, newPath: string): void; - export function truncate(fd: string, len: number, callback?: Function): void; - export function truncateSync(fd: string, len: number): void; + export function truncate(path: string, len: number, callback?: Function): void; + export function truncateSync(path: string, len: number): 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; @@ -750,6 +752,7 @@ declare module "fs" { export function symlink(srcpath: string, dstpath: string, type?: string, callback?: Function): void; export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; export function readlink(path: string, callback?: (err: Error, linkString: string) =>any): void; + export function readlinkSync(path: string): string; export function realpath(path: string, callback?: (err: Error, resolvedPath: string) =>any): void; export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) =>any): void; export function realpathSync(path: string, cache?: string): void; @@ -808,12 +811,7 @@ declare module "fs" { declare module "path" { export function normalize(p: string): string; export function join(...paths: any[]): string; - export function resolve(to: string): string; - export function resolve(from: string, to: string): string; - export function resolve(from: string, from2: string, to: string): string; - export function resolve(from: string, from2: string, from3: string, to: string): string; - export function resolve(from: string, from2: string, from3: string, from4: string, to: string): string; - export function resolve(from: string, from2: string, from3: string, from4: string, from5: string, to: string): string; + export function resolve(...pathSegments: any[]): string; export function relative(from: string, to: string): string; export function dirname(p: string): string; export function basename(p: string, ext?: string): string;