@firebase/app-check-types
Advanced tools
Comparing version 0.1.0-2021411163636 to 0.1.0-canary.1bbdbfef3
@@ -18,2 +18,4 @@ /** | ||
import { PartialObserver, Unsubscribe } from '@firebase/util'; | ||
export interface FirebaseAppCheck { | ||
@@ -40,2 +42,36 @@ /** | ||
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void; | ||
/** | ||
* Get the current App Check token. Attaches to the most recent | ||
* in-flight request if one is present. Returns null if no token | ||
* is present and no token requests are in flight. | ||
* | ||
* @param forceRefresh - If true, will always try to fetch a fresh token. | ||
* If false, will use a cached token if found in storage. | ||
*/ | ||
getToken(forceRefresh?: boolean): Promise<AppCheckTokenResult>; | ||
/** | ||
* Registers a listener to changes in the token state. There can be more | ||
* than one listener registered at the same time for one or more | ||
* App Check instances. The listeners call back on the UI thread whenever | ||
* the current token associated with this App Check instance changes. | ||
* | ||
* @returns A function that unsubscribes this listener. | ||
*/ | ||
onTokenChanged(observer: PartialObserver<AppCheckTokenResult>): Unsubscribe; | ||
/** | ||
* Registers a listener to changes in the token state. There can be more | ||
* than one listener registered at the same time for one or more | ||
* App Check instances. The listeners call back on the UI thread whenever | ||
* the current token associated with this App Check instance changes. | ||
* | ||
* @returns A function that unsubscribes this listener. | ||
*/ | ||
onTokenChanged( | ||
onNext: (tokenResult: AppCheckTokenResult) => void, | ||
onError?: (error: Error) => void, | ||
onCompletion?: () => void | ||
): Unsubscribe; | ||
} | ||
@@ -69,2 +105,12 @@ | ||
/** | ||
* Result returned by `getToken()`. | ||
*/ | ||
interface AppCheckTokenResult { | ||
/** | ||
* The token string in JWT format. | ||
*/ | ||
readonly token: string; | ||
} | ||
export type AppCheckComponentName = 'appCheck'; | ||
@@ -71,0 +117,0 @@ declare module '@firebase/component' { |
{ | ||
"name": "@firebase/app-check-types", | ||
"version": "0.1.0-2021411163636", | ||
"version": "0.1.0-canary.1bbdbfef3", | ||
"description": "@firebase/app-check Types", | ||
@@ -5,0 +5,0 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4879
4
108