-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathindex.d.ts
54 lines (47 loc) · 1.23 KB
/
index.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
52
53
54
declare module "kbpgp" {
class BaseX {
public base: number
constructor(alphabet: string)
encode(input: Buffer): string
decode(input: string): Buffer
}
export const base58: BaseX
export const base32: BaseX
export const base91: BaseX
namespace util {
function json_stringify_sorted(o: any): string;
}
interface KeyManager {
get_ekid: () => Buffer;
}
namespace ukm {
function get_sig_body(arg: { armored: string }): [Error|null,Buffer];
}
namespace verify {
type Kid = string;
interface GenericKey {
kid: () => Kid;
isPGP: () => boolean;
verify: (s: string, opts?: Opts) => Promise<[Buffer, Buffer]>;
}
type Opts = {
time_travel?: boolean;
now?: number;
no_check_keys?: boolean;
};
function importKey(s: string, opts?: Opts): Promise<GenericKey>;
}
namespace kb {
function unbox(
arg: { armored: string } | { binary: Buffer },
cb: (
err: Error | null,
res: { payload: Buffer; km: KeyManager } | null
) => void
): void;
function verify(
arg: { armored: string; kid: string } | { binary: Buffer; kid: string },
cb: (err: Error | null, paload: Buffer | null) => void
): void;
}
}