-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.d.ts
52 lines (48 loc) · 1.21 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
import type { Writable } from 'node:stream';
import type { EventEmitter } from 'node:events';
import type { RequestHandler } from 'express';
export interface IMiddlewareOptions {
streams?: Writable[];
stdout?: boolean;
routes?: {
whitelist?: string[];
strictChecking?: boolean;
};
userAnalytics?: {
platform?: boolean;
country?: boolean;
};
format?: {
type?: 'json' | 'common' | 'combined';
options?: {
cookies?: boolean;
headers?: boolean;
compact?: boolean;
spacing?: string | number;
separator?: string;
};
};
}
export interface ICustomOptions {
logToConsole: boolean;
streams?: Writable[];
stdout?: boolean;
format?: {
type?: 'json' | 'text';
options?: {
compact?: boolean;
spacing?: string | number;
separator?: string;
};
};
}
export interface ICustomLogger {
config: ICustomOptions;
info: (message: string) => void;
debug: (message: string) => void;
warn: (message: string) => void;
err: (message: string) => void;
}
export function middlewareLogger(config: IMiddlewareOptions): RequestHandler;
export function customLogger(config: ICustomOptions): ICustomLogger;
export const events: EventEmitter;