1 | import './Globals';
|
2 | import { IStorePlugin, ICoordinatorOptions, IModel, IModelType, ICoordinator, IPlugin } from './Types';
|
3 | import { Repo } from "./Repo";
|
4 | import { PluginEventType } from "./PluginTypes";
|
5 |
|
6 |
|
7 |
|
8 | export declare type TModelTypeMap = {
|
9 | [clazzName: string]: IModelType;
|
10 | };
|
11 |
|
12 |
|
13 |
|
14 | export declare class Coordinator implements ICoordinator {
|
15 | private plugins;
|
16 | notify(eventType: PluginEventType, ...args: any[]): void;
|
17 | |
18 |
|
19 |
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | private modelMap;
|
29 | private models;
|
30 | |
31 |
|
32 |
|
33 |
|
34 |
|
35 | getModels(): IModelType[];
|
36 | private findModel(predicate);
|
37 | getModel(clazz: any): IModelType;
|
38 | getModelByName(name: string): IModelType;
|
39 | |
40 |
|
41 |
|
42 | private options;
|
43 | getOptions(): ICoordinatorOptions;
|
44 | private initialized;
|
45 | private startPromise;
|
46 | private internal;
|
47 | started: boolean;
|
48 | private checkInitialized(not?);
|
49 | private checkStarted(not?);
|
50 | stores(): IStorePlugin[];
|
51 | |
52 |
|
53 |
|
54 | init(newOptions: ICoordinatorOptions, ...newPlugins: IPlugin[]): Promise<ICoordinator>;
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 | start(...models: any[]): Promise<ICoordinator>;
|
61 | stop(): Promise<ICoordinator>;
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | execute<T>(fn: Function): Promise<T>;
|
70 | stopPlugins(): Promise<void>;
|
71 | |
72 |
|
73 |
|
74 |
|
75 |
|
76 | reset(): Promise<ICoordinator>;
|
77 | |
78 |
|
79 |
|
80 |
|
81 |
|
82 | registerModel(constructor: Function): this;
|
83 | private repoMap;
|
84 | /**
|
85 | * Get a repository for the specified model/class
|
86 | *
|
87 | * @param clazz
|
88 | * @returns {T}
|
89 | */
|
90 | getRepo<T extends Repo<M>, M extends IModel>(clazz: {
|
91 | new (): T;
|
92 | }): T;
|
93 | }
|