@@ -103,38 +103,6 @@ export interface Listener {
103
103
104
104
export type Tags = { [ tag : string ] : boolean } ;
105
105
106
- type Dependencies =
107
- | string
108
- | string [ ]
109
- | {
110
- [ key : string ] : string ;
111
- } ;
112
-
113
- interface PluginNameVersion {
114
- name : string ;
115
- version ?: string | undefined ;
116
- }
117
-
118
- interface PluginPackage {
119
- pkg : any ;
120
- }
121
-
122
- interface PluginBase < T > {
123
- register : ( server : Server , options : T ) => void | Promise < void > ;
124
- multiple ?: boolean | undefined ;
125
- dependencies ?: Dependencies | undefined ;
126
- requirements ?:
127
- | {
128
- node ?: string | undefined ;
129
- hapi ?: string | undefined ;
130
- }
131
- | undefined ;
132
-
133
- once ?: boolean | undefined ;
134
- }
135
-
136
- type Plugin < T > = PluginBase < T > & ( PluginNameVersion | PluginPackage ) ;
137
-
138
106
interface UserCredentials { }
139
107
140
108
interface AppCredentials { }
@@ -205,7 +173,7 @@ interface RequestRoute {
205
173
} ;
206
174
}
207
175
208
- interface Request extends Podium {
176
+ export interface Request extends Podium {
209
177
app : ApplicationState ;
210
178
readonly auth : RequestAuth ;
211
179
events : RequestEvents ;
@@ -232,16 +200,6 @@ interface ResponseToolkit {
232
200
readonly continue : symbol ;
233
201
}
234
202
235
- interface ServerEventCriteria < T > {
236
- name : T ;
237
- channels ?: string | string [ ] | undefined ;
238
- clone ?: boolean | undefined ;
239
- count ?: number | undefined ;
240
- filter ?: string | string [ ] | { tags : string | string [ ] ; all ?: boolean | undefined } | undefined ;
241
- spread ?: boolean | undefined ;
242
- tags ?: boolean | undefined ;
243
- }
244
-
245
203
export interface RequestEvent {
246
204
timestamp : string ;
247
205
tags : string [ ] ;
@@ -250,26 +208,15 @@ export interface RequestEvent {
250
208
error : object ;
251
209
}
252
210
253
- type RequestEventHandler = ( request : Request , event : RequestEvent , tags : { [ key : string ] : true } ) => void ;
254
211
interface ServerEvents {
255
- on ( criteria : 'request' | ServerEventCriteria < 'request' > , listener : RequestEventHandler ) : void ;
212
+ on ( criteria : any , listener : any ) : void ;
256
213
}
257
214
258
- type RouteRequestExtType =
259
- | 'onPreAuth'
260
- | 'onCredentials'
261
- | 'onPostAuth'
262
- | 'onPreHandler'
263
- | 'onPostHandler'
264
- | 'onPreResponse' ;
265
-
266
- type ServerRequestExtType = RouteRequestExtType | 'onRequest' ;
267
-
268
215
export type Server = Record < string , any > & {
269
216
events : ServerEvents ;
270
- ext ( event : ServerRequestExtType , method : Lifecycle . Method , options ?: Record < string , any > ) : void ;
217
+ register : any ;
218
+ ext ( event : any , method : Lifecycle . Method , options ?: Record < string , any > ) : void ;
271
219
initialize ( ) : Promise < void > ;
272
- register ( plugins : Plugin < any > | Array < Plugin < any > > , options ?: Record < string , any > ) : Promise < void > ;
273
220
start ( ) : Promise < void > ;
274
221
} ;
275
222
0 commit comments