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 | */
|
17 | import { AuthProvider } from '../../model/public_types';
|
18 | import { AuthInternal } from '../../model/auth';
|
19 | import { AuthEvent } from '../../model/popup_redirect';
|
20 | import { InAppBrowserRef } from '../plugins';
|
21 | /**
|
22 | * Generates the URL for the OAuth handler.
|
23 | */
|
24 | export declare function _generateHandlerUrl(auth: AuthInternal, event: AuthEvent, provider: AuthProvider): Promise<string>;
|
25 | /**
|
26 | * Validates that this app is valid for this project configuration
|
27 | */
|
28 | export declare function _validateOrigin(auth: AuthInternal): Promise<void>;
|
29 | export declare function _performRedirect(handlerUrl: string): Promise<InAppBrowserRef | null>;
|
30 | interface PassiveAuthEventListener {
|
31 | addPassiveListener(cb: () => void): void;
|
32 | removePassiveListener(cb: () => void): void;
|
33 | }
|
34 | /**
|
35 | * This function waits for app activity to be seen before resolving. It does
|
36 | * this by attaching listeners to various dom events. Once the app is determined
|
37 | * to be visible, this promise resolves. AFTER that resolution, the listeners
|
38 | * are detached and any browser tabs left open will be closed.
|
39 | */
|
40 | export declare function _waitForAppResume(auth: AuthInternal, eventListener: PassiveAuthEventListener, iabRef: InAppBrowserRef | null): Promise<void>;
|
41 | /**
|
42 | * Checks the configuration of the Cordova environment. This has no side effect
|
43 | * if the configuration is correct; otherwise it throws an error with the
|
44 | * missing plugin.
|
45 | */
|
46 | export declare function _checkCordovaConfiguration(auth: AuthInternal): void;
|
47 | export {};
|