graphwise-reactodia 0.0.1-TR18 → 0.0.1-TR19

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.
@@ -6,7 +6,8 @@ import { ErrorReport } from '../error/error-report';
6
6
  export declare const GRAPHWISE_REACTODIA_EVENT = "graphwiseReactodiaEvent";
7
7
  /**
8
8
  * The payload of each {@link EventType}. It is the single place that ties an event type to its payload, so
9
- * adding an event is one {@link EventType} value and one entry here.
9
+ * adding an event is one {@link EventType} value and one entry here. An event without a payload maps to `void`
10
+ * and is emitted without `payload`.
10
11
  *
11
12
  * @example
12
13
  * ```ts
@@ -14,11 +15,14 @@ export declare const GRAPHWISE_REACTODIA_EVENT = "graphwiseReactodiaEvent";
14
15
  * [EventType.ERROR]: ErrorReport;
15
16
  * // A new event:
16
17
  * [EventType.NEW_TYPE]: NewTypePayload;
18
+ * // A new event without a payload:
19
+ * [EventType.NEW_SIGNAL]: void;
17
20
  * }
18
21
  * ```
19
22
  */
20
23
  interface EventPayloadMap {
21
24
  [EventType.ERROR]: ErrorReport;
25
+ [EventType.TEXT_SEARCH]: void;
22
26
  }
23
27
  /**
24
28
  * Maps an {@link EventType} to its event detail: `{type, payload}`, with the payload from
@@ -40,7 +44,10 @@ interface EventPayloadMap {
40
44
  * ```
41
45
  */
42
46
  export type EventDetail<T extends EventType = EventType> = {
43
- [K in T]: {
47
+ [K in T]: EventPayloadMap[K] extends void ? {
48
+ type: K;
49
+ payload?: undefined;
50
+ } : {
44
51
  type: K;
45
52
  payload: EventPayloadMap[K];
46
53
  };
@@ -2,5 +2,6 @@
2
2
  * The kind of event the wrapper announces to the host. It selects the payload of an {@link EventDetail}.
3
3
  */
4
4
  export declare enum EventType {
5
- ERROR = "error"
5
+ ERROR = "error",
6
+ TEXT_SEARCH = "text-search"
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphwise-reactodia",
3
- "version": "0.0.1-TR18",
3
+ "version": "0.0.1-TR19",
4
4
  "description": "Graphwise wrapper around the Reactodia graph explorer.",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "author": "Ontotext AD",
@@ -1 +0,0 @@
1
- const a="graphwise-reactodia:clear-diagram-storage";var r,i;!function(a){a.ERROR="error"}(r||(r={})),function(a){a.MISSING_REQUIRED_PROP="missing-required-prop",a.DATA_FETCH="data-fetch",a.DIAGRAM_LOAD="diagram-load",a.DIAGRAM_IMPORT="diagram-import",a.LOCAL_DIAGRAM_READ="local-diagram-read",a.LOCAL_DIAGRAM_SAVE="local-diagram-save"}(i||(i={}));export{a as C,r as E,i as a}