UNPKG

1.6 kBTypeScriptView Raw
1/// <reference types="react" />
2import type { Clerk, ClerkOptions, ClientResource, LoadedClerk, RedirectOptions, SignOutCallback, UserResource } from '@clerk/types';
3export interface IsomorphicClerkOptions extends ClerkOptions {
4 scriptUrl?: string;
5}
6export interface BrowserClerkConstructor {
7 new (frontendApi: string): BrowserClerk;
8}
9export declare type WithClerkProp<T> = T & {
10 clerk: LoadedClerk;
11};
12export declare type WithUserProp<T> = T & {
13 user: UserResource;
14};
15export interface MountProps {
16 mount: (node: HTMLDivElement, props: any) => void;
17 unmount: (node: HTMLDivElement) => void;
18 props?: any;
19}
20export interface BrowserClerk extends Clerk {
21 load: (opts?: ClerkOptions) => Promise<void>;
22 updateClient: (client: ClientResource) => void;
23 onComponentsReady: Promise<void>;
24 components: any;
25}
26export declare type ClerkProp = BrowserClerkConstructor | BrowserClerk | undefined | null;
27declare type ButtonProps = {
28 afterSignInUrl?: string;
29 afterSignUpUrl?: string;
30 redirectUrl?: string;
31 mode?: 'redirect' | 'modal';
32 children?: React.ReactNode;
33};
34export declare type SignInButtonProps = ButtonProps;
35export declare type SignUpButtonProps = ButtonProps;
36export declare type SignOutButtonProps = {
37 signOutCallback?: SignOutCallback;
38 children?: React.ReactNode;
39};
40export declare type RedirectToProps = {
41 /**
42 * @deprecated The returnBack prop has been deprecated and will be removed soon. Use `redirectUrl` instead.
43 */
44 returnBack?: boolean;
45} & RedirectOptions;
46export {};
47//# sourceMappingURL=types.d.ts.map
\No newline at end of file