Type Alias: Guard<N, O, R>
ts
type Guard<N, O, R> = <X>(request, ...rest) => Promise<R>;Defined in: packages/tanstack-start/src/server.ts:96
A guard typed with the names N it accepts and its options O: (request, ...names, options?). It resolves to the subject (R) when the check passes, and throws a Response (401, 403, or a handler's) when it does not.
Type Parameters
| Type Parameter | Default type |
|---|---|
N extends string | - |
O | - |
R | SubjectRbac |
Type Parameters
| Type Parameter |
|---|
X extends readonly (GuardNames | O)[] |
Parameters
| Parameter | Type |
|---|---|
request | Request |
...rest | X & RequirementArgs<X, N, O> |
Returns
Promise<R>
