Skip to content

Commit 7a94e93

Browse files
committed
.
1 parent 216ad84 commit 7a94e93

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

index.d.ts

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ export type METHODS =
105105
| 'PATCH'
106106
| 'DELETE'
107107
| 'HEAD'
108-
| 'OPTIONS';
108+
| 'OPTIONS'
109+
| 'ANY';
109110

110111
export type LoggerFunction = (message: string, ...args: any[]) => void;
111112

@@ -126,14 +127,44 @@ export type HandlerFunction<
126127
res: Response<TResponse>
127128
) => void;
128129

130+
export type TimestampFunction = () => string;
131+
132+
export declare interface SamplingOptions {
133+
route?: string;
134+
target?: number;
135+
rate?: number;
136+
period?: number;
137+
method?: string | string[];
138+
}
139+
140+
export declare interface LoggerOptions {
141+
access?: boolean | string;
142+
customKey?: string;
143+
errorLogging?: boolean;
144+
detail?: boolean;
145+
level?: string;
146+
levels?: {
147+
[key: string]: string;
148+
};
149+
messageKey?: string;
150+
nested?: boolean;
151+
timestamp?: boolean | TimestampFunction;
152+
sampling?: {
153+
target?: number;
154+
rate?: number;
155+
period?: number;
156+
rules?: SamplingOptions[];
157+
};
158+
serializers?: {
159+
[name: string]: (prop: any) => any;
160+
};
161+
stack?: boolean;
162+
}
163+
129164
export interface Options {
130165
base?: string;
131166
callbackName?: string;
132-
logger?: {
133-
level?: string;
134-
format?: string;
135-
[key: string]: any;
136-
};
167+
logger?: boolean | LoggerOptions;
137168
mimeTypes?: {
138169
[key: string]: string;
139170
};

0 commit comments

Comments
 (0)