Skip to content

Type Alias: GuardHandlerContext<T, G> ​

ts
type GuardHandlerContext<T, G> = DefaultRbacTypes extends TypesOf<T> ? Context : Context<RbacEnv<T, G>>;

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

The context the handlers of createGuards<T>() get: Hono's Context for an untyped T (any name), or a Context<RbacEnv<T>> whose c.var.rbac has the names of T (of guard G with per-guard names: the request's guard).

Type Parameters ​

Type ParameterDefault type
T extends RbacTypeConfig | Rbac<RbacTypeConfig>DefaultRbacTypes
G extends stringDefaultGuardName<TypesOf<T>>

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