Skip to content

Commit

Permalink
Fix documentation (#4875)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 committed May 10, 2021
1 parent 66deb25 commit 6e35e53
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
20 changes: 19 additions & 1 deletion packages/app-check-types/index.d.ts
Expand Up @@ -28,17 +28,35 @@ export interface FirebaseAppCheck {
siteKeyOrProvider: string | AppCheckProvider,
isTokenAutoRefreshEnabled?: boolean
): void;

/**
*
* @param isTokenAutoRefreshEnabled - If true, the SDK automatically
* refreshes App Check tokens as needed. This overrides any value set
* during `activate()`.
*/
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
}

/**
* An App Check provider. This can be either the built-in reCAPTCHA provider
* or a custom provider. For more on custom providers, see
* https://firebase.google.com/docs/app-check/web-custom-provider
*/
interface AppCheckProvider {
/**
* returns an AppCheck token
* Returns an AppCheck token.
*/
getToken(): Promise<AppCheckToken>;
}

/**
* The token returned from an `AppCheckProvider`.
*/
interface AppCheckToken {
/**
* The token string in JWT format.
*/
readonly token: string;
/**
* The local timestamp after which the token will expire.
Expand Down
33 changes: 30 additions & 3 deletions packages/firebase/index.d.ts
Expand Up @@ -1469,19 +1469,46 @@ declare namespace firebase.appCheck {
export interface AppCheck {
/**
* Activate AppCheck
* @param siteKeyOrOrovider - reCAPTCHA sitekey or custom token provider
* @param siteKeyOrProvider reCAPTCHA v3 site key (public key) or
* custom token provider.
* @param isTokenAutoRefreshEnabled If true, the SDK automatically
* refreshes App Check tokens as needed. If undefined, defaults to the
* value of `app.automaticDataCollectionEnabled`, which defaults to
* false and can be set in the app config.
*/
activate(
siteKeyOrProvider: string | AppCheckProvider,
isTokenAutoRefreshEnabled?: boolean
): void;

/**
*
* @param isTokenAutoRefreshEnabled If true, the SDK automatically
* refreshes App Check tokens as needed. This overrides any value set
* during `activate()`.
*/
activate(siteKeyOrProvider: string | AppCheckProvider): void;
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
}

/**
* An App Check provider. This can be either the built-in reCAPTCHA
* provider or a custom provider. For more on custom providers, see
* https://firebase.google.com/docs/app-check/web-custom-provider
*/
interface AppCheckProvider {
/**
* returns an AppCheck token
* Returns an AppCheck token.
*/
getToken(): Promise<AppCheckToken>;
}

/**
* The token returned from an {@link firebase.appCheck.AppCheckProvider `AppCheckProvider`}.
*/
interface AppCheckToken {
/**
* The token string in JWT format.
*/
readonly token: string;
/**
* The local timestamp after which the token will expire.
Expand Down

0 comments on commit 6e35e53

Please sign in to comment.