@sprucelabs/heartwood-view-controllers 111.1.49 → 111.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/esm/types/heartwood.types.d.ts +1 -3
- package/build/esm/viewControllers/ViewControllerFactory.d.ts +2 -1
- package/build/esm/viewControllers/ViewControllerFactory.js +5 -4
- package/build/types/heartwood.types.d.ts +1 -3
- package/build/viewControllers/ViewControllerFactory.d.ts +2 -1
- package/build/viewControllers/ViewControllerFactory.js +5 -4
- package/package.json +1 -1
|
@@ -519,9 +519,7 @@ export interface AppController {
|
|
|
519
519
|
export type BuiltAppController = AppController & {
|
|
520
520
|
id: string;
|
|
521
521
|
};
|
|
522
|
-
export type AppControllerConstructor =
|
|
523
|
-
id: string;
|
|
524
|
-
};
|
|
522
|
+
export type AppControllerConstructor = new (options: ViewControllerOptions) => AppController;
|
|
525
523
|
export interface AppControllerLoadOptions {
|
|
526
524
|
router: Router;
|
|
527
525
|
authenticator: Authenticator;
|
|
@@ -22,7 +22,8 @@ export default class ViewControllerFactory {
|
|
|
22
22
|
static Factory(options: ViewControllerFactoryOptions): ViewControllerFactory;
|
|
23
23
|
setController<Vc extends ViewController<any>>(name: string, Class: ViewControllerConstructor<Vc>): void;
|
|
24
24
|
mixinControllers(map: Record<string, ViewControllerConstructor<ViewController<any>>>): void;
|
|
25
|
-
importControllers<Vc extends ImportedViewController>(Vcs: Vc[], plugins?: ViewControllerPluginsByName
|
|
25
|
+
importControllers<Vc extends ImportedViewController>(Vcs: Vc[], plugins?: ViewControllerPluginsByName): void;
|
|
26
|
+
setAppController(App: AppControllerConstructor): void;
|
|
26
27
|
private importPlugins;
|
|
27
28
|
BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
|
|
28
29
|
BuildApp<A extends AppController>(App: new (options: ViewControllerOptions) => A): A & {
|
|
@@ -65,15 +65,16 @@ export default class ViewControllerFactory {
|
|
|
65
65
|
mixinControllers(map) {
|
|
66
66
|
this.controllerMap = Object.assign(Object.assign({}, this.controllerMap), map);
|
|
67
67
|
}
|
|
68
|
-
importControllers(Vcs, plugins
|
|
68
|
+
importControllers(Vcs, plugins) {
|
|
69
69
|
for (const Vc of Vcs) {
|
|
70
70
|
this.controllerMap[Vc.id] = Vc;
|
|
71
71
|
}
|
|
72
|
-
if (App) {
|
|
73
|
-
this.AppMap[App.id] = App;
|
|
74
|
-
}
|
|
75
72
|
this.importPlugins(plugins);
|
|
76
73
|
}
|
|
74
|
+
setAppController(App) {
|
|
75
|
+
//@ts-ignore
|
|
76
|
+
this.AppMap[App.id] = App;
|
|
77
|
+
}
|
|
77
78
|
importPlugins(pluginsByName) {
|
|
78
79
|
for (const plugin in pluginsByName !== null && pluginsByName !== void 0 ? pluginsByName : []) {
|
|
79
80
|
const Plugin = pluginsByName[plugin];
|
|
@@ -519,9 +519,7 @@ export interface AppController {
|
|
|
519
519
|
export type BuiltAppController = AppController & {
|
|
520
520
|
id: string;
|
|
521
521
|
};
|
|
522
|
-
export type AppControllerConstructor =
|
|
523
|
-
id: string;
|
|
524
|
-
};
|
|
522
|
+
export type AppControllerConstructor = new (options: ViewControllerOptions) => AppController;
|
|
525
523
|
export interface AppControllerLoadOptions {
|
|
526
524
|
router: Router;
|
|
527
525
|
authenticator: Authenticator;
|
|
@@ -22,7 +22,8 @@ export default class ViewControllerFactory {
|
|
|
22
22
|
static Factory(options: ViewControllerFactoryOptions): ViewControllerFactory;
|
|
23
23
|
setController<Vc extends ViewController<any>>(name: string, Class: ViewControllerConstructor<Vc>): void;
|
|
24
24
|
mixinControllers(map: Record<string, ViewControllerConstructor<ViewController<any>>>): void;
|
|
25
|
-
importControllers<Vc extends ImportedViewController>(Vcs: Vc[], plugins?: ViewControllerPluginsByName
|
|
25
|
+
importControllers<Vc extends ImportedViewController>(Vcs: Vc[], plugins?: ViewControllerPluginsByName): void;
|
|
26
|
+
setAppController(App: AppControllerConstructor): void;
|
|
26
27
|
private importPlugins;
|
|
27
28
|
BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
|
|
28
29
|
BuildApp<A extends AppController>(App: new (options: ViewControllerOptions) => A): A & {
|
|
@@ -63,15 +63,16 @@ class ViewControllerFactory {
|
|
|
63
63
|
...map,
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
importControllers(Vcs, plugins
|
|
66
|
+
importControllers(Vcs, plugins) {
|
|
67
67
|
for (const Vc of Vcs) {
|
|
68
68
|
this.controllerMap[Vc.id] = Vc;
|
|
69
69
|
}
|
|
70
|
-
if (App) {
|
|
71
|
-
this.AppMap[App.id] = App;
|
|
72
|
-
}
|
|
73
70
|
this.importPlugins(plugins);
|
|
74
71
|
}
|
|
72
|
+
setAppController(App) {
|
|
73
|
+
//@ts-ignore
|
|
74
|
+
this.AppMap[App.id] = App;
|
|
75
|
+
}
|
|
75
76
|
importPlugins(pluginsByName) {
|
|
76
77
|
for (const plugin in pluginsByName ?? []) {
|
|
77
78
|
const Plugin = pluginsByName[plugin];
|
package/package.json
CHANGED