Skip to main content
Version: Next (2.x)

ScopeRule<Scopes, Grants>

ScopeRule<Scopes, Grants> = { [K in keyof Scopes]: { key: K; type: "scope"; value: Scopes[K] extends boolean ? true : Scopes[K] } }[keyof Scopes] | { grant: Grants; type: "grant"; }

Utility type that enforces boolean scopes must be true. For non-boolean scopes, preserves the original type.

Type Parameters

Type Parameter

Scopes extends ScopesShape

Grants extends string