import { Type, Injector } from '@angular/core'; import { Destroyable } from '@bespunky/angular-zen/core'; import { IGoogleMap } from '../i-google-map'; import { ChargedSuperpowers } from './superpowers.token'; import { ISuperpowers } from './i-superpowers'; import { ISuperpower } from './i-superpower'; /** * Manages all superpowers for a single map instance. Provided in the map component's injector to allow a clean state for each initialized map component. * * This service communicates with `SuperpowersChargerService` through the `Superpowers` token. * `SuperpowersChargerService` registeres power types globally, and `SuperpowersService` instantiates them for the map it * was created for. */ export declare class SuperpowersService extends Destroyable implements ISuperpowers { private injector; private map; private powers; /** * Creates an instance of SuperpowersService. * * @param {ChargedSuperpowers} chargedPowers All the superpower types currently charged and known to the system. * @param {Injector} injector The instance of the injector service. */ constructor(chargedPowers: ChargedSuperpowers, injector: Injector); /** * Instantiates a single superpower. If a map was already registered, the superpower will be attached to it. * Superpowers already registered will be ignored. * * @private * @param {Type} superpowerType The type of superpower to load. */ private load; /** * Attaches all superpowers to the given map. * Any lazy loaded superpowers registered after the call to `attachToMap()` will automatically attach to it as well. * * @param {IGoogleMap} map The map to attach the superpowers to. */ attachToMap(map: IGoogleMap): void; /** * Extracts a superpower by its type. The superpower must be previously registered using `SuperpowersChargerService.charge()`. * Attempting to use unregistered superpowers will fail with an error. * * @template T The type of superpower being extracted. * @param {Type} type The type of superpower being extracted. * @returns {T} The extracted superpower instance. */ use(type: Type): T; /** * Counts the number of powers instantiated. * * @readonly * @type {number} */ get count(): number; }