-
Notifications
You must be signed in to change notification settings - Fork 452
Expand file tree
/
Copy pathtypes.ts
More file actions
112 lines (102 loc) · 2.77 KB
/
types.ts
File metadata and controls
112 lines (102 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import type {
Clerk,
ClerkOptions,
ClientResource,
MultiDomainAndOrProxyPrimitives,
ProtectParams,
ShowProps,
Without,
} from '@clerk/shared/types';
import type { ClerkUiConstructor } from '@clerk/shared/ui';
import type { Appearance, Ui } from '@clerk/ui/internal';
type AstroClerkUpdateOptions<TUi extends Ui = Ui> = Pick<ClerkOptions, 'localization'> & {
appearance?: Appearance<TUi>;
};
type AstroClerkIntegrationParams<TUi extends Ui = Ui> = Without<
ClerkOptions,
| 'isSatellite'
| 'sdkMetadata'
| 'standardBrowser'
| 'selectInitialSession'
| 'routerReplace'
| 'routerDebug'
| 'routerPush'
| 'polling'
| 'touchSession'
| 'appearance'
> &
MultiDomainAndOrProxyPrimitives & {
appearance?: Appearance<TUi>;
clerkJSUrl?: string;
clerkJSVersion?: string;
/**
* The URL that `@clerk/ui` should be hot-loaded from.
*/
clerkUIUrl?: string;
/**
* The version of `@clerk/ui` to hot-load.
*/
clerkUIVersion?: string;
/**
* Controls prefetching of the `@clerk/ui` script.
* - `false` - Skip prefetching the UI (for custom UIs using Control Components)
* - `undefined` (default) - Prefetch UI normally
*/
prefetchUI?: boolean;
};
type AstroClerkCreateInstanceParams<TUi extends Ui = Ui> = AstroClerkIntegrationParams<TUi> & {
publishableKey: string;
};
// Copied from `@clerk/react`
export interface HeadlessBrowserClerk extends Clerk {
load: (opts?: Without<ClerkOptions, 'isSatellite'>) => Promise<void>;
updateClient: (client: ClientResource) => void;
}
// Copied from `@clerk/react`
export interface BrowserClerk extends HeadlessBrowserClerk {
onComponentsReady: Promise<void>;
components: any;
}
declare global {
interface Window {
__astro_clerk_component_props: Map<string, Map<string, Record<string, unknown>>>;
__astro_clerk_function_props: Map<string, Map<string, Record<string, unknown>>>;
Clerk: BrowserClerk;
__internal_ClerkUICtor?: ClerkUiConstructor;
}
}
export type {
AstroClerkUpdateOptions,
AstroClerkIntegrationParams,
AstroClerkCreateInstanceParams,
ProtectParams,
ShowProps,
};
// Backward compatibility alias
export type ProtectProps = ProtectParams;
export type ButtonProps<Tag> = {
/**
* @deprecated The `'as'` prop will be removed in a future version.
* Use the default slot with the `'asChild'` prop instead.
* @example
* <SignInButton asChild>
* <button>Sign in</button>
* </SignInButton>
*/
as: Tag;
asChild?: boolean;
};
export type InternalUIComponentId =
| 'sign-in'
| 'sign-up'
| 'create-organization'
| 'organization-list'
| 'organization-profile'
| 'organization-switcher'
| 'user-avatar'
| 'user-button'
| 'user-profile'
| 'google-one-tap'
| 'waitlist'
| 'pricing-table'
| 'api-keys';