-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
47 lines (34 loc) · 906 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Request, Response, NextFunction } from "express";
declare type HostDetails = {
pid: string,
hostname: string,
}
declare type ReqidOptions = {
setHeader?: Boolean,
headerName?: string,
useIdFromRequest?: Boolean,
attribute?: string,
setInContext?: Boolean,
idPrefix: string | (() => string),
prefixSeperator?: string,
// idType = 'uuid4', // uuid4 or snowflake
}
declare function getHostDetails(): HostDetails;
declare function expressReqid({
setHeader = true,
headerName = 'request-id',
useIdFromRequest = true,
attribute = 'reqid',
setInContext = false,
idPrefix = null,
prefixSeperator = '/',
// idType = 'uuid4', // uuid4 or snowflake
}: ReqidOptions): (req: Request, res: Response, next: NextFunction) => void;
export = {
getHostDetails,
expressReqid,
}
export {
HostDetails,
ReqidOptions,
};