Skip to content

Commit

Permalink
fix(clerk-react): Replace optional Clerk properties with undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Nov 29, 2023
1 parent bd4e6ee commit 0e0c835
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
8 changes: 4 additions & 4 deletions packages/clerk-js/src/core/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ export class Clerk implements ClerkInterface {
version: __PKG_VERSION__,
};

public client?: ClientResource;
public session?: ActiveSessionResource | null;
public organization?: OrganizationResource | null;
public user?: UserResource | null;
public client: ClientResource | undefined;
public session: ActiveSessionResource | null | undefined;
public organization: OrganizationResource | null | undefined;
public user: UserResource | null | undefined;
public __internal_country?: string | null;
public telemetry?: TelemetryCollector;

Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/isomorphicClerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import type {
UserButtonProps,
UserProfileProps,
UserResource,
Without,
} from '@clerk/types';

import { unsupportedNonBrowserDomainOrProxyUrlFunction } from './errors';
Expand Down Expand Up @@ -62,7 +63,7 @@ type MethodName<T> = {

type MethodCallback = () => Promise<unknown> | unknown;

type IsomorphicLoadedClerk = Omit<
type IsomorphicLoadedClerk = Without<
LoadedClerk,
/**
* Override ClerkJS methods in order to support premountMethodCalls
Expand Down
18 changes: 9 additions & 9 deletions packages/types/src/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ export interface Clerk {
/**
* Clerk SDK version number.
*/
version?: string;
version: string | undefined;

/**
* If present, contains information about the SDK that the host application is using.
* For example, if Clerk is loaded through `@clerk/nextjs`, this would be `{ name: '@clerk/nextjs', version: '1.0.0' }`
*/
sdkMetadata?: SDKMetadata;
sdkMetadata: SDKMetadata | undefined;

/**
* If true the bootstrapping of Clerk.load() has completed successfully.
Expand All @@ -78,7 +78,7 @@ export interface Clerk {
publishableKey: string;

/** Clerk Proxy url string. */
proxyUrl?: string;
proxyUrl: string | undefined;

/** Clerk Satellite Frontend API string. */
domain: string;
Expand All @@ -87,22 +87,22 @@ export interface Clerk {
isSatellite: boolean;

/** Clerk Instance type is defined from the Publishable key */
instanceType?: InstanceType;
instanceType: InstanceType | undefined;

/** Clerk flag for loading Clerk in a standard browser setup */
isStandardBrowser?: boolean;
isStandardBrowser: boolean | undefined;

/** Client handling most Clerk operations. */
client?: ClientResource;
client: ClientResource | undefined;

/** Active Session. */
session?: ActiveSessionResource | null;
session: ActiveSessionResource | null | undefined;

/** Active Organization */
organization?: OrganizationResource | null;
organization: OrganizationResource | null | undefined;

/** Current User. */
user?: UserResource | null;
user: UserResource | null | undefined;

/**
* Signs out the current user on single-session instances, or all users on multi-session instances
Expand Down

0 comments on commit 0e0c835

Please sign in to comment.