Skip to content

Type Alias: CheckGuard<T, G> ​

ts
type CheckGuard<T, G> = string extends G ? string : G extends GuardName<T> ? G : GuardName<T>;

Defined in: packages/core/src/types.ts:146

The type of a guard option that selects the names of guard G: one of GuardName<T>, or any string (then the names of every guard apply). An unknown literal is a type error that lists the typed guards. Without guards in T, any string.

Type Parameters ​

Type Parameter
T extends RbacTypeConfig
G extends string

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