import { Module } from './Module'; import { AnyBaseClass } from './types'; import { ApiModule } from './ApiModule'; /** * MoralisModues handles all registered modules. * Any package that is used in Moralis, should register itself via this class. * This allows cross-communication between modules and easy management of the modules * * This class is responsible for: * - registering new modules * - removing modules (in theory possible for exotic usecases, but might break the app if done after initialisation) * - getting individual modules by name, type or everything */ export declare class Modules { private readonly modules; /** * Register and setup a new module by providing a module that is extended from BaseClass. * This will throw an error if the name is not unique * @param module the module that needs to be registered */ register(module: AnyBaseClass): void; /** * Returns the module with the given name. * This module should have been registered with `register` * @param name the module name * @returns a valid BaseModule * @throws a MoralisCoreError if no module with the given name has been registered */ get(name: string): CurrentModule; /** * Tries to return the module with the given name if exist. Otherwise returns null. * @param name the module name * @returns a valid BaseModule or null */ tryGet(name: string): Module | null; has(name: string): boolean; /** * Returns the network module with the provided name. * @param name the module name * @returns a valid ApiModule * @throws a MoralisCoreError if no network module with the given name has been registered */ getApi(name: string): ApiModule; /** * Remove the module with the provided name, if it has been registered, * @param name the module name * @throws a MoralisCoreError if the module cannot be found. */ remove(name: string): void; /** * List all the registered modules * @returns an array of BaseModule that have been registered */ list(): Module[]; /** * Returns the names of all registered modules */ listNames(): string[]; /** * List all the registered api modules (eg. modules with the type CoreModuleType.API) */ listApis(): ApiModule[]; } //# sourceMappingURL=Modules.d.ts.map