Type Alias RolesOf<P>
RolesOf: number extends P["length"]
? never
: [
P extends readonly [infer First, ...(infer Rest)]
? (roles: RolesOfOne<First> & RolesOf<Rest>) => void
: (roles: unknown) => void,
] extends [(roles: infer R) => void]
? R
: never
? never
: [
P extends readonly [infer First, ...(infer Rest)]
? (roles: RolesOfOne<First> & RolesOf<Rest>) => void
: (roles: unknown) => void,
] extends [(roles: infer R) => void]
? R
: never
Type Parameters
- P extends readonly unknown[]
The roles every policy of the list
Prequests, joined with&: what a workflow that the policies are attached to must implement. A list that is not written in place, whose length the compiler cannot see, givesnever, so that no workflow compiles with it, since its roles cannot be known. A list that may be one of several, such asflag ? [Notify] : [], gives the roles of every one of them.