@@ -4,7 +4,7 @@ import { DENO_DEPLOYMENT_ID } from "./runtime/build_id.ts";
44import * as colors from "@std/fmt/colors" ;
55import {
66 type MaybeLazyMiddleware ,
7- type MiddlewareFn ,
7+ type Middleware ,
88 runMiddlewares ,
99} from "./middlewares/mod.ts" ;
1010import { Context } from "./context.ts" ;
@@ -209,16 +209,16 @@ export class App<State> {
209209 }
210210
211211 /**
212- * Set the app's 404 error handler. Can be a {@linkcode Route} or a {@linkcode MiddlewareFn }.
212+ * Set the app's 404 error handler. Can be a {@linkcode Route} or a {@linkcode Middleware }.
213213 */
214- notFound ( routeOrMiddleware : Route < State > | MiddlewareFn < State > ) : this {
214+ notFound ( routeOrMiddleware : Route < State > | Middleware < State > ) : this {
215215 this . #commands. push ( newNotFoundCmd ( routeOrMiddleware ) ) ;
216216 return this ;
217217 }
218218
219219 onError (
220220 path : string ,
221- routeOrMiddleware : Route < State > | MiddlewareFn < State > ,
221+ routeOrMiddleware : Route < State > | Middleware < State > ,
222222 ) : this {
223223 this . #commands. push ( newErrorCmd ( path , routeOrMiddleware , true ) ) ;
224224 return this ;
@@ -250,50 +250,50 @@ export class App<State> {
250250 /**
251251 * Add middlewares for GET requests at the specified path.
252252 */
253- get ( path : string , ...middlewares : MaybeLazy < MiddlewareFn < State > > [ ] ) : this {
253+ get ( path : string , ...middlewares : MaybeLazy < Middleware < State > > [ ] ) : this {
254254 this . #commands. push ( newHandlerCmd ( "GET" , path , middlewares , false ) ) ;
255255 return this ;
256256 }
257257 /**
258258 * Add middlewares for POST requests at the specified path.
259259 */
260- post ( path : string , ...middlewares : MaybeLazy < MiddlewareFn < State > > [ ] ) : this {
260+ post ( path : string , ...middlewares : MaybeLazy < Middleware < State > > [ ] ) : this {
261261 this . #commands. push ( newHandlerCmd ( "POST" , path , middlewares , false ) ) ;
262262 return this ;
263263 }
264264 /**
265265 * Add middlewares for PATCH requests at the specified path.
266266 */
267- patch ( path : string , ...middlewares : MaybeLazy < MiddlewareFn < State > > [ ] ) : this {
267+ patch ( path : string , ...middlewares : MaybeLazy < Middleware < State > > [ ] ) : this {
268268 this . #commands. push ( newHandlerCmd ( "PATCH" , path , middlewares , false ) ) ;
269269 return this ;
270270 }
271271 /**
272272 * Add middlewares for PUT requests at the specified path.
273273 */
274- put ( path : string , ...middlewares : MaybeLazy < MiddlewareFn < State > > [ ] ) : this {
274+ put ( path : string , ...middlewares : MaybeLazy < Middleware < State > > [ ] ) : this {
275275 this . #commands. push ( newHandlerCmd ( "PUT" , path , middlewares , false ) ) ;
276276 return this ;
277277 }
278278 /**
279279 * Add middlewares for DELETE requests at the specified path.
280280 */
281- delete ( path : string , ...middlewares : MaybeLazy < MiddlewareFn < State > > [ ] ) : this {
281+ delete ( path : string , ...middlewares : MaybeLazy < Middleware < State > > [ ] ) : this {
282282 this . #commands. push ( newHandlerCmd ( "DELETE" , path , middlewares , false ) ) ;
283283 return this ;
284284 }
285285 /**
286286 * Add middlewares for HEAD requests at the specified path.
287287 */
288- head ( path : string , ...middlewares : MaybeLazy < MiddlewareFn < State > > [ ] ) : this {
288+ head ( path : string , ...middlewares : MaybeLazy < Middleware < State > > [ ] ) : this {
289289 this . #commands. push ( newHandlerCmd ( "HEAD" , path , middlewares , false ) ) ;
290290 return this ;
291291 }
292292
293293 /**
294294 * Add middlewares for all HTTP verbs at the specified path.
295295 */
296- all ( path : string , ...middlewares : MaybeLazy < MiddlewareFn < State > > [ ] ) : this {
296+ all ( path : string , ...middlewares : MaybeLazy < Middleware < State > > [ ] ) : this {
297297 this . #commands. push ( newHandlerCmd ( "ALL" , path , middlewares , false ) ) ;
298298 return this ;
299299 }
0 commit comments