@adatechnology/game-shapes 0.2.0 → 0.2.2

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/dist/index.js CHANGED
@@ -52,7 +52,7 @@ import {
52
52
  transformPoint,
53
53
  unregisterGenerator,
54
54
  validateShape
55
- } from "./chunk-IFXQIDSA.js";
55
+ } from "./chunk-M5N2SHNL.js";
56
56
 
57
57
  // src/instance.ts
58
58
  import { applyPatches, mergeById, removeIds } from "@adatechnology/game-contracts";
@@ -320,7 +320,13 @@ interface GeneratorContext {
320
320
  readonly detail: number;
321
321
  readonly path: string;
322
322
  }
323
- type ShapeGenerator = (params: any, context: GeneratorContext) => ShapeNode;
323
+ /**
324
+ * A custom node's generator. Declared as a method so the registry can hold generators with their own params type (the custom node that
325
+ * names a generator carries the matching params).
326
+ */
327
+ type ShapeGenerator<TParams = unknown> = {
328
+ generate(params: TParams, context: GeneratorContext): ShapeNode;
329
+ }['generate'];
324
330
  interface GenerateOptions {
325
331
  /** Seed of the custom generators. Default 0. */
326
332
  readonly seed?: number | string;
package/dist/worker.d.ts CHANGED
@@ -1 +1 @@
1
- export { x as ShapeJob, J as ShapeReply, O as ShapeWorkerOptions, Y as WorkerScopeLike, Z as installShapeWorker } from './worker-BZ7plgyI.js';
1
+ export { x as ShapeJob, J as ShapeReply, O as ShapeWorkerOptions, Y as WorkerScopeLike, Z as installShapeWorker } from './worker-DUZKXhCw.js';
package/dist/worker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  installShapeWorker
3
- } from "./chunk-IFXQIDSA.js";
3
+ } from "./chunk-M5N2SHNL.js";
4
4
  export {
5
5
  installShapeWorker
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adatechnology/game-shapes",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
5
  "description": "Renderer-agnostic 3D shape generator: a JSON shape schema (primitives, extrusions, lathes, cheap booleans, transforms, groups, named parts, materials by id, LOD rules, instancing hints) in, typed-array buffers per material out. Pure, deterministic by seed, worker friendly and cacheable; the generators are bit-exact ports of three.js r160.",
6
6
  "keywords": [
@@ -44,7 +44,7 @@
44
44
  "schema"
45
45
  ],
46
46
  "dependencies": {
47
- "@adatechnology/game-contracts": "^0.22.0"
47
+ "@adatechnology/game-contracts": "^0.24.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/node": "^22.10.7",