DefinitelyTyped/types/bip38/index.d.ts
Nathan Shively-Sanders f0ce987bc1 Update project urls to match NPM url
Note that this *trivially* updates project urls by adding the NPM url to
the end, even when the urls are almost identical or the DT one is
outdated. I'll clean up the urls in a later commit.

This PR is unfinished! Please do not merge it yet.
2019-02-11 17:10:55 -08:00

42 lines
1.8 KiB
TypeScript

// Type definitions for bip38 2.0
// Project: https://github.com/bitcoinjs/bip38, http://cryptocoinjs.com/modules/currency/bip38
// Definitions by: Satana Charuwichitratana <https://github.com/micksatana>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
// Note: When there is @types/scryptsy, ProgressStatus and ScryptParams should be referred from the definition instead
export interface ProgressStatus {
current: number;
total: number;
percent: number;
}
export interface ScryptParams {
N: number;
r: number;
p: number;
}
export function decrypt(string: string, passphrase: string,
progressCallback?: (status: ProgressStatus) => void,
scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean };
export function decryptECMult(buffer: Buffer, passphrase: string,
progressCallback?: (status: ProgressStatus) => void,
scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean };
export function decryptRaw(buffer: Buffer, passphrase: string,
progressCallback?: (status: ProgressStatus) => void,
scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean };
export function encrypt(buffer: Buffer, compressed: boolean, passphrase: string,
progressCallback?: (status: ProgressStatus) => void,
scryptParams?: ScryptParams): string;
export function encryptRaw(buffer: Buffer, compressed: boolean, passphrase: string,
progressCallback?: (status: ProgressStatus) => void,
scryptParams?: ScryptParams): Buffer;
export function verify(string: string): boolean;