UNPKG

2.03 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2020 Google LLC
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17import { FirebaseError } from '@firebase/util';
18import { AuthEvent, AuthEventConsumer, AuthEventType, PopupRedirectResolverInternal } from '../../model/popup_redirect';
19import { UserInternal, UserCredentialInternal } from '../../model/user';
20import { AuthInternal } from '../../model/auth';
21/**
22 * Popup event manager. Handles the popup's entire lifecycle; listens to auth
23 * events
24 */
25export declare abstract class AbstractPopupRedirectOperation implements AuthEventConsumer {
26 protected readonly auth: AuthInternal;
27 protected readonly resolver: PopupRedirectResolverInternal;
28 protected user?: UserInternal | undefined;
29 protected readonly bypassAuthState: boolean;
30 private pendingPromise;
31 private eventManager;
32 readonly filter: AuthEventType[];
33 abstract eventId: string | null;
34 constructor(auth: AuthInternal, filter: AuthEventType | AuthEventType[], resolver: PopupRedirectResolverInternal, user?: UserInternal | undefined, bypassAuthState?: boolean);
35 abstract onExecution(): Promise<void>;
36 execute(): Promise<UserCredentialInternal | null>;
37 onAuthEvent(event: AuthEvent): Promise<void>;
38 onError(error: FirebaseError): void;
39 private getIdpTask;
40 protected resolve(cred: UserCredentialInternal | null): void;
41 protected reject(error: Error): void;
42 private unregisterAndCleanUp;
43 abstract cleanUp(): void;
44}