forked from squeeks/glossy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
69 lines (54 loc) · 1.72 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/// <reference types="node" />
export interface ProduceOptions {
facility?: string;
severity?: string;
host?: string;
appName?: string;
pid?: string | number;
msgID?: string;
type?: string;
}
export interface MessageOptions {
facility?: string;
severity?: string;
prival?: number;
host?: string;
appName?: string;
pid?: string | number;
date?: Date;
time?: Date;
msgID?: string;
structuredData?: unknown;
message?: string;
}
export interface ProducerCallback {
(compiledMessage: string): void;
}
export class Produce {
constructor(options: ProduceOptions | string);
alert(options: MessageOptions, callback?: ProducerCallback): string | void;
crit(options: MessageOptions, callback?: ProducerCallback): string | void;
debug(options: MessageOptions, callback?: ProducerCallback): string | void;
emergency(options: MessageOptions, callback?: ProducerCallback): string | void;
info(options: MessageOptions, callback?: ProducerCallback): string | void;
notice(options: MessageOptions, callback?: ProducerCallback): string | void;
produce(options: MessageOptions, callback?: ProducerCallback): string | void;
warn(options: MessageOptions, callback?: ProducerCallback): string | void;
}
export interface ParserCallback {
(parsedMessage: SyslogMessage): void;
}
export interface SyslogMessage {
originalMessage: string;
type: string;
time: Date;
message: string;
host?: string | null;
appName?: string | null;
pid?: string | null;
msgID?: string | null;
structuredData?: unknown;
}
export namespace Parse {
function parse(rawMessage: string | Buffer, callback?: ParserCallback): SyslogMessage | void;
}