UNPKG

1.76 kBTypeScriptView Raw
1import { AmplifyOutputs, AuthConfig, LegacyConfig, LibraryOptions, ResourcesConfig } from './types';
2import { AuthClass } from './Auth';
3import { ADD_OAUTH_LISTENER } from './constants';
4export declare class AmplifyClass {
5 private oAuthListener;
6 resourcesConfig: ResourcesConfig;
7 libraryOptions: LibraryOptions;
8 /**
9 * Cross-category Auth utilities.
10 *
11 * @internal
12 */
13 readonly Auth: AuthClass;
14 constructor();
15 /**
16 * Configures Amplify for use with your back-end resources.
17 *
18 * @remarks
19 * This API does not perform any merging of either `resourcesConfig` or `libraryOptions`. The most recently
20 * provided values will be used after configuration.
21 *
22 * @remarks
23 * `configure` can be used to specify additional library options where available for supported categories.
24 *
25 * @param resourceConfig - Back-end resource configuration. Typically provided via the `aws-exports.js` file.
26 * @param libraryOptions - Additional options for customizing the behavior of the library.
27 */
28 configure(resourcesConfig: ResourcesConfig | LegacyConfig | AmplifyOutputs, libraryOptions?: LibraryOptions): void;
29 /**
30 * Provides access to the current back-end resource configuration for the Library.
31 *
32 * @returns Returns the immutable back-end resource configuration.
33 */
34 getConfig(): Readonly<ResourcesConfig>;
35 /** @internal */
36 [ADD_OAUTH_LISTENER](listener: (authConfig: AuthConfig['Cognito']) => void): void;
37 private notifyOAuthListener;
38}
39/**
40 * The `Amplify` utility is used to configure the library.
41 *
42 * @remarks
43 * `Amplify` orchestrates cross-category communication within the library.
44 */
45export declare const Amplify: AmplifyClass;