Skip to content

Commit

Permalink
Merge pull request #33 from jedigo/master
Browse files Browse the repository at this point in the history
updated crypto definitions to use buffers / added setImmediate
  • Loading branch information
soywiz committed Oct 15, 2013
2 parents 429f337 + 65e5b4d commit fa1c665
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions node.d.ts
Expand Up @@ -19,6 +19,8 @@ declare function setTimeout(callback: () => void , ms: number): any;
declare function clearTimeout(timeoutId: any);
declare function setInterval(callback: () => void , ms: number): any;
declare function clearInterval(intervalId: any);
declare function setImmediate(callback: () => void , ... args[]:any): any;
declare function clearImmediate(immediateId: any);

declare var require: {
(id: string): any;
Expand Down Expand Up @@ -921,6 +923,7 @@ declare module "crypto" {
export function createCredentials(details: CredentialDetails): Credentials;
export function createHash(algorithm: string): Hash;
export function createHmac(algorithm: string, key: string): Hmac;
export function createHmac(algorithm: string, key: NodeBuffer): Hmac;
export interface Hash {
update(data: any, input_encoding?: string): Hash;
digest(encoding?: string): any;
Expand All @@ -932,15 +935,19 @@ declare module "crypto" {
export function createCipher(algorithm: string, password: any): Cipher;
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
export interface Cipher {
update(data: any, input_encoding?: string, output_encoding?: string): string;
final(output_encoding?: string): string;
update(data: any, input_encoding: string, output_encoding: string): string;
update(data: any, input_encoding?: string): NodeBuffer;
final(output_encoding: string): string;
final(): NodeBuffer;
setAutoPadding(auto_padding: boolean): void;
}
export function createDecipher(algorithm: string, password: any): Decipher;
export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
export interface Decipher {
update(data: any, input_encoding?: string, output_encoding?: string): void;
final(output_encoding?: string): string;
update(data: any, input_encoding: string, output_encoding: string): string;
update(data: any, input_encoding?: string): NodeBuffer;
final(output_encoding: string): string;
final(): NodeBuffer;
setAutoPadding(auto_padding: boolean): void;
}
export function createSign(algorithm: string): Signer;
Expand All @@ -967,7 +974,8 @@ 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 randomBytes(size: number, callback?: (err: Error, buf: NodeBuffer) =>void );
export function randomBytes(size: number, callback?: (err: Error, buf: NodeBuffer) => void) : NodeBuffer;
export function pseudoRandomBytes(size: number, callback?: (err: Error, buf: NodeBuffer) => void) : NodeBuffer;
}

declare module "stream" {
Expand Down

0 comments on commit fa1c665

Please sign in to comment.