@dreamcomposer/engine-types 0.0.71 → 0.0.72

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,21 @@
1
+ import { FromEngineMessage } from "../post-messages";
2
+
3
+ /**
4
+ * Sent as a response for every message to the engine,
5
+ */
6
+ export interface AckMessage extends FromEngineMessage<"ack"> {
7
+ payload: {
8
+ /**
9
+ * The nonce that was sent with the message to the engine.
10
+ *
11
+ * Used to identify to what message the ack belongs.
12
+ */
13
+ nonce: string;
14
+ /**
15
+ * An error if the message to the engine could not be processed by the engine.
16
+ */
17
+ error?: {
18
+ message?: string;
19
+ };
20
+ };
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamcomposer/engine-types",
3
- "version": "0.0.71",
3
+ "version": "0.0.72",
4
4
  "description": "The type definitions for messages from and to the engine",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -1,3 +1,4 @@
1
+ import { AckMessage } from "./from-engine/AckMessage";
1
2
  import { CanvasImageUrlMessage } from "./from-engine/CanvasImageUrlMessage";
2
3
  import { EngineReadyMessage } from "./from-engine/EngineReadyMessage";
3
4
  import { KeyDownMessage } from "./from-engine/KeyDownMessage";
@@ -61,10 +62,16 @@ export interface FromEngineMessage<Channel> {
61
62
  */
62
63
  export interface ToEngineMessage<Channel> {
63
64
  channel: Channel;
65
+ /**
66
+ * The nonce is a randomly generated string that is re-send by the engine in
67
+ * the ack message.
68
+ */
69
+ nonce: string;
64
70
  payload?: unknown;
65
71
  }
66
72
 
67
73
  export type FromEnginePostMessage =
74
+ | AckMessage
68
75
  | CanvasImageUrlMessage
69
76
  | DisplayLoadingUiMessage
70
77
  | EngineReadyMessage
package/EngineState.d.ts DELETED
@@ -1,4 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
2
- export interface EngineState {
3
- // TODO Add content
4
- }