UNPKG

@aws-amplify/analytics

Version:

Analytics category of aws-amplify

19 lines (18 loc) • 929 B
/** * Wraps a Pinpoint (default-export) Analytics API so that invoking it emits a * one-time runtime deprecation warning before delegating to the underlying * implementation. The returned function is a transparent proxy — it preserves * the exact parameters, return value, and `this` binding of the wrapped API. * * The wrapper is typed as `TFn` (the full type of the wrapped function) rather * than being reconstructed from parameter/return inference, so that APIs with * multiple call signatures — e.g. the `fn(input)` / `fn(ctx, input)` context * overloads — surface ALL of their overloads on the wrapped export instead of * collapsing to a single signature. * * The warning is emitted at most once per wrapped API for the lifetime of the * module, so repeated calls do not spam the console. * * @internal */ export declare const deprecatePinpoint: <TFn extends (...args: any[]) => any>(fn: TFn) => TFn;