@ignifx/editor-host 0.14.0 → 0.16.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,77 @@
1
+ import { EDITOR_ONLY_METADATA_KEY } from "@ignifx/core";
2
+ import { addToScene, createLineSystem, disposeMeshGpu, removeFromScene } from "@babylonjs/lite";
3
+ //#region src/lite/editor-lines.ts
4
+ /**
5
+ * The editor's own lines over the scene view (`setEditorLines`): collider outlines, 2D collider
6
+ * handles. Each set is one Lite line system in core's render overlay, so it draws over the frame in
7
+ * both view modes. Every Lite claim here was read from the pinned `@babylonjs/lite` 1.34
8
+ * `index.d.ts` (`createLineSystem`, `LineSystemOptions`).
9
+ *
10
+ * The host loads this module with `import()` once a scene view has a canvas, so it stays out of the
11
+ * host's first chunk (`CONSTITUTION.md` §2.5).
12
+ */
13
+ /**
14
+ * Builds the line sets of one scene view, in the render overlay.
15
+ *
16
+ * @remarks
17
+ * No mesh is pickable or belongs to an entity, so no pick, selection or `readBack` reaches it, and
18
+ * each carries core's `EDITOR_ONLY_METADATA_KEY`, so no render texture (the game view) draws it.
19
+ *
20
+ * @param handles - The app's Lite engine (`app.lite`).
21
+ * @param overlay - The view's open render overlay; the lines do not own it.
22
+ * @returns The line sets, empty.
23
+ */
24
+ function createEditorLines(handles, overlay) {
25
+ const { engine } = handles;
26
+ const scene = overlay.lite.scene;
27
+ const meshes = /* @__PURE__ */ new Map();
28
+ const remove = (id) => {
29
+ const mesh = meshes.get(id);
30
+ if (mesh !== void 0) {
31
+ removeFromScene(scene, mesh);
32
+ disposeMeshGpu(mesh);
33
+ meshes.delete(id);
34
+ }
35
+ };
36
+ const clear = (id) => {
37
+ for (const key of id === null ? [...meshes.keys()] : [id]) remove(key);
38
+ };
39
+ return {
40
+ set(id, lines, color) {
41
+ remove(id);
42
+ const segments = [];
43
+ for (let at = 0; at + 5 < lines.length; at += 6) segments.push([{
44
+ x: lines[at] ?? 0,
45
+ y: lines[at + 1] ?? 0,
46
+ z: lines[at + 2] ?? 0
47
+ }, {
48
+ x: lines[at + 3] ?? 0,
49
+ y: lines[at + 4] ?? 0,
50
+ z: lines[at + 5] ?? 0
51
+ }]);
52
+ if (segments.length === 0) return;
53
+ const mesh = createLineSystem(engine, {
54
+ name: `ignifx-editor-lines:${id}`,
55
+ lines: segments,
56
+ color,
57
+ useVertexAlpha: color.a < 1
58
+ });
59
+ mesh.pickable = false;
60
+ mesh.receiveShadows = false;
61
+ mesh.metadata = {
62
+ ...mesh.metadata,
63
+ [EDITOR_ONLY_METADATA_KEY]: true
64
+ };
65
+ addToScene(scene, mesh);
66
+ meshes.set(id, mesh);
67
+ },
68
+ clear,
69
+ dispose() {
70
+ clear(null);
71
+ }
72
+ };
73
+ }
74
+ //#endregion
75
+ export { createEditorLines };
76
+
77
+ //# sourceMappingURL=editor-lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-lines.js","names":[],"sources":["../src/lite/editor-lines.ts"],"sourcesContent":["/**\n * The editor's own lines over the scene view (`setEditorLines`): collider outlines, 2D collider\n * handles. Each set is one Lite line system in core's render overlay, so it draws over the frame in\n * both view modes. Every Lite claim here was read from the pinned `@babylonjs/lite` 1.34\n * `index.d.ts` (`createLineSystem`, `LineSystemOptions`).\n *\n * The host loads this module with `import()` once a scene view has a canvas, so it stays out of the\n * host's first chunk (`CONSTITUTION.md` §2.5).\n */\n\nimport { addToScene, createLineSystem, disposeMeshGpu, removeFromScene } from \"@babylonjs/lite\";\nimport { EDITOR_ONLY_METADATA_KEY } from \"@ignifx/core\";\nimport type { Mesh, SceneContext, Vec3 } from \"@babylonjs/lite\";\nimport type { AppLiteHandles, RenderOverlay } from \"@ignifx/core\";\n\n/** A colour, each channel `0..1`. */\nexport interface LineColor {\n /** Red. */\n readonly r: number;\n /** Green. */\n readonly g: number;\n /** Blue. */\n readonly b: number;\n /** Opacity. */\n readonly a: number;\n}\n\n/** The editor's line sets of one scene view. */\nexport interface EditorLinesView {\n /**\n * Draws a set, replacing the one of the same id.\n *\n * @param id - The set's id.\n * @param lines - Six numbers a segment: the `x, y, z` of both ends, in world metres.\n * @param color - The set's colour.\n */\n set(id: string, lines: readonly number[], color: LineColor): void;\n /**\n * Removes a set, or every set.\n *\n * @param id - The set's id, or `null` for all.\n */\n clear(id: string | null): void;\n /** Removes every set's mesh and releases its GPU resources. */\n dispose(): void;\n}\n\n/**\n * Builds the line sets of one scene view, in the render overlay.\n *\n * @remarks\n * No mesh is pickable or belongs to an entity, so no pick, selection or `readBack` reaches it, and\n * each carries core's `EDITOR_ONLY_METADATA_KEY`, so no render texture (the game view) draws it.\n *\n * @param handles - The app's Lite engine (`app.lite`).\n * @param overlay - The view's open render overlay; the lines do not own it.\n * @returns The line sets, empty.\n */\nexport function createEditorLines(handles: AppLiteHandles, overlay: RenderOverlay): EditorLinesView {\n const { engine } = handles;\n const scene: SceneContext = overlay.lite.scene;\n const meshes = new Map<string, Mesh>();\n\n const remove = (id: string): void => {\n const mesh = meshes.get(id);\n if (mesh !== undefined) {\n removeFromScene(scene, mesh);\n disposeMeshGpu(mesh);\n meshes.delete(id);\n }\n };\n\n const clear = (id: string | null): void => {\n for (const key of id === null ? [...meshes.keys()] : [id]) {\n remove(key);\n }\n };\n\n return {\n set(id: string, lines: readonly number[], color: LineColor): void {\n remove(id);\n const segments: (readonly Vec3[])[] = [];\n for (let at = 0; at + 5 < lines.length; at += 6) {\n segments.push([\n { x: lines[at] ?? 0, y: lines[at + 1] ?? 0, z: lines[at + 2] ?? 0 },\n { x: lines[at + 3] ?? 0, y: lines[at + 4] ?? 0, z: lines[at + 5] ?? 0 },\n ]);\n }\n if (segments.length === 0) {\n return;\n }\n const mesh = createLineSystem(engine, {\n name: `ignifx-editor-lines:${id}`,\n lines: segments,\n color,\n useVertexAlpha: color.a < 1,\n });\n mesh.pickable = false;\n mesh.receiveShadows = false;\n // Drawn in the scene view only, never in a render texture such as the Game panel's view.\n mesh.metadata = { ...mesh.metadata, [EDITOR_ONLY_METADATA_KEY]: true };\n addToScene(scene, mesh);\n meshes.set(id, mesh);\n },\n clear,\n dispose(): void {\n clear(null);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0DA,SAAgB,kBAAkB,SAAyB,SAAyC;CAClG,MAAM,EAAE,WAAW;CACnB,MAAM,QAAsB,QAAQ,KAAK;CACzC,MAAM,yBAAS,IAAI,IAAkB;CAErC,MAAM,UAAU,OAAqB;EACnC,MAAM,OAAO,OAAO,IAAI,EAAE;EAC1B,IAAI,SAAS,KAAA,GAAW;GACtB,gBAAgB,OAAO,IAAI;GAC3B,eAAe,IAAI;GACnB,OAAO,OAAO,EAAE;EAClB;CACF;CAEA,MAAM,SAAS,OAA4B;EACzC,KAAK,MAAM,OAAO,OAAO,OAAO,CAAC,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,GACtD,OAAO,GAAG;CAEd;CAEA,OAAO;EACL,IAAI,IAAY,OAA0B,OAAwB;GAChE,OAAO,EAAE;GACT,MAAM,WAAgC,CAAC;GACvC,KAAK,IAAI,KAAK,GAAG,KAAK,IAAI,MAAM,QAAQ,MAAM,GAC5C,SAAS,KAAK,CACZ;IAAE,GAAG,MAAM,OAAO;IAAG,GAAG,MAAM,KAAK,MAAM;IAAG,GAAG,MAAM,KAAK,MAAM;GAAE,GAClE;IAAE,GAAG,MAAM,KAAK,MAAM;IAAG,GAAG,MAAM,KAAK,MAAM;IAAG,GAAG,MAAM,KAAK,MAAM;GAAE,CACxE,CAAC;GAEH,IAAI,SAAS,WAAW,GACtB;GAEF,MAAM,OAAO,iBAAiB,QAAQ;IACpC,MAAM,uBAAuB;IAC7B,OAAO;IACP;IACA,gBAAgB,MAAM,IAAI;GAC5B,CAAC;GACD,KAAK,WAAW;GAChB,KAAK,iBAAiB;GAEtB,KAAK,WAAW;IAAE,GAAG,KAAK;KAAW,2BAA2B;GAAK;GACrE,WAAW,OAAO,IAAI;GACtB,OAAO,IAAI,IAAI,IAAI;EACrB;EACA;EACA,UAAgB;GACd,MAAM,IAAI;EACZ;CACF;AACF"}
package/dist/grid.js ADDED
@@ -0,0 +1,170 @@
1
+ import { EDITOR_ONLY_METADATA_KEY } from "@ignifx/core";
2
+ import { addToScene, createGridMaterial, createGround, createPlane, createTexture2DFromPixels, disposeMeshGpu, releaseTexture, removeFromScene, setShaderUniform } from "@babylonjs/lite";
3
+ //#region src/lite/grid.ts
4
+ /**
5
+ * The scene view's grid (engine ask E31), drawn with Babylon Lite's `createGridMaterial`. Every Lite
6
+ * claim here was read from the pinned `@babylonjs/lite` 1.34 `index.d.ts` and
7
+ * `lib/material/grid/grid-material.js`.
8
+ *
9
+ * The host loads this module with `import()` once a scene view has a canvas, so the grid's shader
10
+ * code stays out of the host's first chunk (`CONSTITUTION.md` §2.5).
11
+ */
12
+ /** The name of the 3D grid's mesh in the render scene. */
13
+ const GRID_MESH_NAME = "ignifx-editor-grid";
14
+ /** The name of the 2D grid's mesh in the render overlay. */
15
+ const SCREEN_GRID_MESH_NAME = "ignifx-editor-grid-2d";
16
+ /** How visible the minor lines are next to the major ones, `0..1`. */
17
+ const MINOR_VISIBILITY = .4;
18
+ /** The 3D grid's line opacity; below 1, Lite's grid material leaves the space between lines clear. */
19
+ const GROUND_OPACITY = .8;
20
+ /** The 2D grid's line opacity: it draws over the sprites, so it stays faint. */
21
+ const SCREEN_OPACITY = .35;
22
+ /** The fade texture's side, in texels. */
23
+ const FADE_SIZE = 64;
24
+ /** The fade starts this far from the centre, as a fraction of the side. */
25
+ const FADE_START = .12;
26
+ /**
27
+ * Builds the grid of one scene view: a ground plane in the render scene, depth-tested against the
28
+ * document's meshes, and a screen plane in the render overlay, over the 2D view's sprites.
29
+ *
30
+ * @remarks
31
+ * Lite's grid material works in object space, so each plane is a unit square scaled to the
32
+ * placement's extent, with `gridRatio = step / extent` and `gridOffset = centre / extent`: the lines
33
+ * stay on world multiples of the step wherever the square moves. Neither mesh is pickable, casts
34
+ * shadows or belongs to an entity, so no pick, selection or `readBack` reaches it, and both carry
35
+ * core's `EDITOR_ONLY_METADATA_KEY`, so no render texture (the game view) draws them.
36
+ *
37
+ * @param handles - The app's Lite engine and render scene (`app.lite`).
38
+ * @param overlay - The view's open render overlay; the grid does not own it.
39
+ * @returns The grid, hidden until the first {@link EditorGridView.place}.
40
+ */
41
+ function createEditorGrid(handles, overlay) {
42
+ const { engine } = handles;
43
+ const fade = createTexture2DFromPixels(engine, radialFade(), FADE_SIZE, FADE_SIZE, {
44
+ minFilter: "linear",
45
+ magFilter: "linear"
46
+ });
47
+ const ground = makePlane(createGround(engine, {
48
+ width: 1,
49
+ height: 1,
50
+ subdivisions: 1
51
+ }), GRID_MESH_NAME, createGridMaterial({
52
+ name: GRID_MESH_NAME,
53
+ lineColor: [
54
+ .6,
55
+ .6,
56
+ .6
57
+ ],
58
+ minorUnitVisibility: MINOR_VISIBILITY,
59
+ opacity: GROUND_OPACITY,
60
+ opacityTexture: fade,
61
+ backFaceCulling: false
62
+ }), handles.scene, GROUND_OPACITY);
63
+ const screen = makePlane(createPlane(engine, { size: 1 }), SCREEN_GRID_MESH_NAME, createGridMaterial({
64
+ name: SCREEN_GRID_MESH_NAME,
65
+ lineColor: [
66
+ .75,
67
+ .75,
68
+ .75
69
+ ],
70
+ minorUnitVisibility: MINOR_VISIBILITY,
71
+ opacity: SCREEN_OPACITY,
72
+ backFaceCulling: false
73
+ }), overlay.lite.scene, SCREEN_OPACITY);
74
+ let isDisposed = false;
75
+ return {
76
+ place(placement) {
77
+ if (isDisposed) return;
78
+ ground.mesh.visible = placement?.plane === "ground";
79
+ screen.mesh.visible = placement?.plane === "screen";
80
+ if (placement === null) return;
81
+ const { centerX, centerY, extent } = placement;
82
+ const target = placement.plane === "ground" ? ground : screen;
83
+ if (placement.plane === "ground") {
84
+ target.mesh.position.set(centerX, 0, centerY);
85
+ target.mesh.scaling.set(extent, 1, extent);
86
+ setShaderUniform(target.material, "gridOffset", [
87
+ centerX / extent,
88
+ 0,
89
+ centerY / extent
90
+ ]);
91
+ } else {
92
+ target.mesh.position.set(centerX, centerY, 0);
93
+ target.mesh.scaling.set(extent, extent, 1);
94
+ setShaderUniform(target.material, "gridOffset", [
95
+ centerX / extent,
96
+ centerY / extent,
97
+ 0
98
+ ]);
99
+ }
100
+ setShaderUniform(target.material, "gridControl", [
101
+ placement.step / extent,
102
+ placement.majorEvery,
103
+ MINOR_VISIBILITY,
104
+ target.opacity
105
+ ]);
106
+ },
107
+ dispose() {
108
+ if (isDisposed) return;
109
+ isDisposed = true;
110
+ for (const plane of [ground, screen]) {
111
+ removeFromScene(plane.scene, plane.mesh);
112
+ disposeMeshGpu(plane.mesh);
113
+ }
114
+ releaseTexture(fade);
115
+ }
116
+ };
117
+ }
118
+ /**
119
+ * Names a grid mesh, gives it its material, keeps it out of picks and shadows, and adds it hidden.
120
+ *
121
+ * @param mesh - The unit square.
122
+ * @param name - The mesh's name.
123
+ * @param material - Its grid material.
124
+ * @param scene - The scene that draws it.
125
+ * @param opacity - The material's line opacity, written back with every placement.
126
+ * @returns The plane.
127
+ */
128
+ function makePlane(mesh, name, material, scene, opacity) {
129
+ mesh.name = name;
130
+ mesh.material = material;
131
+ mesh.pickable = false;
132
+ mesh.receiveShadows = false;
133
+ mesh.visible = false;
134
+ mesh.metadata = {
135
+ ...mesh.metadata,
136
+ [EDITOR_ONLY_METADATA_KEY]: true
137
+ };
138
+ addToScene(scene, mesh);
139
+ return {
140
+ mesh,
141
+ material,
142
+ scene,
143
+ opacity
144
+ };
145
+ }
146
+ /**
147
+ * A square of white texels whose alpha is 1 near the centre and falls smoothly to 0 before the
148
+ * edge, for the grid material's `opacityTexture`.
149
+ *
150
+ * @returns `FADE_SIZE²` RGBA texels.
151
+ */
152
+ function radialFade() {
153
+ const data = /* @__PURE__ */ new Uint8Array(16384);
154
+ for (let row = 0; row < FADE_SIZE; row += 1) for (let col = 0; col < FADE_SIZE; col += 1) {
155
+ const u = (col + .5) / FADE_SIZE - .5;
156
+ const v = (row + .5) / FADE_SIZE - .5;
157
+ const t = Math.min(1, Math.max(0, (Math.hypot(u, v) - FADE_START) / .36));
158
+ const alpha = 1 - t * t * (3 - 2 * t);
159
+ const index = (row * FADE_SIZE + col) * 4;
160
+ data[index] = 255;
161
+ data[index + 1] = 255;
162
+ data[index + 2] = 255;
163
+ data[index + 3] = Math.round(alpha * 255);
164
+ }
165
+ return data;
166
+ }
167
+ //#endregion
168
+ export { createEditorGrid };
169
+
170
+ //# sourceMappingURL=grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.js","names":[],"sources":["../src/lite/grid.ts"],"sourcesContent":["/**\n * The scene view's grid (engine ask E31), drawn with Babylon Lite's `createGridMaterial`. Every Lite\n * claim here was read from the pinned `@babylonjs/lite` 1.34 `index.d.ts` and\n * `lib/material/grid/grid-material.js`.\n *\n * The host loads this module with `import()` once a scene view has a canvas, so the grid's shader\n * code stays out of the host's first chunk (`CONSTITUTION.md` §2.5).\n */\n\nimport {\n addToScene,\n createGridMaterial,\n createGround,\n createPlane,\n createTexture2DFromPixels,\n disposeMeshGpu,\n releaseTexture,\n removeFromScene,\n setShaderUniform,\n} from \"@babylonjs/lite\";\nimport { EDITOR_ONLY_METADATA_KEY } from \"@ignifx/core\";\nimport type { GridPlacement } from \"../scene/grid.js\";\nimport type { Mesh, SceneContext, ShaderMaterial } from \"@babylonjs/lite\";\nimport type { AppLiteHandles, RenderOverlay } from \"@ignifx/core\";\n\n/** The name of the 3D grid's mesh in the render scene. */\nexport const GRID_MESH_NAME = \"ignifx-editor-grid\";\n\n/** The name of the 2D grid's mesh in the render overlay. */\nexport const SCREEN_GRID_MESH_NAME = \"ignifx-editor-grid-2d\";\n\n/** How visible the minor lines are next to the major ones, `0..1`. */\nconst MINOR_VISIBILITY = 0.4;\n\n/** The 3D grid's line opacity; below 1, Lite's grid material leaves the space between lines clear. */\nconst GROUND_OPACITY = 0.8;\n\n/** The 2D grid's line opacity: it draws over the sprites, so it stays faint. */\nconst SCREEN_OPACITY = 0.35;\n\n/** The fade texture's side, in texels. */\nconst FADE_SIZE = 64;\n\n/** The fade starts this far from the centre, as a fraction of the side. */\nconst FADE_START = 0.12;\n\n/** The fade ends this far from the centre: the grid is gone before the square's edge. */\nconst FADE_END = 0.48;\n\n/** The grid of one scene view. */\nexport interface EditorGridView {\n /**\n * Draws the grid where a placement says, or hides it.\n *\n * @param placement - This frame's grid, or `null` to hide it.\n */\n place(placement: GridPlacement | null): void;\n /** Removes the grid's meshes and releases their GPU resources. Calling it again does nothing. */\n dispose(): void;\n}\n\n/** One drawn plane: its mesh, material and the scene that holds it. */\ninterface GridPlane {\n readonly mesh: Mesh;\n readonly material: ShaderMaterial;\n readonly scene: SceneContext;\n readonly opacity: number;\n}\n\n/**\n * Builds the grid of one scene view: a ground plane in the render scene, depth-tested against the\n * document's meshes, and a screen plane in the render overlay, over the 2D view's sprites.\n *\n * @remarks\n * Lite's grid material works in object space, so each plane is a unit square scaled to the\n * placement's extent, with `gridRatio = step / extent` and `gridOffset = centre / extent`: the lines\n * stay on world multiples of the step wherever the square moves. Neither mesh is pickable, casts\n * shadows or belongs to an entity, so no pick, selection or `readBack` reaches it, and both carry\n * core's `EDITOR_ONLY_METADATA_KEY`, so no render texture (the game view) draws them.\n *\n * @param handles - The app's Lite engine and render scene (`app.lite`).\n * @param overlay - The view's open render overlay; the grid does not own it.\n * @returns The grid, hidden until the first {@link EditorGridView.place}.\n */\nexport function createEditorGrid(handles: AppLiteHandles, overlay: RenderOverlay): EditorGridView {\n const { engine } = handles;\n const fade = createTexture2DFromPixels(engine, radialFade(), FADE_SIZE, FADE_SIZE, {\n minFilter: \"linear\",\n magFilter: \"linear\",\n });\n const ground = makePlane(\n createGround(engine, { width: 1, height: 1, subdivisions: 1 }),\n GRID_MESH_NAME,\n createGridMaterial({\n name: GRID_MESH_NAME,\n lineColor: [0.6, 0.6, 0.6],\n minorUnitVisibility: MINOR_VISIBILITY,\n opacity: GROUND_OPACITY,\n opacityTexture: fade,\n backFaceCulling: false,\n }),\n handles.scene,\n GROUND_OPACITY,\n );\n const screen = makePlane(\n createPlane(engine, { size: 1 }),\n SCREEN_GRID_MESH_NAME,\n createGridMaterial({\n name: SCREEN_GRID_MESH_NAME,\n lineColor: [0.75, 0.75, 0.75],\n minorUnitVisibility: MINOR_VISIBILITY,\n opacity: SCREEN_OPACITY,\n backFaceCulling: false,\n }),\n overlay.lite.scene,\n SCREEN_OPACITY,\n );\n let isDisposed = false;\n\n return {\n place(placement: GridPlacement | null): void {\n if (isDisposed) {\n return;\n }\n ground.mesh.visible = placement?.plane === \"ground\";\n screen.mesh.visible = placement?.plane === \"screen\";\n if (placement === null) {\n return;\n }\n const { centerX, centerY, extent } = placement;\n const target = placement.plane === \"ground\" ? ground : screen;\n if (placement.plane === \"ground\") {\n target.mesh.position.set(centerX, 0, centerY);\n target.mesh.scaling.set(extent, 1, extent);\n setShaderUniform(target.material, \"gridOffset\", [centerX / extent, 0, centerY / extent]);\n } else {\n target.mesh.position.set(centerX, centerY, 0);\n target.mesh.scaling.set(extent, extent, 1);\n setShaderUniform(target.material, \"gridOffset\", [centerX / extent, centerY / extent, 0]);\n }\n setShaderUniform(target.material, \"gridControl\", [\n placement.step / extent,\n placement.majorEvery,\n MINOR_VISIBILITY,\n target.opacity,\n ]);\n },\n dispose(): void {\n if (isDisposed) {\n return;\n }\n isDisposed = true;\n for (const plane of [ground, screen]) {\n removeFromScene(plane.scene, plane.mesh);\n disposeMeshGpu(plane.mesh);\n }\n releaseTexture(fade);\n },\n };\n}\n\n/**\n * Names a grid mesh, gives it its material, keeps it out of picks and shadows, and adds it hidden.\n *\n * @param mesh - The unit square.\n * @param name - The mesh's name.\n * @param material - Its grid material.\n * @param scene - The scene that draws it.\n * @param opacity - The material's line opacity, written back with every placement.\n * @returns The plane.\n */\nfunction makePlane(\n mesh: Mesh,\n name: string,\n material: ShaderMaterial,\n scene: SceneContext,\n opacity: number,\n): GridPlane {\n mesh.name = name;\n mesh.material = material;\n mesh.pickable = false;\n mesh.receiveShadows = false;\n mesh.visible = false;\n // Drawn in the scene view only, never in a render texture such as the Game panel's view.\n mesh.metadata = { ...mesh.metadata, [EDITOR_ONLY_METADATA_KEY]: true };\n addToScene(scene, mesh);\n return { mesh, material, scene, opacity };\n}\n\n/**\n * A square of white texels whose alpha is 1 near the centre and falls smoothly to 0 before the\n * edge, for the grid material's `opacityTexture`.\n *\n * @returns `FADE_SIZE²` RGBA texels.\n */\nfunction radialFade(): Uint8Array {\n const data = new Uint8Array(FADE_SIZE * FADE_SIZE * 4);\n for (let row = 0; row < FADE_SIZE; row += 1) {\n for (let col = 0; col < FADE_SIZE; col += 1) {\n const u = (col + 0.5) / FADE_SIZE - 0.5;\n const v = (row + 0.5) / FADE_SIZE - 0.5;\n const t = Math.min(1, Math.max(0, (Math.hypot(u, v) - FADE_START) / (FADE_END - FADE_START)));\n const alpha = 1 - t * t * (3 - 2 * t);\n const index = (row * FADE_SIZE + col) * 4;\n data[index] = 255;\n data[index + 1] = 255;\n data[index + 2] = 255;\n data[index + 3] = Math.round(alpha * 255);\n }\n }\n return data;\n}\n"],"mappings":"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"}
package/dist/index.d.ts CHANGED
@@ -301,8 +301,9 @@ export type HostKind = (typeof HostKind)[keyof typeof HostKind];
301
301
  * The play controls send `"heartbeat"`, `"playControls"`, `"logRelay"` and `"queryRuntime"`, plus
302
302
  * `"screenshot"` when the game has a canvas and `"sendInput"` when it has `app.input`. The scene
303
303
  * host sends `"heartbeat"` and whichever of `"gizmos"`, `"screenshot"`, `"viewMode2d"`,
304
- * `"pick2d"`, `"gameView"` and `"thumbnails"` it supports; every `SceneMethod` not tied to one of
305
- * them is required of a 0.3 scene host.
304
+ * `"pick2d"`, `"gameView"`, `"thumbnails"`, `"grid"`, `"tilemapCells"`, `"editorLines"` and
305
+ * `"spriteAnimation"` it supports; every `SceneMethod` not tied to one of them is required of a
306
+ * 0.3 scene host.
306
307
  *
307
308
  * @public
308
309
  */
@@ -369,6 +370,33 @@ export declare const HostCapability: {
369
370
  * `RpcErrorCode.methodNotFound`.
370
371
  */
371
372
  readonly thumbnails: "thumbnails";
373
+ /**
374
+ * The scene host draws a grid in the view and answers `setGrid`: a ground grid at `y = 0` in 3D
375
+ * view mode and a unit grid (a pixel grid when zoomed in) over the 2D view. From engine ask E31
376
+ * (additive in 0.3); without it, the scene host answers `setGrid` with
377
+ * `RpcErrorCode.methodNotFound`.
378
+ */
379
+ readonly grid: "grid";
380
+ /**
381
+ * The scene host answers `setTilemapCells`: it writes cells into the open scene's live tilemaps,
382
+ * so a tilemap editor's painting shows without a save. Additive in 0.3; without it, the scene
383
+ * host answers `setTilemapCells` with `RpcErrorCode.methodNotFound`.
384
+ */
385
+ readonly tilemapCells: "tilemapCells";
386
+ /**
387
+ * The scene host answers `setEditorLines` and `clearEditorLines`: it draws the editor's own line
388
+ * segments (collider outlines, handles) over the view in both view modes, never in a game view or
389
+ * the play view. Additive in 0.3; without it, the scene host answers both with
390
+ * `RpcErrorCode.methodNotFound`.
391
+ */
392
+ readonly editorLines: "editorLines";
393
+ /**
394
+ * The scene host answers `sampleSpriteAnimation`: one frame of a clip on an entity's
395
+ * `SpriteAnimator` (`@ignifx/2d`), for the editor's sprite animation panel. From engine ask E51
396
+ * (additive in 0.3); without it, the scene host answers `sampleSpriteAnimation` with
397
+ * `RpcErrorCode.methodNotFound`.
398
+ */
399
+ readonly spriteAnimation: "spriteAnimation";
372
400
  };
373
401
  /**
374
402
  * The union of the names in `HostCapability`.
@@ -1110,6 +1138,34 @@ export declare const SceneMethod: {
1110
1138
  * `RpcErrorCode.methodNotFound`. Additive in 0.3.
1111
1139
  */
1112
1140
  readonly sampleAnimation: "sampleAnimation";
1141
+ /**
1142
+ * Shows one frame of a clip on an entity's `SpriteAnimator` without playing it (engine ask E51).
1143
+ * Needs `HostCapability.spriteAnimation`. Answers {@link SampleSpriteAnimationResult}. A host from
1144
+ * before it answers `RpcErrorCode.methodNotFound`. Additive in 0.3.
1145
+ */
1146
+ readonly sampleSpriteAnimation: "sampleSpriteAnimation";
1147
+ /**
1148
+ * Shows or hides the view's grid and sets its spacing (engine ask E31). Needs
1149
+ * `HostCapability.grid`. Answers `null`. Additive in 0.3.
1150
+ */
1151
+ readonly setGrid: "setGrid";
1152
+ /**
1153
+ * Writes cells of a tilemap asset into every live `Tilemap` of the open scene that shows it, so
1154
+ * painting is seen at once, without a save or a reopen. The file on disk is not touched. Needs
1155
+ * `HostCapability.tilemapCells`. Answers {@link SetTilemapCellsResult}. Additive in 0.3.
1156
+ */
1157
+ readonly setTilemapCells: "setTilemapCells";
1158
+ /**
1159
+ * Draws a set of world-space line segments over the view, such as collider outlines or handles,
1160
+ * replacing the set of the same id. Needs `HostCapability.editorLines`. Answers `null`. Additive
1161
+ * in 0.3.
1162
+ */
1163
+ readonly setEditorLines: "setEditorLines";
1164
+ /**
1165
+ * Removes one set of lines `setEditorLines` drew, or every set. Needs `HostCapability.editorLines`.
1166
+ * Answers `null`. Additive in 0.3.
1167
+ */
1168
+ readonly clearEditorLines: "clearEditorLines";
1113
1169
  };
1114
1170
  /**
1115
1171
  * The union of the names in `SceneMethod`.
@@ -1760,6 +1816,119 @@ interface SetAnimateMaterialsParams {
1760
1816
  /** Whether the shader clock (`time` in shader materials and custom post effects) runs. */
1761
1817
  readonly enabled: boolean;
1762
1818
  }
1819
+ /**
1820
+ * The smallest grid spacing `setGrid` accepts, in metres.
1821
+ *
1822
+ * @public
1823
+ */
1824
+ export declare const GRID_MIN_SIZE = .001;
1825
+ /**
1826
+ * The largest grid spacing `setGrid` accepts, in metres.
1827
+ *
1828
+ * @public
1829
+ */
1830
+ export declare const GRID_MAX_SIZE = 1e3;
1831
+ /**
1832
+ * The parameters of `setGrid`. Each call sets the whole grid: a field left out takes its default.
1833
+ *
1834
+ * @public
1835
+ */
1836
+ interface SetGridParams {
1837
+ /** Whether the grid draws. Defaults to `true`, which is also how the host starts. */
1838
+ readonly visible?: boolean;
1839
+ /**
1840
+ * The spacing of the minor lines, in metres, from {@link GRID_MIN_SIZE} to {@link GRID_MAX_SIZE}.
1841
+ * Defaults to `1`. Every tenth line is a major line; when the lines get too dense to see, the
1842
+ * host draws every tenth one instead.
1843
+ */
1844
+ readonly size?: number;
1845
+ }
1846
+ /**
1847
+ * The most numbers the `cells` of one `setTilemapCells` request may hold: a million cells. A request
1848
+ * with more fails with `invalidParams`.
1849
+ *
1850
+ * @public
1851
+ */
1852
+ export declare const TILEMAP_CELLS_MAX_NUMBERS = 2e6;
1853
+ /**
1854
+ * The parameters of `setTilemapCells`.
1855
+ *
1856
+ * @public
1857
+ */
1858
+ interface SetTilemapCellsParams {
1859
+ /**
1860
+ * The tilemap document's asset address, as a `Tilemap`'s `map` reference names it
1861
+ * (`"levels/level-1.tilemap.json"`). Every `Tilemap` of the open scene loaded from it is written.
1862
+ */
1863
+ readonly asset: string;
1864
+ /** The layer: its name in the document, or its index (`0` at the back). */
1865
+ readonly layer: string | number;
1866
+ /**
1867
+ * Flat `[index, tile, index, tile, …]` pairs, in the file's order: `index` is row-major with the
1868
+ * **top** row first, as the document's `tiles` array, and `tile` a global tile id, `0` to clear.
1869
+ * Applied in order, so a cell named twice ends with the later tile. At most
1870
+ * {@link TILEMAP_CELLS_MAX_NUMBERS} numbers.
1871
+ */
1872
+ readonly cells: readonly number[];
1873
+ }
1874
+ /**
1875
+ * The answer to `setTilemapCells`.
1876
+ *
1877
+ * @public
1878
+ */
1879
+ interface SetTilemapCellsResult {
1880
+ /**
1881
+ * How many live `Tilemap`s were written: those of the open scene whose `map` is the asset and has
1882
+ * loaded. `0` when none shows it yet, which is not an error.
1883
+ */
1884
+ readonly tilemaps: number;
1885
+ /** How many cell writes changed a tile, summed over those tilemaps. */
1886
+ readonly changed: number;
1887
+ }
1888
+ /**
1889
+ * The most numbers the `lines` of one `setEditorLines` request may hold: 100 000 segments.
1890
+ *
1891
+ * @public
1892
+ */
1893
+ export declare const EDITOR_LINES_MAX_NUMBERS = 6e5;
1894
+ /**
1895
+ * The most line sets the view draws at once; a `setEditorLines` for a new id past it fails with
1896
+ * `invalidParams`.
1897
+ *
1898
+ * @public
1899
+ */
1900
+ export declare const EDITOR_LINES_MAX_SETS = 64;
1901
+ /**
1902
+ * The longest line set id, in UTF-16 code units.
1903
+ *
1904
+ * @public
1905
+ */
1906
+ export declare const EDITOR_LINES_MAX_ID_LENGTH = 256;
1907
+ /**
1908
+ * The parameters of `setEditorLines`.
1909
+ *
1910
+ * @public
1911
+ */
1912
+ interface SetEditorLinesParams {
1913
+ /** The set's id, chosen by the editor (`"collider-outlines"`); a later call with it replaces the set. */
1914
+ readonly id: string;
1915
+ /**
1916
+ * World-space segments in metres: every six numbers are one segment, the `x, y, z` of its two
1917
+ * ends, as `getColliderOutlines` answers them. Empty draws nothing but keeps the id.
1918
+ */
1919
+ readonly lines: readonly number[];
1920
+ /** The colour, `[r, g, b]` or `[r, g, b, a]` from 0 to 1. Defaults to a light green. */
1921
+ readonly color?: readonly number[];
1922
+ }
1923
+ /**
1924
+ * The parameters of `clearEditorLines`.
1925
+ *
1926
+ * @public
1927
+ */
1928
+ interface ClearEditorLinesParams {
1929
+ /** The set to remove; left out, every set is removed. An unknown id is not an error. */
1930
+ readonly id?: string;
1931
+ }
1763
1932
  /**
1764
1933
  * One collider's outline in the answer to `getColliderOutlines`.
1765
1934
  *
@@ -1838,6 +2007,44 @@ interface SampleAnimationResult {
1838
2007
  */
1839
2008
  readonly posed: boolean;
1840
2009
  }
2010
+ /**
2011
+ * The parameters of `sampleSpriteAnimation`.
2012
+ *
2013
+ * @remarks
2014
+ * The host calls `@ignifx/2d`'s `SpriteAnimator.sample(clip, frame)` or
2015
+ * `SpriteAnimator.sampleTime(clip, time)` on the entity's `SpriteAnimator`, which writes the frame
2016
+ * onto the entity's `SpriteRenderer` and stops playback there. Exactly one of `frame` and `time` is
2017
+ * given. A frame outside the clip is clamped to it; a time past the clip's end wraps a looping clip
2018
+ * and holds a one-shot clip on its last frame, at the animator's `speed`. In an edit-mode scene view
2019
+ * the frame stays until the next sample or document change. The clip name is at most
2020
+ * {@link SAMPLE_ANIMATION_MAX_NAME_LENGTH} long. An entity the open scene lacks, or one without a
2021
+ * `SpriteAnimator`, is refused with `RpcErrorCode.invalidParams`, and so is a clip the document does
2022
+ * not declare, with the engine's code (`IGX-1108`) as `data.code`.
2023
+ *
2024
+ * @public
2025
+ */
2026
+ interface SampleSpriteAnimationParams {
2027
+ /** The uid of the document entity whose `SpriteAnimator` is posed. */
2028
+ readonly entity: string;
2029
+ /** The clip's name in the `.spriteanim.json` document. */
2030
+ readonly clip: string;
2031
+ /** The frame within the clip, counting from `0`. Give this or `time`. */
2032
+ readonly frame?: number;
2033
+ /** How far into the clip, in seconds. Give this or `frame`. */
2034
+ readonly time?: number;
2035
+ }
2036
+ /**
2037
+ * The answer to `sampleSpriteAnimation`.
2038
+ *
2039
+ * @public
2040
+ */
2041
+ interface SampleSpriteAnimationResult {
2042
+ /**
2043
+ * Whether the frame was written. `false` while the animation document or the sprite's atlas is
2044
+ * still loading, or when the clip has no frames; the editor may send the request again later.
2045
+ */
2046
+ readonly posed: boolean;
2047
+ }
1841
2048
  /**
1842
2049
  * The parameters of `sceneOpened`.
1843
2050
  *
@@ -2054,10 +2261,10 @@ interface RpcNotificationWithParams<M extends string, P> extends RpcNotification
2054
2261
  *
2055
2262
  * @public
2056
2263
  */
2057
- type SceneRequest = RpcRequestWithParams<typeof SceneMethod.openScene, OpenSceneParams> | RpcRequest<typeof SceneMethod.closeScene, never> | RpcRequestWithParams<typeof SceneMethod.applyOps, ApplyOpsParams> | RpcRequestWithParams<typeof SceneMethod.readBack, ReadBackParams> | RpcRequestWithParams<typeof SceneMethod.select, EntitySelection> | RpcRequestWithParams<typeof SceneMethod.setGizmo, SetGizmoParams> | RpcRequestWithParams<typeof SceneMethod.frame, FrameParams> | RpcRequestWithParams<typeof SceneMethod.pick, PickParams> | RpcRequestWithParams<typeof SceneMethod.screenshot, ScreenshotParams> | RpcRequest<typeof SceneMethod.getSchemas, never> | RpcRequest<typeof SceneMethod.describeSettings, never> | RpcRequestWithParams<typeof SceneMethod.setViewMode, SetViewModeParams> | RpcRequestWithParams<typeof SceneMethod.setAnimateMaterials, SetAnimateMaterialsParams> | RpcRequestWithParams<typeof SceneMethod.getColliderOutlines, EntitySelection> | RpcRequestWithParams<typeof SceneMethod.sampleAnimation, SampleAnimationParams>;
2264
+ type SceneRequest = RpcRequestWithParams<typeof SceneMethod.openScene, OpenSceneParams> | RpcRequest<typeof SceneMethod.closeScene, never> | RpcRequestWithParams<typeof SceneMethod.applyOps, ApplyOpsParams> | RpcRequestWithParams<typeof SceneMethod.readBack, ReadBackParams> | RpcRequestWithParams<typeof SceneMethod.select, EntitySelection> | RpcRequestWithParams<typeof SceneMethod.setGizmo, SetGizmoParams> | RpcRequestWithParams<typeof SceneMethod.frame, FrameParams> | RpcRequestWithParams<typeof SceneMethod.pick, PickParams> | RpcRequestWithParams<typeof SceneMethod.screenshot, ScreenshotParams> | RpcRequest<typeof SceneMethod.getSchemas, never> | RpcRequest<typeof SceneMethod.describeSettings, never> | RpcRequestWithParams<typeof SceneMethod.setViewMode, SetViewModeParams> | RpcRequestWithParams<typeof SceneMethod.setAnimateMaterials, SetAnimateMaterialsParams> | RpcRequestWithParams<typeof SceneMethod.getColliderOutlines, EntitySelection> | RpcRequestWithParams<typeof SceneMethod.sampleAnimation, SampleAnimationParams> | RpcRequestWithParams<typeof SceneMethod.sampleSpriteAnimation, SampleSpriteAnimationParams> | RpcRequestWithParams<typeof SceneMethod.setGrid, SetGridParams> | RpcRequestWithParams<typeof SceneMethod.setTilemapCells, SetTilemapCellsParams> | RpcRequestWithParams<typeof SceneMethod.setEditorLines, SetEditorLinesParams> | RpcRequestWithParams<typeof SceneMethod.clearEditorLines, ClearEditorLinesParams>;
2058
2265
  /**
2059
2266
  * The success answer of the `SceneMethod`s that return nothing: `closeScene`, `setGizmo`, `frame`,
2060
- * `setViewMode` and `setAnimateMaterials`.
2267
+ * `setViewMode`, `setAnimateMaterials`, `setGrid`, `setEditorLines` and `clearEditorLines`.
2061
2268
  *
2062
2269
  * @public
2063
2270
  */
@@ -2122,6 +2329,18 @@ type ColliderOutlinesResponse = RpcSuccessResponse<ColliderOutlineSet>;
2122
2329
  * @public
2123
2330
  */
2124
2331
  type SampleAnimationResponse = RpcSuccessResponse<SampleAnimationResult>;
2332
+ /**
2333
+ * The success answer to `setTilemapCells`.
2334
+ *
2335
+ * @public
2336
+ */
2337
+ type SetTilemapCellsResponse = RpcSuccessResponse<SetTilemapCellsResult>;
2338
+ /**
2339
+ * The success answer to `sampleSpriteAnimation`.
2340
+ *
2341
+ * @public
2342
+ */
2343
+ type SampleSpriteAnimationResponse = RpcSuccessResponse<SampleSpriteAnimationResult>;
2125
2344
  /**
2126
2345
  * Scene host → editor: one of the `SceneNotification`s.
2127
2346
  *
@@ -2304,6 +2523,54 @@ export declare function isSetViewModeParams(value: unknown): value is SetViewMod
2304
2523
  * @public
2305
2524
  */
2306
2525
  export declare function isSetAnimateMaterialsParams(value: unknown): value is SetAnimateMaterialsParams;
2526
+ /**
2527
+ * Checks the parameters of `setGrid`.
2528
+ *
2529
+ * @param value - The received `params`.
2530
+ * @returns True for an object whose `visible`, if present, is a boolean and whose `size`, if
2531
+ * present, is a number from {@link GRID_MIN_SIZE} to {@link GRID_MAX_SIZE}.
2532
+ *
2533
+ * @public
2534
+ */
2535
+ export declare function isSetGridParams(value: unknown): value is SetGridParams;
2536
+ /**
2537
+ * Checks the parameters of `setTilemapCells`.
2538
+ *
2539
+ * @param value - The received `params`.
2540
+ * @returns True for a non-empty `asset`, a layer name or index, and an even-length list of at most
2541
+ * {@link TILEMAP_CELLS_MAX_NUMBERS} non-negative integers.
2542
+ *
2543
+ * @public
2544
+ */
2545
+ export declare function isSetTilemapCellsParams(value: unknown): value is SetTilemapCellsParams;
2546
+ /**
2547
+ * Checks the result of `setTilemapCells`.
2548
+ *
2549
+ * @param value - The received `result`.
2550
+ * @returns True for two counts.
2551
+ *
2552
+ * @public
2553
+ */
2554
+ export declare function isSetTilemapCellsResult(value: unknown): value is SetTilemapCellsResult;
2555
+ /**
2556
+ * Checks the parameters of `setEditorLines`.
2557
+ *
2558
+ * @param value - The received `params`.
2559
+ * @returns True for an id, a list of finite numbers whose length is a multiple of six and at most
2560
+ * {@link EDITOR_LINES_MAX_NUMBERS}, and an optional colour of three or four numbers from 0 to 1.
2561
+ *
2562
+ * @public
2563
+ */
2564
+ export declare function isSetEditorLinesParams(value: unknown): value is SetEditorLinesParams;
2565
+ /**
2566
+ * Checks the parameters of `clearEditorLines`.
2567
+ *
2568
+ * @param value - The received `params`.
2569
+ * @returns True for an object whose `id`, if present, is a line set id.
2570
+ *
2571
+ * @public
2572
+ */
2573
+ export declare function isClearEditorLinesParams(value: unknown): value is ClearEditorLinesParams;
2307
2574
  /**
2308
2575
  * Checks one record of `getColliderOutlines`.
2309
2576
  *
@@ -2343,6 +2610,25 @@ export declare function isSampleAnimationParams(value: unknown): value is Sample
2343
2610
  * @public
2344
2611
  */
2345
2612
  export declare function isSampleAnimationResult(value: unknown): value is SampleAnimationResult;
2613
+ /**
2614
+ * Checks the parameters of `sampleSpriteAnimation`.
2615
+ *
2616
+ * @param value - The received `params`.
2617
+ * @returns True for a uid, a clip name within {@link SAMPLE_ANIMATION_MAX_NAME_LENGTH}, and exactly
2618
+ * one of a finite `frame` and a finite `time`.
2619
+ *
2620
+ * @public
2621
+ */
2622
+ export declare function isSampleSpriteAnimationParams(value: unknown): value is SampleSpriteAnimationParams;
2623
+ /**
2624
+ * Checks the result of `sampleSpriteAnimation`.
2625
+ *
2626
+ * @param value - The received `result`.
2627
+ * @returns True for `{ posed: boolean }`.
2628
+ *
2629
+ * @public
2630
+ */
2631
+ export declare function isSampleSpriteAnimationResult(value: unknown): value is SampleSpriteAnimationResult;
2346
2632
  /**
2347
2633
  * Checks the parameters of `sceneOpened`.
2348
2634
  *
@@ -3379,5 +3665,5 @@ export declare function startEditorPlayControls(app: App, options: EditorPlayCon
3379
3665
  */
3380
3666
  export declare function listenForEditorPlayControls(options: EditorPlayControlsOptions): EditorPlayConnector;
3381
3667
  //#endregion
3382
- export { type AddComponentOp, type AppErrorData, type ApplyOpFailure, type ApplyOpsParams, type ApplyOpsResponse, type ApplyOpsResult, type AssetReloadedParams, type ColliderOutlineRecord, type ColliderOutlineSet, type ColliderOutlinesResponse, type CreateEntityOp, type DescribeSettingsResponse, type DestroyEntityOp, type EditorAssetChange, type EditorConnectMessage, type EditorHost, EditorHostErrorCode, type EditorHostOptions, type EditorMessageTarget, type EditorPlayConnector, type EditorPlayControls, type EditorPlayControlsOptions, type EntityField, type EntityFieldValues, type EntitySelection, type FrameParams, type GameViewFrameParams, type GameViewFrameResponse, type GameViewFrameResult, type GameViewState, type GetSchemasResponse, type GizmoDragMode, type GizmoSnap, type HeartbeatNotification, type HelloParams, type HelloRequest, type HostErrorParams, type HotReloadError, type HotReloadReport, type HotReloadedParams, type IncompatibleProtocolData, type InstantiateOp, type InvalidSceneFileData, type JsonArray, type JsonObject, type JsonPath, type JsonValue, type LogLevel, type LogParams, type LoggedError, type NullResponse, type OpenSceneParams, type OpenSceneResponse, type OpenSceneResult, type PickParams, type PickRay, type PickResponse, type PickResult, type PingRequest, type PlayRequest, type PlayResponse, type PlayState, type PlayStateChangedNotification, type PlayStateReport, type PlayStateResponse, type PlayStats, type PlayStatsResponse, type PongResponse, type ProtocolVersion, type QueryRuntimeParams, type QueryRuntimeResponse, type QueryRuntimeResult, type ReadBackParams, type ReadBackResponse, type ReadBackResult, type ReadyResponse, type ReadyResult, type RemoveComponentOp, type RemoveOverrideOp, type RenderThumbnailParams, type RenderViewRequest, type ReorderOp, type ReparentOp, type RpcError, type RpcErrorResponse, type RpcId, type RpcMessage, type RpcNotification, type RpcNotificationWithParams, type RpcRequest, type RpcRequestWithParams, type RpcResponse, type RpcSuccessResponse, type SampleAnimationParams, type SampleAnimationResponse, type SampleAnimationResult, type SceneFile, type SceneFileAssetRef, type SceneFileComponent, type SceneFileEntity, type SceneFileInstance, type SceneFileIssue, type SceneFileOverride, type SceneFileTransform, type SceneHostNotification, type SceneIssue, type SceneOp, type SceneOpenedParams, type SceneRequest, type SchemaDescription, type SchemaFieldDescription, type SchemaSet, type ScreenshotParams, type ScreenshotResponse, type ScreenshotResult, type SelectResponse, type SendInputEvent, type SendInputKeyEvent, type SendInputParams, type SendInputPointerEvent, type SendInputResponse, type SendInputResult, type SetAnimateMaterialsParams, type SetEntityFieldOp, type SetGameViewParams, type SetGameViewResponse, type SetGizmoParams, type SetOverrideOp, type SetPropOp, type SetSceneSettingOp, type SetTransformOp, type SetViewModeParams, type SettingsSet, type StepParams, type ThumbnailResponse, type ThumbnailResult, type TransformDraggedParams, type TransformDraggingParams, type Vec3, isEditorOrigin };
3668
+ export { type AddComponentOp, type AppErrorData, type ApplyOpFailure, type ApplyOpsParams, type ApplyOpsResponse, type ApplyOpsResult, type AssetReloadedParams, type ClearEditorLinesParams, type ColliderOutlineRecord, type ColliderOutlineSet, type ColliderOutlinesResponse, type CreateEntityOp, type DescribeSettingsResponse, type DestroyEntityOp, type EditorAssetChange, type EditorConnectMessage, type EditorHost, EditorHostErrorCode, type EditorHostOptions, type EditorMessageTarget, type EditorPlayConnector, type EditorPlayControls, type EditorPlayControlsOptions, type EntityField, type EntityFieldValues, type EntitySelection, type FrameParams, type GameViewFrameParams, type GameViewFrameResponse, type GameViewFrameResult, type GameViewState, type GetSchemasResponse, type GizmoDragMode, type GizmoSnap, type HeartbeatNotification, type HelloParams, type HelloRequest, type HostErrorParams, type HotReloadError, type HotReloadReport, type HotReloadedParams, type IncompatibleProtocolData, type InstantiateOp, type InvalidSceneFileData, type JsonArray, type JsonObject, type JsonPath, type JsonValue, type LogLevel, type LogParams, type LoggedError, type NullResponse, type OpenSceneParams, type OpenSceneResponse, type OpenSceneResult, type PickParams, type PickRay, type PickResponse, type PickResult, type PingRequest, type PlayRequest, type PlayResponse, type PlayState, type PlayStateChangedNotification, type PlayStateReport, type PlayStateResponse, type PlayStats, type PlayStatsResponse, type PongResponse, type ProtocolVersion, type QueryRuntimeParams, type QueryRuntimeResponse, type QueryRuntimeResult, type ReadBackParams, type ReadBackResponse, type ReadBackResult, type ReadyResponse, type ReadyResult, type RemoveComponentOp, type RemoveOverrideOp, type RenderThumbnailParams, type RenderViewRequest, type ReorderOp, type ReparentOp, type RpcError, type RpcErrorResponse, type RpcId, type RpcMessage, type RpcNotification, type RpcNotificationWithParams, type RpcRequest, type RpcRequestWithParams, type RpcResponse, type RpcSuccessResponse, type SampleAnimationParams, type SampleAnimationResponse, type SampleAnimationResult, type SampleSpriteAnimationParams, type SampleSpriteAnimationResponse, type SampleSpriteAnimationResult, type SceneFile, type SceneFileAssetRef, type SceneFileComponent, type SceneFileEntity, type SceneFileInstance, type SceneFileIssue, type SceneFileOverride, type SceneFileTransform, type SceneHostNotification, type SceneIssue, type SceneOp, type SceneOpenedParams, type SceneRequest, type SchemaDescription, type SchemaFieldDescription, type SchemaSet, type ScreenshotParams, type ScreenshotResponse, type ScreenshotResult, type SelectResponse, type SendInputEvent, type SendInputKeyEvent, type SendInputParams, type SendInputPointerEvent, type SendInputResponse, type SendInputResult, type SetAnimateMaterialsParams, type SetEditorLinesParams, type SetEntityFieldOp, type SetGameViewParams, type SetGameViewResponse, type SetGizmoParams, type SetGridParams, type SetOverrideOp, type SetPropOp, type SetSceneSettingOp, type SetTilemapCellsParams, type SetTilemapCellsResponse, type SetTilemapCellsResult, type SetTransformOp, type SetViewModeParams, type SettingsSet, type StepParams, type ThumbnailResponse, type ThumbnailResult, type TransformDraggedParams, type TransformDraggingParams, type Vec3, isEditorOrigin };
3383
3669
  //# sourceMappingURL=index.d.ts.map