export declare type Constructable = new (...args: any[]) => T; class ServiceLocator { private cache: Map, unknown | Symbol> = new Map(); locate(identifier: Constructable): T { const service = this.cache.get(identifier); if (service) return service as T; const value = new identifier(); this.cache.set(identifier, value); return value; } } export const setupServiceLocator = () => { serviceLocator = new ServiceLocator(); } export let serviceLocator: ServiceLocator;