-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.d.ts
32 lines (28 loc) · 988 Bytes
/
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
/// <reference types="node" />
import * as events from 'events';
import { RequestOptions } from "https";
interface Record {
parse: (buf: Uint8Array | Buffer) => any;
parseFile: (filepath: string) => any;
parseByUrl: (url: string, cb: (data: any) => void, option?: RequestOptions) => void;
parseById: (id: string, cb: (data: any) => void, option?: RequestOptions) => void;
}
declare class MJSoul extends events.EventEmitter {
constructor(config?: MJSoul.Config);
open(onOpen?: () => void): void;
close(): void;
send(name: string, data?: any, cb?: (data: any) => void): void;
send(name: string, cb?: (data: any) => void, data?: any): void;
sendAsync(name: string, data?: any): Promise<any>;
hash(password: string): string;
}
declare namespace MJSoul {
interface Config {
url?: string,
timeout?: number,
wsOption?: RequestOptions,
}
const record: Record;
class DHS extends MJSoul { }
}
export = MJSoul;