Skip to content

Type Alias: GuardHandler<C> ​

ts
type GuardHandler<C> = (c, context) => Response | Promise<Response>;

Defined in: packages/hono/src/guards.ts:50

Returns the response to send (or throws, e.g. an HTTPException). C is the context it gets: GuardHandlerContext<T> in createGuards<T>(), so c.var.rbac has the names of T there.

Type Parameters ​

Type ParameterDefault type
CContext

Parameters ​

ParameterType
cC
contextGuardContext

Returns ​

Response | Promise<Response>

Released under the MIT License. Inspired by spatie/laravel-permission.