@sprucelabs/heartwood-view-controllers 111.1.31 → 111.1.32
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 +3 -1
- package/build/esm/viewControllers/ViewControllerFactory.d.ts +1 -0
- package/build/esm/viewControllers/ViewControllerFactory.js +3 -2
- package/build/types/heartwood.types.d.ts +3 -1
- package/build/viewControllers/ViewControllerFactory.d.ts +1 -0
- package/build/viewControllers/ViewControllerFactory.js +3 -2
- package/package.json +1 -1
|
@@ -516,7 +516,9 @@ export interface AppViewController {
|
|
|
516
516
|
renderToolBelt?(): ToolBelt | null | undefined;
|
|
517
517
|
load?(options: AppViewControllerLoadOptions): Promise<void>;
|
|
518
518
|
}
|
|
519
|
-
export type AppViewControllerConstructor = new (options: ViewControllerOptions) => AppViewController
|
|
519
|
+
export type AppViewControllerConstructor = (new (options: ViewControllerOptions) => AppViewController) & {
|
|
520
|
+
id: string;
|
|
521
|
+
};
|
|
520
522
|
export interface AppViewControllerLoadOptions {
|
|
521
523
|
router: Router;
|
|
522
524
|
authenticator: Authenticator;
|
|
@@ -27,6 +27,7 @@ export default class ViewControllerFactory {
|
|
|
27
27
|
BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
|
|
28
28
|
BuildApp<A extends AppViewController>(App: new (options: ViewControllerOptions) => A): A;
|
|
29
29
|
hasController(name: string): boolean;
|
|
30
|
+
hasApp(namespace: string): boolean;
|
|
30
31
|
getController<N extends ViewControllerId>(name: N): any;
|
|
31
32
|
setDates(dates: DateUtil): void;
|
|
32
33
|
addPlugin(named: string, plugin: ViewControllerPlugin): void;
|
|
@@ -67,11 +67,9 @@ export default class ViewControllerFactory {
|
|
|
67
67
|
}
|
|
68
68
|
importControllers(Vcs, plugins, App) {
|
|
69
69
|
for (const Vc of Vcs) {
|
|
70
|
-
//@ts-ignore
|
|
71
70
|
this.controllerMap[Vc.id] = Vc;
|
|
72
71
|
}
|
|
73
72
|
if (App) {
|
|
74
|
-
//@ts-ignore
|
|
75
73
|
this.AppMap[App.id] = App;
|
|
76
74
|
}
|
|
77
75
|
this.importPlugins(plugins);
|
|
@@ -92,6 +90,9 @@ export default class ViewControllerFactory {
|
|
|
92
90
|
//@ts-ignore
|
|
93
91
|
return !!this.controllerMap[name];
|
|
94
92
|
}
|
|
93
|
+
hasApp(namespace) {
|
|
94
|
+
return !!this.AppMap[namespace];
|
|
95
|
+
}
|
|
95
96
|
getController(name) {
|
|
96
97
|
return this.controllerMap[name];
|
|
97
98
|
}
|
|
@@ -516,7 +516,9 @@ export interface AppViewController {
|
|
|
516
516
|
renderToolBelt?(): ToolBelt | null | undefined;
|
|
517
517
|
load?(options: AppViewControllerLoadOptions): Promise<void>;
|
|
518
518
|
}
|
|
519
|
-
export type AppViewControllerConstructor = new (options: ViewControllerOptions) => AppViewController
|
|
519
|
+
export type AppViewControllerConstructor = (new (options: ViewControllerOptions) => AppViewController) & {
|
|
520
|
+
id: string;
|
|
521
|
+
};
|
|
520
522
|
export interface AppViewControllerLoadOptions {
|
|
521
523
|
router: Router;
|
|
522
524
|
authenticator: Authenticator;
|
|
@@ -27,6 +27,7 @@ export default class ViewControllerFactory {
|
|
|
27
27
|
BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
|
|
28
28
|
BuildApp<A extends AppViewController>(App: new (options: ViewControllerOptions) => A): A;
|
|
29
29
|
hasController(name: string): boolean;
|
|
30
|
+
hasApp(namespace: string): boolean;
|
|
30
31
|
getController<N extends ViewControllerId>(name: N): any;
|
|
31
32
|
setDates(dates: DateUtil): void;
|
|
32
33
|
addPlugin(named: string, plugin: ViewControllerPlugin): void;
|
|
@@ -65,11 +65,9 @@ class ViewControllerFactory {
|
|
|
65
65
|
}
|
|
66
66
|
importControllers(Vcs, plugins, App) {
|
|
67
67
|
for (const Vc of Vcs) {
|
|
68
|
-
//@ts-ignore
|
|
69
68
|
this.controllerMap[Vc.id] = Vc;
|
|
70
69
|
}
|
|
71
70
|
if (App) {
|
|
72
|
-
//@ts-ignore
|
|
73
71
|
this.AppMap[App.id] = App;
|
|
74
72
|
}
|
|
75
73
|
this.importPlugins(plugins);
|
|
@@ -90,6 +88,9 @@ class ViewControllerFactory {
|
|
|
90
88
|
//@ts-ignore
|
|
91
89
|
return !!this.controllerMap[name];
|
|
92
90
|
}
|
|
91
|
+
hasApp(namespace) {
|
|
92
|
+
return !!this.AppMap[namespace];
|
|
93
|
+
}
|
|
93
94
|
getController(name) {
|
|
94
95
|
return this.controllerMap[name];
|
|
95
96
|
}
|
package/package.json
CHANGED