Skip to content

Commit da0849e

Browse files
committed
Add UI module with related types and utilities in shared package
1 parent 7b53832 commit da0849e

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

packages/shared/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@
7070
"default": "./dist/runtime/dom/index.js"
7171
}
7272
},
73+
"./ui": {
74+
"import": {
75+
"types": "./dist/runtime/ui/index.d.mts",
76+
"default": "./dist/runtime/ui/index.mjs"
77+
},
78+
"require": {
79+
"types": "./dist/runtime/ui/index.d.ts",
80+
"default": "./dist/runtime/ui/index.js"
81+
}
82+
},
7383
"./types": {
7484
"import": {
7585
"types": "./dist/types/index.d.mts",

packages/shared/src/ui/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* UI-related utilities and types for Clerk components
3+
*
4+
* @module @clerk/shared/ui
5+
*/
6+
7+
export * from './types';

packages/shared/src/ui/types.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* UI-related types and utilities
3+
*/
4+
5+
// Placeholder - Add UI-specific types and utilities here
6+
export type UIVersion = string;
7+
8+
// TODO: replace with a proper interface
9+
export type MountComponentRenderer = (
10+
clerk: any,
11+
environment: any,
12+
options: any,
13+
) => {
14+
ensureMounted: (options?: { preloadHint?: string }) => Promise<{
15+
mountImpersonationFab: () => void;
16+
updateProps: (props: any) => void;
17+
openModal: (name: string, props: any) => void;
18+
closeModal: (name: string) => void;
19+
openDrawer: (name: string, props: any) => void;
20+
closeDrawer: (name: string) => void;
21+
mountComponent: (config: any) => void;
22+
unmountComponent: (config: any) => void;
23+
prefetch: (name: string) => void;
24+
}>;
25+
};
26+
27+
export interface ClerkUiEntry {
28+
resolve: () => Promise<MountComponentRenderer>;
29+
}

packages/shared/tsdown.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default defineConfig(({ watch }) => {
4242
'./src/workerTimers/index.ts',
4343
'./src/types/index.ts',
4444
'./src/dom/*.ts',
45+
'./src/ui/index.ts',
4546
'./src/internal/clerk-js/*.ts',
4647
'./src/internal/clerk-js/**/*.ts',
4748
'!./src/**/*.{test,spec}.{ts,tsx}',

0 commit comments

Comments
 (0)