-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhumanify.d.ts
More file actions
42 lines (37 loc) · 974 Bytes
/
humanify.d.ts
File metadata and controls
42 lines (37 loc) · 974 Bytes
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
import { DataStream } from "scramjet";
/**
* Humanify module.
* @param dataStream
* @param humanifyOptions
*/
declare module 'humanify' {
interface HumanifyChoice {
value: any;
caption: string;
type: string;
kb: any[];
}
interface Logger {
log: Function;
warn: Function;
error: Function;
info: Function;
debug: Function;
}
interface ItemParserArg {
buttons: HumanifyChoice;
item?: object;
}
export interface HumanifyOptions {
serialize?: (chunk: any) => string;
deserialize?: (data: string) => any;
root?: string;
buttons?: HumanifyChoice[];
duplicates?: number;
minAnswers?: number;
logger?: Logger;
itemParser: (arg: any) => ItemParserArg;
maxBufferLength?: number;
}
export default function Humanify(inputStream: DataStream, options: HumanifyOptions) : DataStream
}