@dreamcomposer/engine-types 0.0.7 → 0.0.8

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.
package/Layer.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { MaterialDefinition } from "./Material";
2
+
1
3
  /**
2
4
  * A 2D layer.
3
5
  */
@@ -11,9 +13,9 @@ export interface Layer {
11
13
  // TODO: The order should be dynamically set by the engine
12
14
  order: number;
13
15
  /**
14
- * The name of the material of the layer (e.g., "print_diffuse").
16
+ * The name of the material of the layer (e.g., "print_diffuse") or a complete material definition
15
17
  */
16
- material: string;
18
+ material: string | MaterialDefinition;
17
19
  /**
18
20
  * Whether or not the layer is visible.
19
21
  *
package/Material.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export interface MaterialDefinition {
2
+ materialBase: string;
3
+ materialPBRShaderInjections?: string[];
4
+ materialExtensions: string[];
5
+ materialOverrides: Record<string, unknown> | Record<string, unknown>[];
6
+ }
7
+
8
+ export interface MaterialExtension {
9
+ metadata: {
10
+ name: string;
11
+ description: string;
12
+ };
13
+ materialsOverrides: Record<string, unknown> | Record<string, unknown>[];
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamcomposer/engine-types",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "The type definitions for messages from and to the engine",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -34,6 +34,7 @@ import { SetGeometryUrlMessage } from "./to-engine/SetGeometryUrlMessage";
34
34
  import { ToggleVrMessage } from "./to-engine/ToggleVrMessage";
35
35
  import { PointerEventMessage } from "./from-engine/PointerEventMessage";
36
36
  import { HideGuiMessage } from "./from-engine/HideGuiMessage";
37
+ import { SetUseFramingAnimation } from "./to-engine/SetUseFramingAnimation";
37
38
 
38
39
  /**
39
40
  * A message sent from the engine to the embedder.
@@ -91,6 +92,7 @@ export type ToEnginePostMessage =
91
92
  | SetStageMappingsMessage
92
93
  | SetStageRotationsMessage
93
94
  | SetSurfaceMaterialIdMessage
95
+ | SetUseFramingAnimation
94
96
  | ToggleFullscreenMessage
95
97
  | ToggleInspectorMessage
96
98
  | ToggleVrMessage
@@ -0,0 +1,12 @@
1
+ import { ToEngineMessage } from "../post-messages";
2
+
3
+ /**
4
+ * Enable/disable framing animations
5
+ */
6
+ export interface SetUseFramingAnimation
7
+ extends ToEngineMessage<"set-use-framing-animation"> {
8
+ /**
9
+ * A boolean, setting current engine mode for framing animations
10
+ */
11
+ payload: boolean;
12
+ }