UNPKG

2.5 kBTypeScriptView Raw
1/*! firebase-admin v10.0.2 */
2/*!
3 * Copyright 2021 Google Inc.
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 { App } from '../app';
18import { AppCheckToken as TAppCheckToken, AppCheckTokenOptions as TAppCheckTokenOptions, DecodedAppCheckToken as TDecodedAppCheckToken, VerifyAppCheckTokenResponse as TVerifyAppCheckTokenResponse } from './app-check-api';
19import { AppCheck as TAppCheck } from './app-check';
20/**
21 * Gets the {@link firebase-admin.app-check#AppCheck} service for the default app or a given app.
22 *
23 * `admin.appCheck()` can be called with no arguments to access the default
24 * app's `AppCheck` service or as `admin.appCheck(app)` to access the
25 * `AppCheck` service associated with a specific app.
26 *
27 * @example
28 * ```javascript
29 * // Get the `AppCheck` service for the default app
30 * var defaultAppCheck = admin.appCheck();
31 * ```
32 *
33 * @example
34 * ```javascript
35 * // Get the `AppCheck` service for a given app
36 * var otherAppCheck = admin.appCheck(otherApp);
37 * ```
38 *
39 * @param app - Optional app for which to return the `AppCheck` service.
40 * If not provided, the default `AppCheck` service is returned.
41 *
42 * @returns The default `AppCheck` service if no
43 * app is provided, or the `AppCheck` service associated with the provided
44 * app.
45 */
46export declare function appCheck(app?: App): appCheck.AppCheck;
47export declare namespace appCheck {
48 /**
49 * Type alias to {@link firebase-admin.app-check#AppCheck}.
50 */
51 type AppCheck = TAppCheck;
52 /**
53 * Type alias to {@link firebase-admin.app-check#AppCheckToken}.
54 */
55 type AppCheckToken = TAppCheckToken;
56 /**
57 * Type alias to {@link firebase-admin.app-check#DecodedAppCheckToken}.
58 */
59 type DecodedAppCheckToken = TDecodedAppCheckToken;
60 /**
61 * Type alias to {@link firebase-admin.app-check#VerifyAppCheckTokenResponse}.
62 */
63 type VerifyAppCheckTokenResponse = TVerifyAppCheckTokenResponse;
64 type AppCheckTokenOptions = TAppCheckTokenOptions;
65}