@@ -68,11 +68,10 @@ export type OrganizationCustomRoleKey = ClerkAuthorization extends Placeholder
68
68
* MembershipRole includes `admin`, `basic_member`, `guest_member`. With the introduction of "Custom roles"
69
69
* these types will no longer match a developer's custom logic.
70
70
*/
71
- export type MembershipRole = 'role' extends keyof ClerkAuthorization
72
- ? // @ts -ignore Typescript cannot infer the existence of the `role` key even if we checking it above
73
- // Disabling eslint rule because the error causes the type to become any when accessing a property that does not exist
74
- // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
75
- ClerkAuthorization [ 'role' ] | 'admin' | 'basic_member' | 'guest_member'
71
+ export type MembershipRole = ClerkAuthorization extends Placeholder
72
+ ? ClerkAuthorization [ 'role' ] extends string
73
+ ? ClerkAuthorization [ 'role' ] | 'admin' | 'basic_member' | 'guest_member'
74
+ : Autocomplete < 'admin' | 'basic_member' | 'guest_member' >
76
75
: Autocomplete < 'admin' | 'basic_member' | 'guest_member' > ;
77
76
78
77
export type OrganizationSystemPermissionKey =
@@ -87,11 +86,10 @@ export type OrganizationSystemPermissionKey =
87
86
* OrganizationPermissionKey is a combination of system and custom permissions.
88
87
* System permissions are only accessible from FAPI and client-side operations/utils
89
88
*/
90
- export type OrganizationPermissionKey = 'permission' extends keyof ClerkAuthorization
91
- ? // @ts -ignore Typescript cannot infer the existence of the `permission` key even if we checking it above
92
- // Disabling eslint rule because the error causes the type to become any when accessing a property that does not exist
93
- // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
94
- ClerkAuthorization [ 'permission' ] | OrganizationSystemPermissionKey
89
+ export type OrganizationPermissionKey = ClerkAuthorization extends Placeholder
90
+ ? ClerkAuthorization [ 'permission' ] extends string
91
+ ? ClerkAuthorization [ 'permission' ] | OrganizationSystemPermissionKey
92
+ : Autocomplete < OrganizationSystemPermissionKey >
95
93
: Autocomplete < OrganizationSystemPermissionKey > ;
96
94
97
95
export type UpdateOrganizationMembershipParams = {
0 commit comments