Skip to content

Commit 6767273

Browse files
committed
fix(types): Correct existing typing issues
1 parent 76c1e05 commit 6767273

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

packages/types/src/localization.retheme.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ type _LocalizationResource = {
271271
start: {
272272
headerTitle__account: LocalizationValue;
273273
headerTitle__security: LocalizationValue;
274+
headerSubtitle__account: LocalizationValue;
275+
headerSubtitle__security: LocalizationValue;
274276
profileSection: {
275277
title: LocalizationValue;
276278
};
@@ -554,6 +556,8 @@ type _LocalizationResource = {
554556
start: {
555557
headerTitle__members: LocalizationValue;
556558
headerTitle__settings: LocalizationValue;
559+
headerSubtitle__members: LocalizationValue;
560+
headerSubtitle__settings: LocalizationValue;
557561
};
558562
profilePage: {
559563
title: LocalizationValue;

packages/types/src/organizationMembership.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ interface Base {
88
role: string;
99
}
1010

11+
interface Placeholder {
12+
permission: unknown;
13+
role: unknown;
14+
}
15+
1116
declare global {
1217
interface ClerkAuthorization {}
1318
}
@@ -45,14 +50,16 @@ export interface OrganizationMembershipResource extends ClerkResource {
4550
update: (updateParams: UpdateOrganizationMembershipParams) => Promise<OrganizationMembershipResource>;
4651
}
4752

48-
export type OrganizationCustomPermissionKey = 'permission' extends keyof ClerkAuthorization
49-
? // @ts-ignore Typescript cannot infer the existence of the `permission` key even if we checking it above
50-
ClerkAuthorization['permission']
53+
export type OrganizationCustomPermissionKey = ClerkAuthorization extends Placeholder
54+
? ClerkAuthorization['permission'] extends string
55+
? ClerkAuthorization['permission']
56+
: Base['permission']
5157
: Base['permission'];
5258

53-
export type OrganizationCustomRoleKey = 'role' extends keyof ClerkAuthorization
54-
? // @ts-ignore Typescript cannot infer the existence of the `role` key even if we checking it above
55-
ClerkAuthorization['role']
59+
export type OrganizationCustomRoleKey = ClerkAuthorization extends Placeholder
60+
? ClerkAuthorization['role'] extends string
61+
? ClerkAuthorization['role']
62+
: Base['role']
5663
: Base['role'];
5764

5865
/**

0 commit comments

Comments
 (0)