forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
speakeasy.d.ts
51 lines (41 loc) · 1.23 KB
/
speakeasy.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Type definitions for speakeasy v1.0.4
// Project: https://github.com/markbao/speakeasy
// Definitions by: Lucas Woo <https://github.com/legendecas>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "speakeasy" {
interface IKey {
ascii: string;
base32: string;
hex: string;
qr_code_ascii: string;
qr_code_hex: string;
qr_code_base32: string;
google_auth_qr: string;
}
interface GenerateOptions {
length?: number;
symbols?: boolean;
qr_codes?: boolean;
google_auth_qr?: boolean;
name?: string;
}
interface TotpOptions {
key: string;
step?: number;
time?: number;
initial_time?: number;
length?: number;
encoding?: string;
}
interface HotpOptions {
key: string;
counter: number;
length?: number;
encoding?: string;
}
export function generate_key(options: GenerateOptions): IKey;
export function hotp(options: HotpOptions): string;
export function counter(options: HotpOptions): string;
export function totp(options: TotpOptions): string;
export function time(options: TotpOptions): string;
}