@sitevision/api 1.0.11 → 1.0.12

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.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Listen to a given event
3
+ *
4
+ * @param eventName The name of the event
5
+ * @param callback The callback to trigger for the given event
6
+ */
7
+ export function on(eventName: string, callback: (options: any) => void): void;
8
+ /**
9
+ * Emit a server side event
10
+ *
11
+ * Note! Server side only
12
+ *
13
+ * @param eventName The name of the event to emit
14
+ * @param options The options for the event
15
+ */
16
+ export function emit(eventName: string, options: any): void;
17
+ /**
18
+ * Trigger a client side event
19
+ *
20
+ * Note! Client side only
21
+ *
22
+ * @param eventName The name of the event to trigger
23
+ * @param options The options for the event
24
+ */
25
+ export function trigger(eventName: string, options: any): void;
26
+
27
+ declare namespace events {
28
+ export { on, emit, trigger };
29
+ }
30
+
31
+ export default events;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _default = {
8
8
  on: function on() {},
9
- emit: function emit() {}
9
+ emit: function emit() {},
10
+ trigger: function trigger() {}
10
11
  };
11
12
  exports["default"] = _default;
package/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import './client/toasts';
4
4
  import './common/app';
5
5
  import './common/i18n';
6
6
  import './common/router';
7
+ import './common/events';
7
8
 
8
9
  import './server/appData';
9
10
  import './server/appResource';
@@ -17,7 +18,6 @@ import './server/CollaborationGroupType';
17
18
  import './server/CollaborationGroupUtil';
18
19
  import './server/CollaborationGroupWrapper';
19
20
  import './server/DateUtil';
20
- import './server/events';
21
21
  import './server/globalAppData';
22
22
  import './server/hooks';
23
23
  import './server/LandingPageUtil';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitevision/api",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "author": "Sitevision AB",
5
5
  "license": "MIT",
6
6
  "types": "index.d.ts",
@@ -26,5 +26,5 @@
26
26
  "access": "public",
27
27
  "directory": "dist"
28
28
  },
29
- "gitHead": "cc9cb637f880cbc0def7dccfaa295bc43f2a3e5e"
29
+ "gitHead": "d514eb8b9219d901e11cbda190e5812a5522fbdc"
30
30
  }
@@ -1,8 +0,0 @@
1
- export function on(eventName: string, callback: (options: any) => void): void;
2
- export function emit(eventName: string, options: any): void;
3
-
4
- declare namespace events {
5
- export { on, emit };
6
- }
7
-
8
- export default events;