aws-amplify
Version:
AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.
39 lines (38 loc) • 1.83 kB
TypeScript
import { AmplifyContext, LibraryOptions, ResourcesConfig } from '@aws-amplify/core';
/**
* @deprecated Use {@link AmplifyContext} directly instead. This namespace is
* retained only for backwards compatibility with consumers (e.g. adapter
* packages) that still reference the removed server-context types
* (`AmplifyServer.ContextSpec`, `Context`, `ContextToken`,
* `RunOperationWithContext`). All of these now map onto the branded
* {@link AmplifyContext} model.
*/
export declare namespace AmplifyServer {
/** @deprecated Use {@link AmplifyContext} instead. */
type ContextSpec = AmplifyContext;
/**
* @deprecated The server-context registry (and its opaque token) has been
* removed in favor of the branded {@link AmplifyContext} model. This shape
* is preserved only so existing type references keep compiling.
*/
interface ContextToken {
readonly value: symbol;
}
/**
* @deprecated Use {@link AmplifyContext} instead. The deleted original
* wrapped the per-context `AmplifyClass`; that role is now filled by the
* branded {@link AmplifyContext}, so `amplify` is typed as an
* {@link AmplifyContext}.
*/
interface Context {
amplify: AmplifyContext;
}
/**
* @deprecated The server-context manager has been removed in favor of the
* branded {@link AmplifyContext} model. Prefer building a context explicitly
* with `createAmplifyContext()`. Mirrors the deleted original, with the
* operation's `contextSpec` argument mapped onto {@link ContextSpec}
* (i.e. {@link AmplifyContext}).
*/
type RunOperationWithContext = <Result>(amplifyConfig: ResourcesConfig, libraryOptions: LibraryOptions, operation: (contextSpec: AmplifyServer.ContextSpec) => Result | Promise<Result>) => Promise<Result>;
}