From 1c5ed8157763aa85f6fdfcf820127b518691c649 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Fri, 18 Apr 2014 21:18:09 +0100 Subject: [PATCH] Export Node functions for creating decipher correctly * createDecipher() and createDecipheriv() are functions in the crypto module, not methods of the Cipher interface. * Add pbkdf2Sync() decl --- node/node.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 42398496e..34862f4b7 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1031,9 +1031,9 @@ declare module "crypto" { update(data: any, input_encoding?: string, output_encoding?: string): string; final(output_encoding?: string): string; setAutoPadding(auto_padding: boolean): void; - createDecipher(algorithm: string, password: any): Decipher; - createDecipheriv(algorithm: string, key: any, iv: any): Decipher; } + export function createDecipher(algorithm: string, password: any): Decipher; + export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; interface Decipher { update(data: any, input_encoding?: string, output_encoding?: string): void; final(output_encoding?: string): string; @@ -1063,6 +1063,7 @@ declare module "crypto" { } export function getDiffieHellman(group_name: string): DiffieHellman; export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: string) => any): void; + export function pbkdf2Sync(password: string, salt: string, iterations: number, keylen: number) : NodeBuffer; export function randomBytes(size: number): NodeBuffer; export function randomBytes(size: number, callback: (err: Error, buf: NodeBuffer) =>void ): void; export function pseudoRandomBytes(size: number): NodeBuffer;