@aws-amplify/core
Version:
Core category of aws-amplify
21 lines (20 loc) • 938 B
TypeScript
import { AmplifyClass } from '../singleton/Amplify';
import { AmplifyContext } from './AmplifyContext';
/**
* Bridges an {@link AmplifyClass} (a.k.a. `AmplifyClassV6`) instance to the
* {@link AmplifyContext} shape.
*
* `AmplifyClass` exposes `resourcesConfig` / `libraryOptions` directly but does
* NOT surface the top-level context methods (`fetchAuthSession` /
* `clearCredentials` / `getTokens`). Those live under its cross-category `Auth`
* utility, so this helper maps them through.
*
* This is the single shared implementation promoted into core (Phase C1). It is
* consumed by:
* - The server wrapper where a legacy `ContextSpec` provides an `AmplifyClass` instance.
* - The category internals (e.g. api-graphql / api-rest) that still receive an
* `AmplifyClassV6` until they migrate fully to `AmplifyContext`.
*
* @internal
*/
export declare const bridgeAmplifyClass: (amplify: AmplifyClass) => AmplifyContext;