@aws-amplify/core
Version:
Core category of aws-amplify
29 lines (28 loc) • 1.18 kB
TypeScript
import { AuthConfig, AuthSession, AuthTokens, FetchAuthSessionOptions, LibraryAuthOptions } from './types';
export declare class AuthClass {
private authConfig?;
private authOptions?;
/**
* Configure Auth category
*
* @internal
*
* @param authResourcesConfig - Resources configurations required by Auth providers.
* @param authOptions - Client options used by library
*
* @returns void
*/
configure(authResourcesConfig: AuthConfig, authOptions?: LibraryAuthOptions): void;
/**
* Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it
* does not refresh the auth tokens or credentials if they are loaded in storage already. You can force a refresh
* with `{ forceRefresh: true }` input.
*
* @param options - Options configuring the fetch behavior.
*
* @returns Promise of current auth session {@link AuthSession}.
*/
fetchAuthSession(options?: FetchAuthSessionOptions): Promise<AuthSession>;
clearCredentials(): Promise<void>;
getTokens(options: FetchAuthSessionOptions): Promise<AuthTokens | undefined>;
}