UNPKG

1.87 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 { AuthEventManager } from '../../core/auth/auth_event_manager';
18import { AuthInternal } from '../../model/auth';
19import { AuthEvent, AuthEventType } from '../../model/popup_redirect';
20/** Custom AuthEventManager that adds passive listeners to events */
21export declare class CordovaAuthEventManager extends AuthEventManager {
22 private readonly passiveListeners;
23 private resolveInialized;
24 private initPromise;
25 addPassiveListener(cb: (e: AuthEvent) => void): void;
26 removePassiveListener(cb: (e: AuthEvent) => void): void;
27 resetRedirect(): void;
28 /** Override the onEvent method */
29 onEvent(event: AuthEvent): boolean;
30 initialized(): Promise<void>;
31}
32/**
33 * Generates a (partial) {@link AuthEvent}.
34 */
35export declare function _generateNewEvent(auth: AuthInternal, type: AuthEventType, eventId?: string | null): AuthEvent;
36export declare function _savePartialEvent(auth: AuthInternal, event: AuthEvent): Promise<void>;
37export declare function _getAndRemoveEvent(auth: AuthInternal): Promise<AuthEvent | null>;
38export declare function _eventFromPartialAndUrl(partialEvent: AuthEvent, url: string): AuthEvent | null;
39export declare function _getDeepLinkFromCallback(url: string): string;