@elliemae/microfe-common 2.0.0-next.37 → 2.0.0-next.38

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.
@@ -1,4 +1,4 @@
1
- import { RemotingScriptingObject, Listener } from '@elliemae/pui-scripting-object';
1
+ import { RemotingScriptingObject } from '@elliemae/pui-scripting-object';
2
2
  /**
3
3
  * Interface for scripting object proxy
4
4
  */
@@ -29,6 +29,15 @@ export interface IScriptingObject extends IScriptingObjectProxy {
29
29
  */
30
30
  _dispose(): void;
31
31
  }
32
+ /**
33
+ * callback for event
34
+ */
35
+ export type Listener<SO extends IScriptingObjectProxy, Params extends Record<string, unknown>, Options extends Record<string, unknown>, ReturnType> = ({ obj, eventName, eventParams, eventOptions, }: {
36
+ obj: SO;
37
+ eventName: string;
38
+ eventParams: Params;
39
+ eventOptions?: Options;
40
+ }) => ReturnType;
32
41
  /**
33
42
  * list of event listeners
34
43
  */
@@ -1,5 +1,5 @@
1
- import { IScriptingObject, Listener, Events } from '@elliemae/pui-scripting-object';
2
- import { EventListeners } from './common.js';
1
+ import { IScriptingObject, Events } from '@elliemae/pui-scripting-object';
2
+ import { EventListeners, Listener } from './common.js';
3
3
  /**
4
4
  * details of an event listener
5
5
  */
@@ -16,7 +16,7 @@ type EventListenerDetails = {
16
16
  /**
17
17
  * parameters for subscribing to an event
18
18
  */
19
- export type SubscribeParam<EventId, EventListener> = {
19
+ export type SubscribeParam<EventId, EventListener extends Listener<any, any, any, any>> = {
20
20
  /**
21
21
  * unique id of the event
22
22
  */
@@ -1,6 +1,6 @@
1
1
  import { LogLevels } from '@elliemae/pui-diagnostics';
2
2
  import type { IScriptingObjectProxy } from '@elliemae/pui-scripting-object';
3
- import { EventListeners } from './common.js';
3
+ import { EventListeners, Listener } from './common.js';
4
4
  /**
5
5
  * parameters for connecting to the host
6
6
  */
@@ -13,7 +13,7 @@ export type ConnectParam = {
13
13
  /**
14
14
  * parameters for subscribing to an event
15
15
  */
16
- export type SubscribeParam<EventId, EventListener> = {
16
+ export type SubscribeParam<EventId, EventListener extends Listener<any, any, any, any>> = {
17
17
  /**
18
18
  * unique id of the event
19
19
  */
@@ -8,5 +8,5 @@ export type { IScriptingObjectProxyEvent, EventParam } from './event.js';
8
8
  export { Event } from './event.js';
9
9
  export { ScriptingObject } from './scriptingObject.js';
10
10
  export { MessageType } from './messageType.js';
11
- export type { EventListeners } from './common.js';
11
+ export type { EventListeners, Listener } from './common.js';
12
12
  export type { ISSFGuest, ConnectParam, SubscribeParam as GuestSubscribeParam, UnsubscribeParam as GuestUnsubscribeParam, } from './guest.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/microfe-common",
3
- "version": "2.0.0-next.37",
3
+ "version": "2.0.0-next.38",
4
4
  "description": "common micro frontend functional modules",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.6.0",
41
41
  "@elliemae/pui-diagnostics": "~3.1.0",
42
- "@elliemae/pui-scripting-object": "~1.19.0",
42
+ "@elliemae/pui-scripting-object": "~1.19.1",
43
43
  "@types/uuid": "~9.0.1"
44
44
  },
45
45
  "scripts": {