@equinor/fusion-framework-module-app 2.5.0 → 2.7.0
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/CHANGELOG.md +16 -0
- package/dist/esm/app/App.js +71 -7
- package/dist/esm/app/App.js.map +1 -1
- package/dist/esm/app/actions.js +1 -0
- package/dist/esm/app/actions.js.map +1 -1
- package/dist/esm/app/events.js +2 -0
- package/dist/esm/app/events.js.map +1 -0
- package/dist/esm/enable-app-module.js +10 -0
- package/dist/esm/enable-app-module.js.map +1 -0
- package/dist/esm/events.js +1 -6
- package/dist/esm/events.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/module.js +0 -3
- package/dist/esm/module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/app/App.d.ts +6 -2
- package/dist/types/app/actions.d.ts +8 -0
- package/dist/types/app/events.d.ts +29 -0
- package/dist/types/enable-app-module.d.ts +3 -0
- package/dist/types/events.d.ts +2 -13
- package/dist/types/index.d.ts +2 -1
- package/dist/types/module.d.ts +1 -2
- package/package.json +2 -2
- package/src/app/App.ts +100 -7
- package/src/app/actions.ts +7 -0
- package/src/app/events.ts +48 -0
- package/src/enable-app-module.ts +21 -0
- package/src/events.ts +2 -26
- package/src/index.ts +3 -1
- package/src/module.ts +1 -6
package/dist/types/app/App.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { OperatorFunction } from 'rxjs';
|
|
|
5
5
|
import { EventModule } from '@equinor/fusion-framework-module-event';
|
|
6
6
|
import { AnyModule, ModuleType } from '@equinor/fusion-framework-module';
|
|
7
7
|
import { AppBundleStateInitial } from './types';
|
|
8
|
-
import '
|
|
8
|
+
import './events';
|
|
9
9
|
export declare function filterEmpty<T>(): OperatorFunction<T | null | undefined, T>;
|
|
10
10
|
export declare class App<TEnv = any, TModules extends Array<AnyModule> | unknown = unknown> {
|
|
11
11
|
#private;
|
|
@@ -21,7 +21,11 @@ export declare class App<TEnv = any, TModules extends Array<AnyModule> | unknown
|
|
|
21
21
|
provider: AppModuleProvider;
|
|
22
22
|
event?: ModuleType<EventModule>;
|
|
23
23
|
});
|
|
24
|
-
initialize(): Observable<
|
|
24
|
+
initialize(): Observable<{
|
|
25
|
+
manifest: AppManifest;
|
|
26
|
+
script: AppScriptModule;
|
|
27
|
+
config: AppConfig;
|
|
28
|
+
}>;
|
|
25
29
|
loadConfig(): void;
|
|
26
30
|
loadManifest(): void;
|
|
27
31
|
loadAppModule(allow_cache?: boolean): Promise<void>;
|
|
@@ -19,6 +19,10 @@ declare const createActions: () => {
|
|
|
19
19
|
failure: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "import_app::failure", never, never>;
|
|
20
20
|
};
|
|
21
21
|
setInstance: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[instance: AppModulesInstance<unknown>], AppModulesInstance<unknown>, "set_instance", never, never>;
|
|
22
|
+
initialize: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[], null, "initialize_app::request", never, never> & {
|
|
23
|
+
success: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[], null, "initialize_app::success", never, never>;
|
|
24
|
+
failure: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "initialize_app::failure", never, never>;
|
|
25
|
+
};
|
|
22
26
|
};
|
|
23
27
|
export declare const actions: {
|
|
24
28
|
setManifest: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[manifest: AppManifest], AppManifest, "set_manifest", never, {
|
|
@@ -39,6 +43,10 @@ export declare const actions: {
|
|
|
39
43
|
failure: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "import_app::failure", never, never>;
|
|
40
44
|
};
|
|
41
45
|
setInstance: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[instance: AppModulesInstance<unknown>], AppModulesInstance<unknown>, "set_instance", never, never>;
|
|
46
|
+
initialize: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[], null, "initialize_app::request", never, never> & {
|
|
47
|
+
success: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[], null, "initialize_app::success", never, never>;
|
|
48
|
+
failure: import("@equinor/fusion-observable/dist/types/create-action").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "initialize_app::failure", never, never>;
|
|
49
|
+
};
|
|
42
50
|
};
|
|
43
51
|
export type ActionBuilder = ReturnType<typeof createActions>;
|
|
44
52
|
export type ActionMap = ActionInstanceMap<ActionBuilder>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event';
|
|
2
|
+
import type { App } from './App';
|
|
3
|
+
import type { AppConfig, AppManifest, AppModulesInstance } from '../types';
|
|
4
|
+
export interface AppEventEventInit<TDetail extends Record<string, unknown> | unknown = unknown> extends FrameworkEventInit<TDetail & {
|
|
5
|
+
appKey: string;
|
|
6
|
+
}, App> {
|
|
7
|
+
}
|
|
8
|
+
declare module '@equinor/fusion-framework-module-event' {
|
|
9
|
+
interface FrameworkEventMap {
|
|
10
|
+
onAppModulesLoaded: FrameworkEvent<AppEventEventInit<{
|
|
11
|
+
modules: AppModulesInstance;
|
|
12
|
+
}>>;
|
|
13
|
+
onAppManifestLoaded: FrameworkEvent<AppEventEventInit<{
|
|
14
|
+
manifest: AppManifest;
|
|
15
|
+
}>>;
|
|
16
|
+
onAppConfigLoaded: FrameworkEvent<AppEventEventInit<{
|
|
17
|
+
config: AppConfig;
|
|
18
|
+
}>>;
|
|
19
|
+
onAppScriptLoaded: FrameworkEvent<AppEventEventInit<{
|
|
20
|
+
manifest: AppManifest;
|
|
21
|
+
}>>;
|
|
22
|
+
onAppDispose: FrameworkEvent<AppEventEventInit>;
|
|
23
|
+
onAppInitialize: FrameworkEvent<AppEventEventInit>;
|
|
24
|
+
onAppInitialized: FrameworkEvent<AppEventEventInit>;
|
|
25
|
+
onAppInitializeFailed: FrameworkEvent<AppEventEventInit<{
|
|
26
|
+
error: unknown;
|
|
27
|
+
}>>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IModulesConfigurator } from '@equinor/fusion-framework-module';
|
|
2
|
+
import type { AppConfigBuilderCallback } from './AppConfigBuilder';
|
|
3
|
+
export declare const enableAppModule: (configurator: IModulesConfigurator<any, any>, builder?: AppConfigBuilderCallback) => void;
|
package/dist/types/events.d.ts
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import { AnyModule } from '@equinor/fusion-framework-module';
|
|
2
1
|
import { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event';
|
|
3
2
|
import { App } from './app/App';
|
|
4
|
-
import
|
|
5
|
-
import { AppModulesInstance } from './types';
|
|
6
|
-
type AppModulesLoadedEventInit<TModules extends Array<AnyModule> | unknown = unknown> = FrameworkEventInit<{
|
|
7
|
-
appKey: string;
|
|
8
|
-
modules: AppModulesInstance<TModules>;
|
|
9
|
-
}>;
|
|
10
|
-
export declare class AppModulesLoadedEvent<TModules extends Array<AnyModule> | unknown = unknown> extends FrameworkEvent<AppModulesLoadedEventInit<TModules>> {
|
|
11
|
-
constructor(appKey: string, modules: AppModulesInstance<TModules>, init?: Omit<AppModulesLoadedEventInit<TModules>, 'detail'>);
|
|
12
|
-
}
|
|
3
|
+
import './app/events';
|
|
13
4
|
declare module '@equinor/fusion-framework-module-event' {
|
|
14
5
|
interface FrameworkEventMap {
|
|
15
|
-
onAppModulesLoaded: AppModulesLoadedEvent;
|
|
16
6
|
onCurrentAppChanged: FrameworkEvent<FrameworkEventInit<{
|
|
17
7
|
next?: App;
|
|
18
8
|
previous?: App;
|
|
19
|
-
}
|
|
9
|
+
}>>;
|
|
20
10
|
}
|
|
21
11
|
}
|
|
22
|
-
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { AppModuleProvider } from './AppModuleProvider';
|
|
|
3
3
|
export { App } from './app/App';
|
|
4
4
|
export * from './events';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export {
|
|
6
|
+
export { enableAppModule } from './enable-app-module';
|
|
7
|
+
export { default, AppModule, module, moduleKey } from './module';
|
package/dist/types/module.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Module } from '@equinor/fusion-framework-module';
|
|
2
2
|
import { ModuleDeps } from './types';
|
|
3
3
|
import { IAppConfigurator } from './AppConfigurator';
|
|
4
4
|
import { AppModuleProvider } from './AppModuleProvider';
|
|
5
5
|
export declare const moduleKey = "app";
|
|
6
6
|
export type AppModule = Module<typeof moduleKey, AppModuleProvider, IAppConfigurator, ModuleDeps>;
|
|
7
7
|
export declare const module: AppModule;
|
|
8
|
-
export declare const enableAppModule: (configurator: IModulesConfigurator<any, any>) => void;
|
|
9
8
|
export default module;
|
|
10
9
|
declare module '@equinor/fusion-framework-module' {
|
|
11
10
|
interface Modules {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-module-app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"@equinor/fusion-framework-module-service-discovery": "^4.0.8",
|
|
46
46
|
"typescript": "^4.9.3"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "02656c04230873efa4aaa758d9b3a974148915f7"
|
|
49
49
|
}
|
package/src/app/App.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { createState } from './create-state';
|
|
|
18
18
|
import { actions, Actions } from './actions';
|
|
19
19
|
import { AppBundleState, AppBundleStateInitial } from './types';
|
|
20
20
|
|
|
21
|
-
import '
|
|
21
|
+
import './events';
|
|
22
22
|
|
|
23
23
|
// TODO - move globally
|
|
24
24
|
export function filterEmpty<T>(): OperatorFunction<T | null | undefined, T> {
|
|
@@ -87,12 +87,17 @@ export class App<TEnv = any, TModules extends Array<AnyModule> | unknown = unkno
|
|
|
87
87
|
this.#state = createState(value, args.provider);
|
|
88
88
|
|
|
89
89
|
const { appKey } = value;
|
|
90
|
+
const { event } = args;
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
event && this.#registerEvents(event);
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
const subscriptions = new Subscription();
|
|
95
|
+
if (event) {
|
|
96
|
+
subscriptions.add(() => {
|
|
97
|
+
event.dispatchEvent('onAppDispose', { detail: { appKey } });
|
|
98
|
+
});
|
|
94
99
|
subscriptions.add(
|
|
95
|
-
|
|
100
|
+
event.addEventListener('onAppModulesLoaded', (e) => {
|
|
96
101
|
if (e.detail.appKey === appKey) {
|
|
97
102
|
this.#state.next(actions.setInstance(e.detail.modules));
|
|
98
103
|
}
|
|
@@ -101,16 +106,104 @@ export class App<TEnv = any, TModules extends Array<AnyModule> | unknown = unkno
|
|
|
101
106
|
}
|
|
102
107
|
|
|
103
108
|
this.dispose = () => {
|
|
109
|
+
subscriptions?.unsubscribe();
|
|
104
110
|
if (this.#state.value.instance) {
|
|
111
|
+
/** tear down modules of application */
|
|
105
112
|
this.#state.value.instance.dispose();
|
|
106
113
|
}
|
|
107
|
-
subscriptions.unsubscribe();
|
|
108
114
|
this.#state.complete();
|
|
109
115
|
};
|
|
110
116
|
}
|
|
111
117
|
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
#registerEvents(event: ModuleType<EventModule>): void {
|
|
119
|
+
const { appKey } = this;
|
|
120
|
+
|
|
121
|
+
this.#state.addEffect(actions.fetchManifest.success.type, (action) => {
|
|
122
|
+
event.dispatchEvent('onAppManifestLoaded', {
|
|
123
|
+
detail: { appKey, manifest: action.payload },
|
|
124
|
+
source: this,
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
this.#state.addEffect(actions.fetchConfig.success.type, (action) => {
|
|
129
|
+
event.dispatchEvent('onAppConfigLoaded', {
|
|
130
|
+
detail: { appKey, manifest: action.payload },
|
|
131
|
+
source: this,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
this.#state.addEffect(actions.importApp.success.type, (action) => {
|
|
136
|
+
event.dispatchEvent('onAppScriptLoaded', {
|
|
137
|
+
detail: { appKey, manifest: action.payload },
|
|
138
|
+
source: this,
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
this.#state.addEffect(actions.initialize.type, () => {
|
|
143
|
+
event.dispatchEvent('onAppInitialize', {
|
|
144
|
+
detail: { appKey },
|
|
145
|
+
source: this,
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
this.#state.addEffect(actions.initialize.success.type, () => {
|
|
150
|
+
event.dispatchEvent('onAppInitialized', {
|
|
151
|
+
detail: { appKey },
|
|
152
|
+
source: this,
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
this.#state.addEffect(actions.initialize.failure.type, ({ payload }) => {
|
|
157
|
+
event.dispatchEvent('onAppInitializeFailed', {
|
|
158
|
+
detail: { appKey, error: payload },
|
|
159
|
+
source: this,
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The initializing request won`t trigger until subscribing to the returned observable
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* app.initialize().subscribe({
|
|
170
|
+
* next: (value) => {
|
|
171
|
+
* value.script.render(el, ...);
|
|
172
|
+
* },
|
|
173
|
+
* error: (err) => console.error('failed to load application', err),
|
|
174
|
+
* complete: () => setInitializingApp(false)
|
|
175
|
+
* })
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
public initialize(): Observable<{
|
|
179
|
+
manifest: AppManifest;
|
|
180
|
+
script: AppScriptModule;
|
|
181
|
+
config: AppConfig;
|
|
182
|
+
}> {
|
|
183
|
+
return new Observable((observer) => {
|
|
184
|
+
this.#state.next(actions.initialize());
|
|
185
|
+
observer.add(
|
|
186
|
+
combineLatest([
|
|
187
|
+
this.getManifest(),
|
|
188
|
+
this.getAppModule(),
|
|
189
|
+
this.getConfig(),
|
|
190
|
+
]).subscribe({
|
|
191
|
+
next: ([manifest, script, config]) =>
|
|
192
|
+
observer.next({
|
|
193
|
+
manifest,
|
|
194
|
+
script,
|
|
195
|
+
config,
|
|
196
|
+
}),
|
|
197
|
+
error: (err) => {
|
|
198
|
+
observer.error(err), this.#state.next(actions.initialize.failure(err));
|
|
199
|
+
},
|
|
200
|
+
complete: () => {
|
|
201
|
+
this.#state.next(actions.initialize.success());
|
|
202
|
+
observer.complete();
|
|
203
|
+
},
|
|
204
|
+
})
|
|
205
|
+
);
|
|
206
|
+
});
|
|
114
207
|
}
|
|
115
208
|
|
|
116
209
|
public loadConfig() {
|
package/src/app/actions.ts
CHANGED
|
@@ -40,6 +40,13 @@ const createActions = () => ({
|
|
|
40
40
|
setInstance: createAction('set_instance', (instance: AppModulesInstance) => ({
|
|
41
41
|
payload: instance,
|
|
42
42
|
})),
|
|
43
|
+
|
|
44
|
+
initialize: createAsyncAction(
|
|
45
|
+
'initialize_app',
|
|
46
|
+
() => ({ payload: null }),
|
|
47
|
+
() => ({ payload: null }),
|
|
48
|
+
(error: unknown) => ({ payload: error })
|
|
49
|
+
),
|
|
43
50
|
});
|
|
44
51
|
|
|
45
52
|
export const actions = createActions();
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event';
|
|
2
|
+
|
|
3
|
+
import type { App } from './App';
|
|
4
|
+
|
|
5
|
+
import type { AppConfig, AppManifest, AppModulesInstance } from '../types';
|
|
6
|
+
|
|
7
|
+
export interface AppEventEventInit<TDetail extends Record<string, unknown> | unknown = unknown>
|
|
8
|
+
extends FrameworkEventInit<TDetail & { appKey: string }, App> {}
|
|
9
|
+
|
|
10
|
+
declare module '@equinor/fusion-framework-module-event' {
|
|
11
|
+
interface FrameworkEventMap {
|
|
12
|
+
onAppModulesLoaded: FrameworkEvent<
|
|
13
|
+
AppEventEventInit<{
|
|
14
|
+
modules: AppModulesInstance;
|
|
15
|
+
}>
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
onAppManifestLoaded: FrameworkEvent<
|
|
19
|
+
AppEventEventInit<{
|
|
20
|
+
manifest: AppManifest;
|
|
21
|
+
}>
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
onAppConfigLoaded: FrameworkEvent<
|
|
25
|
+
AppEventEventInit<{
|
|
26
|
+
config: AppConfig;
|
|
27
|
+
}>
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
onAppScriptLoaded: FrameworkEvent<
|
|
31
|
+
AppEventEventInit<{
|
|
32
|
+
manifest: AppManifest;
|
|
33
|
+
}>
|
|
34
|
+
>;
|
|
35
|
+
|
|
36
|
+
onAppDispose: FrameworkEvent<AppEventEventInit>;
|
|
37
|
+
|
|
38
|
+
onAppInitialize: FrameworkEvent<AppEventEventInit>;
|
|
39
|
+
|
|
40
|
+
onAppInitialized: FrameworkEvent<AppEventEventInit>;
|
|
41
|
+
|
|
42
|
+
onAppInitializeFailed: FrameworkEvent<
|
|
43
|
+
AppEventEventInit<{
|
|
44
|
+
error: unknown;
|
|
45
|
+
}>
|
|
46
|
+
>;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IModulesConfigurator } from '@equinor/fusion-framework-module';
|
|
2
|
+
import type { AppConfigBuilderCallback } from './AppConfigBuilder';
|
|
3
|
+
|
|
4
|
+
import { module } from './module';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Method for enabling the Service module
|
|
8
|
+
* @param configurator - configuration object
|
|
9
|
+
*/
|
|
10
|
+
export const enableAppModule = (
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
configurator: IModulesConfigurator<any, any>,
|
|
13
|
+
builder?: AppConfigBuilderCallback
|
|
14
|
+
): void => {
|
|
15
|
+
configurator.addConfig({
|
|
16
|
+
module,
|
|
17
|
+
configure: (appConfigurator) => {
|
|
18
|
+
builder && appConfigurator.addConfigBuilder(builder);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
};
|
package/src/events.ts
CHANGED
|
@@ -1,34 +1,10 @@
|
|
|
1
|
-
import { AnyModule } from '@equinor/fusion-framework-module';
|
|
2
|
-
|
|
3
1
|
import { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event';
|
|
4
2
|
import { App } from './app/App';
|
|
5
|
-
import AppModuleProvider from './AppModuleProvider';
|
|
6
|
-
|
|
7
|
-
import { AppModulesInstance } from './types';
|
|
8
|
-
|
|
9
|
-
type AppModulesLoadedEventInit<TModules extends Array<AnyModule> | unknown = unknown> =
|
|
10
|
-
FrameworkEventInit<{
|
|
11
|
-
appKey: string;
|
|
12
|
-
modules: AppModulesInstance<TModules>;
|
|
13
|
-
}>;
|
|
14
3
|
|
|
15
|
-
|
|
16
|
-
TModules extends Array<AnyModule> | unknown = unknown
|
|
17
|
-
> extends FrameworkEvent<AppModulesLoadedEventInit<TModules>> {
|
|
18
|
-
constructor(
|
|
19
|
-
appKey: string,
|
|
20
|
-
modules: AppModulesInstance<TModules>,
|
|
21
|
-
init?: Omit<AppModulesLoadedEventInit<TModules>, 'detail'>
|
|
22
|
-
) {
|
|
23
|
-
super('onAppModulesLoaded', { ...init, detail: { appKey, modules } });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
4
|
+
import './app/events';
|
|
26
5
|
|
|
27
6
|
declare module '@equinor/fusion-framework-module-event' {
|
|
28
7
|
interface FrameworkEventMap {
|
|
29
|
-
|
|
30
|
-
onCurrentAppChanged: FrameworkEvent<
|
|
31
|
-
FrameworkEventInit<{ next?: App; previous?: App }, AppModuleProvider>
|
|
32
|
-
>;
|
|
8
|
+
onCurrentAppChanged: FrameworkEvent<FrameworkEventInit<{ next?: App; previous?: App }>>;
|
|
33
9
|
}
|
|
34
10
|
}
|
package/src/index.ts
CHANGED
|
@@ -11,4 +11,6 @@ export { App } from './app/App';
|
|
|
11
11
|
export * from './events';
|
|
12
12
|
export * from './types';
|
|
13
13
|
|
|
14
|
-
export {
|
|
14
|
+
export { enableAppModule } from './enable-app-module';
|
|
15
|
+
|
|
16
|
+
export { default, AppModule, module, moduleKey } from './module';
|
package/src/module.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Module } from '@equinor/fusion-framework-module';
|
|
2
2
|
import { ModuleDeps } from './types';
|
|
3
3
|
|
|
4
4
|
import { IAppConfigurator, AppConfigurator } from './AppConfigurator';
|
|
@@ -21,11 +21,6 @@ export const module: AppModule = {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
-
export const enableAppModule = (configurator: IModulesConfigurator<any, any>) => {
|
|
26
|
-
configurator.addConfig({ module });
|
|
27
|
-
};
|
|
28
|
-
|
|
29
24
|
export default module;
|
|
30
25
|
|
|
31
26
|
declare module '@equinor/fusion-framework-module' {
|