Fix Error type to be "Error | null" in crypto methods

This commit is contained in:
Ryan Staniforth
2018-06-14 10:25:43 +01:00
parent ac8c4cb9c0
commit bd1a51cec4
+9 -9
View File
@@ -5807,19 +5807,19 @@ declare module "crypto" {
verifyError: number;
}
export function getDiffieHellman(group_name: string): DiffieHellman;
export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void;
export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => any): void;
export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer;
export function randomBytes(size: number): Buffer;
export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;
export function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
export function pseudoRandomBytes(size: number): Buffer;
export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;
export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
export function randomFillSync(buffer: Buffer | Uint8Array, offset?: number, size?: number): Buffer;
export function randomFill(buffer: Buffer, callback: (err: Error, buf: Buffer) => void): void;
export function randomFill(buffer: Uint8Array, callback: (err: Error, buf: Uint8Array) => void): void;
export function randomFill(buffer: Buffer, offset: number, callback: (err: Error, buf: Buffer) => void): void;
export function randomFill(buffer: Uint8Array, offset: number, callback: (err: Error, buf: Uint8Array) => void): void;
export function randomFill(buffer: Buffer, offset: number, size: number, callback: (err: Error, buf: Buffer) => void): void;
export function randomFill(buffer: Uint8Array, offset: number, size: number, callback: (err: Error, buf: Uint8Array) => void): void;
export function randomFill(buffer: Buffer, callback: (err: Error | null, buf: Buffer) => void): void;
export function randomFill(buffer: Uint8Array, callback: (err: Error | null, buf: Uint8Array) => void): void;
export function randomFill(buffer: Buffer, offset: number, callback: (err: Error | null, buf: Buffer) => void): void;
export function randomFill(buffer: Uint8Array, offset: number, callback: (err: Error | null, buf: Uint8Array) => void): void;
export function randomFill(buffer: Buffer, offset: number, size: number, callback: (err: Error | null, buf: Buffer) => void): void;
export function randomFill(buffer: Uint8Array, offset: number, size: number, callback: (err: Error | null, buf: Uint8Array) => void): void;
export interface RsaPublicKey {
key: string;
padding?: number;