import './Globals'; import { IStorePlugin, ICoordinatorOptions, IModel, IModelType, ICoordinator, IPlugin } from './Types'; import { Repo } from "./Repo"; import { PluginEventType } from "./PluginTypes"; /** * ClassName -> ModelClass Mapping table */ export declare type TModelTypeMap = { [clazzName: string]: IModelType; }; /** * The overall coordinator */ export declare class Coordinator implements ICoordinator { private plugins; notify(eventType: PluginEventType, ...args: any[]): void; /** * Model registration map type */ /** * Stores all registrations, enabling * them to be configured against a * changed client, multiple datasources, * utility scripts, etc * * @type {{}} */ private modelMap; private models; /** * Retrieve model registrations * * @returns {TModelTypeMap} */ getModels(): IModelType[]; private findModel(predicate); getModel(clazz: any): IModelType; getModelByName(name: string): IModelType; /** * Default options */ private options; getOptions(): ICoordinatorOptions; private initialized; private startPromise; private internal; started: boolean; private checkInitialized(not?); private checkStarted(not?); stores(): IStorePlugin[]; /** * Set the coordinator options */ init(newOptions: ICoordinatorOptions, ...newPlugins: IPlugin[]): Promise; /** * Start the coordinator and embedded store from options * * @returns {Bluebird} */ start(...models: any[]): Promise; stop(): Promise; /** * Execute function either immediately if * ready or when the starting Promise * completes * * @param fn */ execute(fn: Function): Promise; stopPlugins(): Promise; /** * Reset the coordinator status * * @returns {Coordinator.reset} */ reset(): Promise; /** * Register a model with the system * * @param constructor */ registerModel(constructor: Function): this; private repoMap; /** * Get a repository for the specified model/class * * @param clazz * @returns {T} */ getRepo, M extends IModel>(clazz: { new (): T; }): T; }