File tree Expand file tree Collapse file tree 1 file changed +37
-6
lines changed Expand file tree Collapse file tree 1 file changed +37
-6
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ export type METHODS =
105105 | 'PATCH'
106106 | 'DELETE'
107107 | 'HEAD'
108- | 'OPTIONS' ;
108+ | 'OPTIONS'
109+ | 'ANY' ;
109110
110111export 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+
129164export 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 } ;
You can’t perform that action at this time.
0 commit comments