@equinor/fusion-framework-module-widget 9.0.2 → 9.0.4

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +185 -162
  2. package/dist/esm/Widget.js +3 -2
  3. package/dist/esm/Widget.js.map +1 -1
  4. package/dist/esm/WidgetModuleConfigurator.js.map +1 -1
  5. package/dist/esm/WidgetModuleProvider.js.map +1 -1
  6. package/dist/esm/enable-widget-module.js.map +1 -1
  7. package/dist/esm/errors.js.map +1 -1
  8. package/dist/esm/module.js.map +1 -1
  9. package/dist/esm/state/actions.js.map +1 -1
  10. package/dist/esm/state/create-reducer.js.map +1 -1
  11. package/dist/esm/state/create-state.js.map +1 -1
  12. package/dist/esm/state/flows.js.map +1 -1
  13. package/dist/esm/utils.js.map +1 -1
  14. package/dist/esm/version.js +1 -1
  15. package/dist/tsconfig.tsbuildinfo +1 -1
  16. package/dist/types/Widget.d.ts +5 -5
  17. package/dist/types/WidgetModuleConfigurator.d.ts +1 -1
  18. package/dist/types/WidgetModuleProvider.d.ts +4 -4
  19. package/dist/types/enable-widget-module.d.ts +1 -1
  20. package/dist/types/module.d.ts +3 -3
  21. package/dist/types/state/actions.d.ts +2 -2
  22. package/dist/types/state/create-reducer.d.ts +1 -1
  23. package/dist/types/state/create-state.d.ts +2 -2
  24. package/dist/types/state/flows.d.ts +1 -1
  25. package/dist/types/types.d.ts +1 -1
  26. package/dist/types/utils.d.ts +2 -2
  27. package/dist/types/version.d.ts +1 -1
  28. package/package.json +13 -13
  29. package/src/Widget.ts +295 -294
  30. package/src/WidgetModuleConfigurator.ts +45 -45
  31. package/src/WidgetModuleProvider.ts +144 -144
  32. package/src/enable-widget-module.ts +10 -10
  33. package/src/errors.ts +52 -56
  34. package/src/events.ts +51 -51
  35. package/src/module.ts +23 -23
  36. package/src/state/actions.ts +56 -56
  37. package/src/state/create-reducer.ts +33 -33
  38. package/src/state/create-state.ts +10 -10
  39. package/src/state/flows.ts +57 -57
  40. package/src/types.ts +38 -38
  41. package/src/utils.ts +44 -44
  42. package/src/version.ts +1 -1
@@ -1,67 +1,67 @@
1
1
  import { BaseConfigBuilder, type ConfigBuilderCallback } from '@equinor/fusion-framework-module';
2
- import { ConfigBuilderCallbackArgs } from '@equinor/fusion-framework-module';
2
+ import type { ConfigBuilderCallbackArgs } from '@equinor/fusion-framework-module';
3
3
  import { createDefaultClient } from './utils';
4
4
  import type { IClient } from './types';
5
5
 
6
6
  // Define the configuration type for the WidgetModule
7
7
  export type WidgetModuleConfig = {
8
- client: IClient;
8
+ client: IClient;
9
9
  };
10
10
 
11
11
  // Define a callback type for configuring the WidgetModule
12
12
  export type WidgetModuleConfigBuilderCallback = (
13
- builder: WidgetModuleConfigurator,
13
+ builder: WidgetModuleConfigurator,
14
14
  ) => void | Promise<void>;
15
15
 
16
16
  // Class responsible for configuring the WidgetModule
17
17
  export class WidgetModuleConfigurator extends BaseConfigBuilder<WidgetModuleConfig> {
18
- // Default expiration time for configurations (1 minute)
19
- defaultExpireTime = 1 * 60 * 1000;
18
+ // Default expiration time for configurations (1 minute)
19
+ defaultExpireTime = 1 * 60 * 1000;
20
20
 
21
- /**
22
- * Set the client for the WidgetModule configuration.
23
- * @param cb - Callback function to configure the client.
24
- */
25
- public setClient(cb: ConfigBuilderCallback<IClient>) {
26
- this._set('client', cb);
27
- }
21
+ /**
22
+ * Set the client for the WidgetModule configuration.
23
+ * @param cb - Callback function to configure the client.
24
+ */
25
+ public setClient(cb: ConfigBuilderCallback<IClient>) {
26
+ this._set('client', cb);
27
+ }
28
28
 
29
- /**
30
- * Create an HTTP client based on the provided parameters.
31
- * @param clientId - Identifier for the client.
32
- * @param init - Configuration builder callback arguments.
33
- * @returns An instance of the HTTP client.
34
- */
35
- private async _createHttpClient(clientId: string, init: ConfigBuilderCallbackArgs) {
36
- const http = await init.requireInstance('http');
29
+ /**
30
+ * Create an HTTP client based on the provided parameters.
31
+ * @param clientId - Identifier for the client.
32
+ * @param init - Configuration builder callback arguments.
33
+ * @returns An instance of the HTTP client.
34
+ */
35
+ private async _createHttpClient(clientId: string, init: ConfigBuilderCallbackArgs) {
36
+ const http = await init.requireInstance('http');
37
37
 
38
- if (http.hasClient(clientId)) {
39
- return http.createClient(clientId);
40
- } else {
41
- /** load service discovery module */
42
- const serviceDiscovery = await init.requireInstance('serviceDiscovery');
43
- return await serviceDiscovery.createClient(clientId);
44
- }
38
+ if (http.hasClient(clientId)) {
39
+ return http.createClient(clientId);
40
+ } else {
41
+ /** load service discovery module */
42
+ const serviceDiscovery = await init.requireInstance('serviceDiscovery');
43
+ return await serviceDiscovery.createClient(clientId);
45
44
  }
45
+ }
46
46
 
47
- /**
48
- * Process the WidgetModule configuration and create an HTTP client if needed.
49
- * @param config - Partial configuration for the WidgetModule.
50
- * @param _init - Configuration builder callback arguments.
51
- * @returns The processed WidgetModule configuration.
52
- */
53
- protected async _processConfig(
54
- config: Partial<WidgetModuleConfig>,
55
- _init: ConfigBuilderCallbackArgs,
56
- ) {
57
- // Create an HTTP client using the specified client ID and initialization parameters
58
- const httpClient = await this._createHttpClient('apps', _init);
47
+ /**
48
+ * Process the WidgetModule configuration and create an HTTP client if needed.
49
+ * @param config - Partial configuration for the WidgetModule.
50
+ * @param _init - Configuration builder callback arguments.
51
+ * @returns The processed WidgetModule configuration.
52
+ */
53
+ protected async _processConfig(
54
+ config: Partial<WidgetModuleConfig>,
55
+ _init: ConfigBuilderCallbackArgs,
56
+ ) {
57
+ // Create an HTTP client using the specified client ID and initialization parameters
58
+ const httpClient = await this._createHttpClient('apps', _init);
59
59
 
60
- // If the configuration does not have a client, use the default client
61
- if (!config.client) {
62
- config.client = createDefaultClient(httpClient);
63
- }
64
- // Return the processed configuration as a WidgetModuleConfig object
65
- return config as WidgetModuleConfig;
60
+ // If the configuration does not have a client, use the default client
61
+ if (!config.client) {
62
+ config.client = createDefaultClient(httpClient);
66
63
  }
64
+ // Return the processed configuration as a WidgetModuleConfig object
65
+ return config as WidgetModuleConfig;
66
+ }
67
67
  }
@@ -1,164 +1,164 @@
1
- import { catchError, Observable, Subscription } from 'rxjs';
1
+ import { catchError, type Observable, Subscription } from 'rxjs';
2
2
 
3
- import { ModuleType } from '@equinor/fusion-framework-module';
3
+ import type { ModuleType } from '@equinor/fusion-framework-module';
4
4
  import { HttpResponseError } from '@equinor/fusion-framework-module-http';
5
- import { EventModule } from '@equinor/fusion-framework-module-event';
5
+ import type { EventModule } from '@equinor/fusion-framework-module-event';
6
6
 
7
7
  import { Query } from '@equinor/fusion-query';
8
8
 
9
9
  import type { GetWidgetParameters, WidgetConfig, WidgetManifest } from './types';
10
10
 
11
- import { WidgetModuleConfig } from './WidgetModuleConfigurator';
11
+ import type { WidgetModuleConfig } from './WidgetModuleConfigurator';
12
12
  import { WidgetManifestLoadError, WidgetConfigLoadError } from './errors';
13
13
  import { Widget } from './Widget';
14
14
 
15
15
  export interface IWidgetModuleProvider {
16
- getWidget(
17
- widgetKey: GetWidgetParameters['widgetKey'],
18
- args?: GetWidgetParameters['args'],
19
- ): Widget;
20
- getWidgetManifest(
21
- widgetKey: GetWidgetParameters['widgetKey'],
22
- args?: GetWidgetParameters['args'],
23
- ): Observable<WidgetManifest>;
24
- getWidgetConfig(
25
- widgetKey: GetWidgetParameters['widgetKey'],
26
- args?: GetWidgetParameters['args'],
27
- ): Observable<WidgetConfig>;
16
+ getWidget(
17
+ widgetKey: GetWidgetParameters['widgetKey'],
18
+ args?: GetWidgetParameters['args'],
19
+ ): Widget;
20
+ getWidgetManifest(
21
+ widgetKey: GetWidgetParameters['widgetKey'],
22
+ args?: GetWidgetParameters['args'],
23
+ ): Observable<WidgetManifest>;
24
+ getWidgetConfig(
25
+ widgetKey: GetWidgetParameters['widgetKey'],
26
+ args?: GetWidgetParameters['args'],
27
+ ): Observable<WidgetConfig>;
28
28
  }
29
29
 
30
30
  /**
31
31
  * The `WidgetModuleProvider` class implements the `IWidgetModuleProvider` interface and serves as a provider for managing widgets.
32
32
  */
33
33
  export class WidgetModuleProvider implements IWidgetModuleProvider {
34
- // Private fields
35
- #subscription = new Subscription();
36
- #config: WidgetModuleConfig;
37
- #event?: ModuleType<EventModule>;
38
-
39
- /**
40
- * Constructs a new `WidgetModuleProvider` instance.
41
- * @param args - An object containing configuration and optional event module for the widget provider.
42
- */
43
- constructor(args: { config: WidgetModuleConfig; event?: ModuleType<EventModule> }) {
44
- const { config, event } = args;
45
- this.#event = event;
46
- this.#config = config;
47
- }
48
-
49
- /**
50
- * Retrieves a widget instance based on the provided name and optional parameters.
51
- * @param name - The name of the widget.
52
- * @param widgetParams - Optional parameters for the widget.
53
- * @returns A new `Widget` instance.
54
- */
55
- public getWidget(name: string, widgetPrams?: GetWidgetParameters['args']): Widget {
56
- return new Widget(
57
- { name },
58
- { provider: this, event: this.#event, widgetPrams, config: this.#config },
59
- );
60
- }
61
-
62
- /**
63
- * Retrieves the manifest of a widget as an observable stream.
64
- * @param name - The name of the widget.
65
- * @param widgetParams - Optional parameters for the widget.
66
- * @returns An observable stream of the widget manifest.
67
- */
68
- public getWidgetManifest(
69
- name: string,
70
- widgetPrams?: GetWidgetParameters['args'],
71
- ): Observable<WidgetManifest> {
72
- return this._getWidget(name, widgetPrams);
73
- }
74
-
75
- /**
76
- * Retrieves the config of a widget as an observable stream.
77
- * @param name - The name of the widget.
78
- * @param widgetParams - Optional parameters for the widget.
79
- * @returns An observable stream of the widget config.
80
- */
81
- public getWidgetConfig(
82
- name: string,
83
- widgetPrams?: GetWidgetParameters['args'],
84
- ): Observable<WidgetConfig> {
85
- return this._getWidgetConfig(name, widgetPrams);
86
- }
87
-
88
- protected _getWidgetConfig(
89
- widgetKey: GetWidgetParameters['widgetKey'],
90
- args?: GetWidgetParameters['args'],
91
- ): Observable<WidgetConfig> {
92
- const client = new Query(this.#config.client.getWidgetConfig);
93
- this.#subscription.add(() => client.complete());
94
- return Query.extractQueryValue(
95
- client.query({ widgetKey, args }).pipe(
96
- catchError((err) => {
97
- // Extract the cause since the error will be a `QueryError`
98
- const { cause } = err;
99
-
100
- // Handle specific errors and throw a `GetWidgetManifestError` if applicable
101
- if (cause instanceof WidgetManifestLoadError) {
102
- throw cause;
103
- }
104
- if (cause instanceof HttpResponseError) {
105
- throw WidgetManifestLoadError.fromHttpResponse(cause.response, {
106
- cause,
107
- });
108
- }
109
- // Throw a generic `GetWidgetManifestError` for unknown errors
110
- throw new WidgetManifestLoadError('unknown', 'failed to load config', {
111
- cause,
112
- });
113
- }),
114
- ),
115
- );
116
- }
117
-
118
- /**
119
- * Fetches the configuration for a widget using a query.
120
- * @param widgetKey - The key identifying the widget.
121
- * @param args - Optional arguments for the widget.
122
- * @returns An observable stream of the widget manifest.
123
- * @protected
124
- */
125
- protected _getWidget(
126
- widgetKey: GetWidgetParameters['widgetKey'],
127
- args?: GetWidgetParameters['args'],
128
- ): Observable<WidgetManifest> {
129
- // Create a new query using the configured client
130
- const client = new Query(this.#config.client.getWidgetManifest);
131
- this.#subscription.add(() => client.complete());
132
-
133
- // Execute the query and handle errors
134
- return Query.extractQueryValue(
135
- client.query({ widgetKey, args }).pipe(
136
- catchError((err) => {
137
- // Extract the cause since the error will be a `QueryError`
138
- const { cause } = err;
139
-
140
- // Handle specific errors and throw a `GetWidgetConfigError` if applicable
141
- if (cause instanceof WidgetConfigLoadError) {
142
- throw cause;
143
- }
144
- if (cause instanceof HttpResponseError) {
145
- throw WidgetConfigLoadError.fromHttpResponse(cause.response, { cause });
146
- }
147
- // Throw a generic `GetWidgetManifestError` for unknown errors
148
- throw new WidgetConfigLoadError('unknown', 'failed to load config', {
149
- cause,
150
- });
151
- }),
152
- ),
153
- );
154
- }
155
-
156
- /**
157
- * Disposes of the widget provider by unsubscribing from any active subscriptions.
158
- */
159
- public dispose() {
160
- this.#subscription.unsubscribe();
161
- }
34
+ // Private fields
35
+ #subscription = new Subscription();
36
+ #config: WidgetModuleConfig;
37
+ #event?: ModuleType<EventModule>;
38
+
39
+ /**
40
+ * Constructs a new `WidgetModuleProvider` instance.
41
+ * @param args - An object containing configuration and optional event module for the widget provider.
42
+ */
43
+ constructor(args: { config: WidgetModuleConfig; event?: ModuleType<EventModule> }) {
44
+ const { config, event } = args;
45
+ this.#event = event;
46
+ this.#config = config;
47
+ }
48
+
49
+ /**
50
+ * Retrieves a widget instance based on the provided name and optional parameters.
51
+ * @param name - The name of the widget.
52
+ * @param widgetParams - Optional parameters for the widget.
53
+ * @returns A new `Widget` instance.
54
+ */
55
+ public getWidget(name: string, widgetPrams?: GetWidgetParameters['args']): Widget {
56
+ return new Widget(
57
+ { name },
58
+ { provider: this, event: this.#event, widgetPrams, config: this.#config },
59
+ );
60
+ }
61
+
62
+ /**
63
+ * Retrieves the manifest of a widget as an observable stream.
64
+ * @param name - The name of the widget.
65
+ * @param widgetParams - Optional parameters for the widget.
66
+ * @returns An observable stream of the widget manifest.
67
+ */
68
+ public getWidgetManifest(
69
+ name: string,
70
+ widgetPrams?: GetWidgetParameters['args'],
71
+ ): Observable<WidgetManifest> {
72
+ return this._getWidget(name, widgetPrams);
73
+ }
74
+
75
+ /**
76
+ * Retrieves the config of a widget as an observable stream.
77
+ * @param name - The name of the widget.
78
+ * @param widgetParams - Optional parameters for the widget.
79
+ * @returns An observable stream of the widget config.
80
+ */
81
+ public getWidgetConfig(
82
+ name: string,
83
+ widgetPrams?: GetWidgetParameters['args'],
84
+ ): Observable<WidgetConfig> {
85
+ return this._getWidgetConfig(name, widgetPrams);
86
+ }
87
+
88
+ protected _getWidgetConfig(
89
+ widgetKey: GetWidgetParameters['widgetKey'],
90
+ args?: GetWidgetParameters['args'],
91
+ ): Observable<WidgetConfig> {
92
+ const client = new Query(this.#config.client.getWidgetConfig);
93
+ this.#subscription.add(() => client.complete());
94
+ return Query.extractQueryValue(
95
+ client.query({ widgetKey, args }).pipe(
96
+ catchError((err) => {
97
+ // Extract the cause since the error will be a `QueryError`
98
+ const { cause } = err;
99
+
100
+ // Handle specific errors and throw a `GetWidgetManifestError` if applicable
101
+ if (cause instanceof WidgetManifestLoadError) {
102
+ throw cause;
103
+ }
104
+ if (cause instanceof HttpResponseError) {
105
+ throw WidgetManifestLoadError.fromHttpResponse(cause.response, {
106
+ cause,
107
+ });
108
+ }
109
+ // Throw a generic `GetWidgetManifestError` for unknown errors
110
+ throw new WidgetManifestLoadError('unknown', 'failed to load config', {
111
+ cause,
112
+ });
113
+ }),
114
+ ),
115
+ );
116
+ }
117
+
118
+ /**
119
+ * Fetches the configuration for a widget using a query.
120
+ * @param widgetKey - The key identifying the widget.
121
+ * @param args - Optional arguments for the widget.
122
+ * @returns An observable stream of the widget manifest.
123
+ * @protected
124
+ */
125
+ protected _getWidget(
126
+ widgetKey: GetWidgetParameters['widgetKey'],
127
+ args?: GetWidgetParameters['args'],
128
+ ): Observable<WidgetManifest> {
129
+ // Create a new query using the configured client
130
+ const client = new Query(this.#config.client.getWidgetManifest);
131
+ this.#subscription.add(() => client.complete());
132
+
133
+ // Execute the query and handle errors
134
+ return Query.extractQueryValue(
135
+ client.query({ widgetKey, args }).pipe(
136
+ catchError((err) => {
137
+ // Extract the cause since the error will be a `QueryError`
138
+ const { cause } = err;
139
+
140
+ // Handle specific errors and throw a `GetWidgetConfigError` if applicable
141
+ if (cause instanceof WidgetConfigLoadError) {
142
+ throw cause;
143
+ }
144
+ if (cause instanceof HttpResponseError) {
145
+ throw WidgetConfigLoadError.fromHttpResponse(cause.response, { cause });
146
+ }
147
+ // Throw a generic `GetWidgetManifestError` for unknown errors
148
+ throw new WidgetConfigLoadError('unknown', 'failed to load config', {
149
+ cause,
150
+ });
151
+ }),
152
+ ),
153
+ );
154
+ }
155
+
156
+ /**
157
+ * Disposes of the widget provider by unsubscribing from any active subscriptions.
158
+ */
159
+ public dispose() {
160
+ this.#subscription.unsubscribe();
161
+ }
162
162
  }
163
163
 
164
164
  export default WidgetModuleProvider;
@@ -1,21 +1,21 @@
1
1
  import type { IModulesConfigurator } from '@equinor/fusion-framework-module';
2
2
 
3
3
  import { module } from './module';
4
- import { WidgetModuleConfigBuilderCallback } from './WidgetModuleConfigurator';
4
+ import type { WidgetModuleConfigBuilderCallback } from './WidgetModuleConfigurator';
5
5
 
6
6
  /**
7
7
  * Method for enabling the widget module
8
8
  * @param configurator - configuration object
9
9
  */
10
10
  export const enableWidgetModule = (
11
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
- configurator: IModulesConfigurator<any, any>,
13
- builder?: WidgetModuleConfigBuilderCallback,
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ configurator: IModulesConfigurator<any, any>,
13
+ builder?: WidgetModuleConfigBuilderCallback,
14
14
  ): void => {
15
- configurator.addConfig({
16
- module,
17
- configure: (widgetConfigurator) => {
18
- builder && builder(widgetConfigurator);
19
- },
20
- });
15
+ configurator.addConfig({
16
+ module,
17
+ configure: (widgetConfigurator) => {
18
+ builder && builder(widgetConfigurator);
19
+ },
20
+ });
21
21
  };
package/src/errors.ts CHANGED
@@ -1,72 +1,68 @@
1
1
  type WidgetErrorType = 'not_found' | 'unauthorized' | 'unknown';
2
2
 
3
3
  export class WidgetManifestLoadError extends Error {
4
- static fromHttpResponse(response: Response, options?: ErrorOptions) {
5
- switch (response.status) {
6
- case 401:
7
- return new WidgetManifestLoadError(
8
- 'unauthorized',
9
- 'failed to load widget manifest, request not authorized',
10
- options,
11
- );
12
- case 404:
13
- return new WidgetManifestLoadError(
14
- 'not_found',
15
- 'widget manifest not found',
16
- options,
17
- );
18
- }
4
+ static fromHttpResponse(response: Response, options?: ErrorOptions) {
5
+ switch (response.status) {
6
+ case 401:
19
7
  return new WidgetManifestLoadError(
20
- 'unknown',
21
- `failed to load widget manifest, status code ${response.status}`,
22
- options,
8
+ 'unauthorized',
9
+ 'failed to load widget manifest, request not authorized',
10
+ options,
23
11
  );
12
+ case 404:
13
+ return new WidgetManifestLoadError('not_found', 'widget manifest not found', options);
24
14
  }
25
- constructor(
26
- public readonly type: WidgetErrorType,
27
- message?: string,
28
- options?: ErrorOptions,
29
- ) {
30
- super(message, options);
31
- this.name = 'GetWidgetLoadManifestErrors';
32
- }
15
+ return new WidgetManifestLoadError(
16
+ 'unknown',
17
+ `failed to load widget manifest, status code ${response.status}`,
18
+ options,
19
+ );
20
+ }
21
+ constructor(
22
+ public readonly type: WidgetErrorType,
23
+ message?: string,
24
+ options?: ErrorOptions,
25
+ ) {
26
+ super(message, options);
27
+ this.name = 'GetWidgetLoadManifestErrors';
28
+ }
33
29
  }
34
30
 
35
31
  export class WidgetConfigLoadError extends Error {
36
- static fromHttpResponse(response: Response, options?: ErrorOptions) {
37
- switch (response.status) {
38
- case 401:
39
- return new WidgetConfigLoadError(
40
- 'unauthorized',
41
- 'failed to load widget config, request not authorized',
42
- options,
43
- );
44
- case 404:
45
- return new WidgetConfigLoadError('not_found', 'widget config not found', options);
46
- }
32
+ static fromHttpResponse(response: Response, options?: ErrorOptions) {
33
+ switch (response.status) {
34
+ case 401:
47
35
  return new WidgetConfigLoadError(
48
- 'unknown',
49
- `failed to load widget config, status code ${response.status}`,
50
- options,
36
+ 'unauthorized',
37
+ 'failed to load widget config, request not authorized',
38
+ options,
51
39
  );
40
+ case 404:
41
+ return new WidgetConfigLoadError('not_found', 'widget config not found', options);
52
42
  }
53
- constructor(
54
- public readonly type: WidgetErrorType,
55
- message?: string,
56
- options?: ErrorOptions,
57
- ) {
58
- super(message, options);
59
- this.name = 'GetWidgetLoadConfigError';
60
- }
43
+ return new WidgetConfigLoadError(
44
+ 'unknown',
45
+ `failed to load widget config, status code ${response.status}`,
46
+ options,
47
+ );
48
+ }
49
+ constructor(
50
+ public readonly type: WidgetErrorType,
51
+ message?: string,
52
+ options?: ErrorOptions,
53
+ ) {
54
+ super(message, options);
55
+ this.name = 'GetWidgetLoadConfigError';
56
+ }
61
57
  }
62
58
 
63
59
  export class WidgetScriptModuleError extends Error {
64
- constructor(
65
- public readonly type: WidgetErrorType,
66
- message?: string,
67
- options?: ErrorOptions,
68
- ) {
69
- super(message, options);
70
- this.name = 'WidgetScriptModuleError';
71
- }
60
+ constructor(
61
+ public readonly type: WidgetErrorType,
62
+ message?: string,
63
+ options?: ErrorOptions,
64
+ ) {
65
+ super(message, options);
66
+ this.name = 'WidgetScriptModuleError';
67
+ }
72
68
  }