@dreamcomposer/engine-types 2.1.1 → 2.2.0

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,11 @@
1
+ import { FromEngineMessage } from "../post-messages";
2
+
3
+ /**
4
+ * Sent as the very first thing when the engine page starts, before any of
5
+ * its scripts are loaded. It only tells the embedder that the engine is
6
+ * reachable; it is still not allowed to send commands until it receives the
7
+ * `engine-ready` message.
8
+ */
9
+ export interface EngineAliveMessage extends FromEngineMessage<"engine-alive"> {
10
+ payload: true;
11
+ }
@@ -0,0 +1,16 @@
1
+ import { FromEngineMessage } from "../post-messages";
2
+
3
+ /**
4
+ * Sent when the engine fails in a way it cannot recover from on its own.
5
+ *
6
+ * `startup` errors happen before `engine-ready` was sent, i.e. the engine will
7
+ * never become ready. `runtime` errors happen afterwards and leave the engine
8
+ * unusable, e.g. a lost WebGL context that is not restored.
9
+ */
10
+ export interface EngineErrorMessage extends FromEngineMessage<"engine-error"> {
11
+ payload: {
12
+ phase: "startup" | "runtime";
13
+ /** A technical description for logs, not meant to be shown to users. */
14
+ message: string;
15
+ };
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamcomposer/engine-types",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "The type definitions for messages from and to the engine",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -1,5 +1,7 @@
1
1
  import { AckMessage } from "./from-engine/AckMessage";
2
2
  import { CanvasImageUrlMessage } from "./from-engine/CanvasImageUrlMessage";
3
+ import { EngineAliveMessage } from "./from-engine/EngineAliveMessage";
4
+ import { EngineErrorMessage } from "./from-engine/EngineErrorMessage";
3
5
  import { EngineReadyMessage } from "./from-engine/EngineReadyMessage";
4
6
  import { KeyDownMessage } from "./from-engine/KeyDownMessage";
5
7
  import { SetLoadingProgressMessage } from "./from-engine/SetLoadingProgressMessage";
@@ -82,6 +84,8 @@ export type FromEnginePostMessage =
82
84
  | AckMessage
83
85
  | CanvasImageUrlMessage
84
86
  | DisplayLoadingUiMessage
87
+ | EngineAliveMessage
88
+ | EngineErrorMessage
85
89
  | EngineReadyMessage
86
90
  | HideGuiMessage
87
91
  | HideLoadingUiMessage