UNPKG

@tmlmobilidade/utils

Version:

This package provides a collection of common utility functions used across projects within the organization.

9 lines (8 loc) 454 B
/** * Creates a proxy for a singleton class that delays method access until the instance is initialized. * @param cls - A class with a static `getInstance` method that returns a promise resolving to the class instance. * @returns A proxy object that intercepts method calls and ensures the instance is initialized before invoking them. */ export declare function AsyncSingletonProxy<T extends object>(cls: { getInstance: () => Promise<T>; }): T;