@aws-amplify/core
Version:
Core category of aws-amplify
25 lines (24 loc) • 761 B
TypeScript
import { AmplifyContext } from './AmplifyContext';
/**
* Returns the global {@link AmplifyContext} set by `Amplify.configure()`.
*
* @throws {@link NoAmplifyContextError} If `Amplify.configure()` has not been
* called yet and no context is available.
*/
export declare function getGlobalContext(): AmplifyContext;
/**
* Stores the given context as the global {@link AmplifyContext}.
*
* @internal
*/
export declare function setGlobalContext(ctx: AmplifyContext): void;
/**
* Returns `true` if a global {@link AmplifyContext} has been set.
*/
export declare function hasGlobalContext(): boolean;
/**
* Clears the global {@link AmplifyContext}.
*
* @internal — intended for testing and HMR.
*/
export declare function clearGlobalContext(): void;