Skip to content

exclude internal types from appearing in the Auth public typings #4821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages-exp/auth-exp/src/core/user/token_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export const enum Buffer {
TOKEN_REFRESH = 30_000
}

/**
* We need to mark this class as internal explicitly to exclude it in the public typings, because
* it references AuthInternal which has a circular dependency with UserInternal.
*
* @internal
*/
export class StsTokenManager {
refreshToken: string | null = null;
accessToken: string | null = null;
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/auth-exp/src/model/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ export interface ConfigInternal extends Config {
clientPlatform: ClientPlatform;
}

/**
* UserInternal and AuthInternal reference each other, so both of them are included in the public typings.
* In order to exclude them, we mark them as internal explicitly.
*
* @internal
*/
export interface AuthInternal extends Auth {
currentUser: User | null;
emulatorConfig: EmulatorConfig | null;
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/auth-exp/src/model/popup_redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ export interface EventManager {
unregisterConsumer(authEventConsumer: AuthEventConsumer): void;
}

/**
* We need to mark this interface as internal explicitly to exclude it in the public typings, because
* it references AuthInternal which has a circular dependency with UserInternal.
*
* @internal
*/
export interface PopupRedirectResolverInternal extends PopupRedirectResolver {
// Whether or not to initialize the event manager early
_shouldInitProactively: boolean;
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/auth-exp/src/model/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export interface UserParameters {
lastLoginAt?: string | null;
}

/**
* UserInternal and AuthInternal reference each other, so both of them are included in the public typings.
* In order to exclude them, we mark them as internal explicitly.
*
* @internal
*/
export interface UserInternal extends User {
displayName: string | null;
email: string | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export const _JSLOAD_CALLBACK = jsHelpers._generateCallbackName('rcb');
const NETWORK_TIMEOUT_DELAY = new Delay(30000, 60000);
const RECAPTCHA_BASE = 'https://www.google.com/recaptcha/api.js?';

/**
* We need to mark this interface as internal explicitly to exclude it in the public typings, because
* it references AuthInternal which has a circular dependency with UserInternal.
*
* @internal
*/
export interface ReCaptchaLoader {
load(auth: AuthInternal, hl?: string): Promise<Recaptcha>;
clearedOneInstance(): void;
Expand Down