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