@dreamcomposer/engine-types 0.0.75 → 0.0.77

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.
@@ -114,3 +114,11 @@ export type TextureOverride<T> = Record<
114
114
  >;
115
115
 
116
116
  type Texture = unknown;
117
+
118
+ export function isTextureBlob(obj: unknown): obj is TextureBlob {
119
+ return typeof obj === "object" && obj !== null && "blob" in obj;
120
+ }
121
+
122
+ export function isTextureUrl(obj: unknown): obj is TextureUrl {
123
+ return typeof obj === "object" && obj !== null && "url" in obj;
124
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamcomposer/engine-types",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
4
4
  "description": "The type definitions for messages from and to the engine",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -48,6 +48,7 @@ import { SetInitialGeometryTransformMessage } from "./to-engine/SetInitialGeomet
48
48
  import { ResetGeometryTransformMessage } from "./to-engine/ResetGeometryTransformMessage";
49
49
  import { PlaceGeometryOnGroundMessage } from "./to-engine/MoveGeometryToGroundMessage";
50
50
  import { MouseEventMessage } from "./to-engine/MouseEventMessage";
51
+ import { SetBackgroundImageMessage } from "./to-engine/SetBackgroundImageMessage";
51
52
 
52
53
  /**
53
54
  * A message sent from the engine to the embedder.
@@ -95,6 +96,7 @@ export type ToEnginePostMessage =
95
96
  | UpdateCameraPositionMessage
96
97
  | SelectedEdgesMessage
97
98
  | SetClearColorMessage
99
+ | SetBackgroundImageMessage
98
100
  | SetConnectionInfosMessage
99
101
  | SetCutoutTextureMessage
100
102
  | SetEdgeSelectorEnabledMessage
@@ -0,0 +1,15 @@
1
+ import { TextureBlob, TextureUrl } from "../Layer";
2
+ import { ToEngineMessage } from "../post-messages";
3
+
4
+ /**
5
+ * A message to set the scene's background image.
6
+ */
7
+ export interface SetBackgroundImageMessage
8
+ extends ToEngineMessage<"set-background-image"> {
9
+ payload: {
10
+ texture: string | TextureUrl | Blob | TextureBlob | null;
11
+ options?: {
12
+ scalingMode?: "stretch" | "fill" | "fit";
13
+ };
14
+ };
15
+ }