@triforge/core-types 0.1.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.
Files changed (65) hide show
  1. package/dist/IAnimatable.d.ts +18 -0
  2. package/dist/IAnimatable.d.ts.map +1 -0
  3. package/dist/IAnimatable.js +2 -0
  4. package/dist/IAnimatable.js.map +1 -0
  5. package/dist/ICollider.d.ts +18 -0
  6. package/dist/ICollider.d.ts.map +1 -0
  7. package/dist/ICollider.js +2 -0
  8. package/dist/ICollider.js.map +1 -0
  9. package/dist/IConstraint.d.ts +14 -0
  10. package/dist/IConstraint.d.ts.map +1 -0
  11. package/dist/IConstraint.js +2 -0
  12. package/dist/IConstraint.js.map +1 -0
  13. package/dist/ICurve.d.ts +30 -0
  14. package/dist/ICurve.d.ts.map +1 -0
  15. package/dist/ICurve.js +2 -0
  16. package/dist/ICurve.js.map +1 -0
  17. package/dist/IEmitter.d.ts +27 -0
  18. package/dist/IEmitter.d.ts.map +1 -0
  19. package/dist/IEmitter.js +2 -0
  20. package/dist/IEmitter.js.map +1 -0
  21. package/dist/IForce.d.ts +28 -0
  22. package/dist/IForce.d.ts.map +1 -0
  23. package/dist/IForce.js +2 -0
  24. package/dist/IForce.js.map +1 -0
  25. package/dist/IGeometryProvider.d.ts +19 -0
  26. package/dist/IGeometryProvider.d.ts.map +1 -0
  27. package/dist/IGeometryProvider.js +2 -0
  28. package/dist/IGeometryProvider.js.map +1 -0
  29. package/dist/IKeyframeTarget.d.ts +17 -0
  30. package/dist/IKeyframeTarget.d.ts.map +1 -0
  31. package/dist/IKeyframeTarget.js +2 -0
  32. package/dist/IKeyframeTarget.js.map +1 -0
  33. package/dist/IModifier.d.ts +27 -0
  34. package/dist/IModifier.d.ts.map +1 -0
  35. package/dist/IModifier.js +2 -0
  36. package/dist/IModifier.js.map +1 -0
  37. package/dist/IParticlePool.d.ts +30 -0
  38. package/dist/IParticlePool.d.ts.map +1 -0
  39. package/dist/IParticlePool.js +2 -0
  40. package/dist/IParticlePool.js.map +1 -0
  41. package/dist/IPoseBone.d.ts +26 -0
  42. package/dist/IPoseBone.d.ts.map +1 -0
  43. package/dist/IPoseBone.js +2 -0
  44. package/dist/IPoseBone.js.map +1 -0
  45. package/dist/IRenderer.d.ts +23 -0
  46. package/dist/IRenderer.d.ts.map +1 -0
  47. package/dist/IRenderer.js +2 -0
  48. package/dist/IRenderer.js.map +1 -0
  49. package/dist/IRigidBody.d.ts +22 -0
  50. package/dist/IRigidBody.d.ts.map +1 -0
  51. package/dist/IRigidBody.js +2 -0
  52. package/dist/IRigidBody.js.map +1 -0
  53. package/dist/IShaderNode.d.ts +27 -0
  54. package/dist/IShaderNode.d.ts.map +1 -0
  55. package/dist/IShaderNode.js +2 -0
  56. package/dist/IShaderNode.js.map +1 -0
  57. package/dist/IStrand.d.ts +23 -0
  58. package/dist/IStrand.d.ts.map +1 -0
  59. package/dist/IStrand.js +2 -0
  60. package/dist/IStrand.js.map +1 -0
  61. package/dist/index.d.ts +27 -0
  62. package/dist/index.d.ts.map +1 -0
  63. package/dist/index.js +12 -0
  64. package/dist/index.js.map +1 -0
  65. package/package.json +41 -0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * IAnimatable — any object whose scalar inputs live in a flat `parameters`
3
+ * object, making them compatible with GSAP and st-keyframe.
4
+ *
5
+ * Every node, modifier, force, renderer, and simulator in the ecosystem
6
+ * implements this interface on its `parameters` property.
7
+ *
8
+ * @example
9
+ * // Drive any IAnimatable with st-keyframe:
10
+ * const track = new KeyframeTrack(node.parameters, 'scale', [...])
11
+ *
12
+ * // Drive with GSAP:
13
+ * gsap.to(modifier.parameters, { strength: 1.0, duration: 2 })
14
+ */
15
+ export interface IAnimatable {
16
+ parameters: Record<string, number | [number, number, number]>;
17
+ }
18
+ //# sourceMappingURL=IAnimatable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAnimatable.d.ts","sourceRoot":"","sources":["../src/IAnimatable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC9D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAnimatable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAnimatable.js","sourceRoot":"","sources":["../src/IAnimatable.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { Vector3 } from 'three';
2
+ /**
3
+ * ICollider — the contract every st-physics-core collider fulfils.
4
+ *
5
+ * Colliders resolve penetration by pushing a particle/vertex outside the
6
+ * collider surface and optionally reflecting its velocity.
7
+ */
8
+ export interface ICollider {
9
+ parameters: Record<string, number>;
10
+ enabled: boolean;
11
+ /**
12
+ * If `position` is inside the collider, move it to the surface and
13
+ * reflect `velocity` accordingly.
14
+ * @returns true if a collision was resolved this call.
15
+ */
16
+ resolve(position: Vector3, velocity: Vector3): boolean;
17
+ }
18
+ //# sourceMappingURL=ICollider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICollider.d.ts","sourceRoot":"","sources":["../src/ICollider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAA;CACvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ICollider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICollider.js","sourceRoot":"","sources":["../src/ICollider.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * IConstraint — the contract every st-physics-core rigid-body constraint fulfils.
3
+ *
4
+ * Constraints are solved iteratively each physics step by RigidBodyWorld.
5
+ * All position/velocity corrections happen inside solve().
6
+ */
7
+ export interface IConstraint {
8
+ readonly type: string;
9
+ parameters: Record<string, number>;
10
+ enabled: boolean;
11
+ /** Apply one position+velocity correction pass. Called each substep. */
12
+ solve(): void;
13
+ }
14
+ //# sourceMappingURL=IConstraint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConstraint.d.ts","sourceRoot":"","sources":["../src/IConstraint.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,wEAAwE;IACxE,KAAK,IAAI,IAAI,CAAA;CACd"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IConstraint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConstraint.js","sourceRoot":"","sources":["../src/IConstraint.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import type { Vector3 } from 'three';
2
+ /**
3
+ * ICurve — the minimal interface shared by all st-curve-core curve types
4
+ * (BezierCurve, NURBSCurve, CatmullRomCurve) and any custom curve.
5
+ *
6
+ * Consumers (CurveTube, PathFollow, CurveToMesh, etc.) accept ICurve so they
7
+ * work with any curve implementation — not just the ones in st-curve-core.
8
+ *
9
+ * @example
10
+ * // A custom circle curve compatible with the whole ecosystem:
11
+ * const circle: ICurve = {
12
+ * getPoint: (t, out = new Vector3()) =>
13
+ * out.set(Math.cos(t * Math.PI * 2), 0, Math.sin(t * Math.PI * 2)),
14
+ * getTangent: (t, out = new Vector3()) =>
15
+ * out.set(-Math.sin(t * Math.PI * 2), 0, Math.cos(t * Math.PI * 2)).normalize(),
16
+ * }
17
+ */
18
+ export interface ICurve {
19
+ /**
20
+ * Sample the curve at normalised parameter t ∈ [0, 1].
21
+ * Returns a world-space point; writes into `target` if supplied.
22
+ */
23
+ getPoint(t: number, target?: Vector3): Vector3;
24
+ /**
25
+ * Sample the unit tangent (direction of travel) at t ∈ [0, 1].
26
+ * Returns a normalised Vector3; writes into `target` if supplied.
27
+ */
28
+ getTangent(t: number, target?: Vector3): Vector3;
29
+ }
30
+ //# sourceMappingURL=ICurve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICurve.d.ts","sourceRoot":"","sources":["../src/ICurve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEpC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,MAAM;IACrB;;;OAGG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IAC9C;;;OAGG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CACjD"}
package/dist/ICurve.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ICurve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICurve.js","sourceRoot":"","sources":["../src/ICurve.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import type { BufferGeometry } from 'three';
2
+ import type { Vector3 } from 'three';
3
+ /**
4
+ * IEmitter — the contract every st-particle-core emitter fulfils.
5
+ *
6
+ * Emitters write spawn position and initial velocity onto a particle-like
7
+ * object. The geometry argument is the source surface for mesh emitters;
8
+ * point emitters ignore it.
9
+ */
10
+ export interface IEmitter {
11
+ parameters: Record<string, number>;
12
+ /** World-space velocity of the emitter object (set externally each frame). */
13
+ worldVelocity: Vector3;
14
+ /**
15
+ * Write spawn position and initial velocity onto the particle.
16
+ * Called by ParticleSystem each time a particle is born.
17
+ */
18
+ spawn(particle: {
19
+ position: Vector3;
20
+ velocity: Vector3;
21
+ size: number;
22
+ }, geometry: BufferGeometry | null, rng: {
23
+ next(): number;
24
+ signed(): number;
25
+ }): void;
26
+ }
27
+ //# sourceMappingURL=IEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEmitter.d.ts","sourceRoot":"","sources":["../src/IEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEpC;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,8EAA8E;IAC9E,aAAa,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,EAAE,GAAG,EAAE;QAAE,IAAI,IAAI,MAAM,CAAC;QAAC,MAAM,IAAI,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAC1J"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEmitter.js","sourceRoot":"","sources":["../src/IEmitter.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import type { Vector3 } from 'three';
2
+ /**
3
+ * IForce — the contract every st-particle-core force field fulfils.
4
+ *
5
+ * Forces accumulate acceleration onto each alive particle each step.
6
+ * They receive the particle's current state and the timestep.
7
+ *
8
+ * @example
9
+ * // A custom upward wind force compatible with ParticleSystem:
10
+ * const wind: IForce = {
11
+ * parameters: { strength: 2.0 },
12
+ * enabled: true,
13
+ * apply: (pos, vel, acc, dt) => { acc.y += 2.0 },
14
+ * }
15
+ */
16
+ export interface IForce {
17
+ parameters: Record<string, number>;
18
+ enabled: boolean;
19
+ /**
20
+ * Accumulate acceleration for one particle.
21
+ * @param position Current world-space position (read-only)
22
+ * @param velocity Current velocity (read-only)
23
+ * @param acc Accumulator — ADD to this, never set it directly
24
+ * @param dt Timestep in seconds
25
+ */
26
+ apply(position: Vector3, velocity: Vector3, acc: Vector3, dt: number): void;
27
+ }
28
+ //# sourceMappingURL=IForce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IForce.d.ts","sourceRoot":"","sources":["../src/IForce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEpC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5E"}
package/dist/IForce.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IForce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IForce.js","sourceRoot":"","sources":["../src/IForce.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import type { BufferGeometry } from 'three';
2
+ /**
3
+ * IGeometryProvider — a zero-argument callback that returns the current
4
+ * source geometry for a particle emitter or other consumer.
5
+ *
6
+ * This is the bridge between st-modifier-core and st-particle-core without
7
+ * either package importing from the other. The user wires them together:
8
+ *
9
+ * @example
10
+ * const stack = new ModifierStack(baseGeo)
11
+ * stack.add(new SubdivisionModifier({ levels: 2 }))
12
+ *
13
+ * const provider: IGeometryProvider = () => stack.apply()
14
+ * particleSystem.setGeometryProvider(provider)
15
+ *
16
+ * // Each update() call will emit from the subdivided surface.
17
+ */
18
+ export type IGeometryProvider = () => BufferGeometry;
19
+ //# sourceMappingURL=IGeometryProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IGeometryProvider.d.ts","sourceRoot":"","sources":["../src/IGeometryProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,cAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IGeometryProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IGeometryProvider.js","sourceRoot":"","sources":["../src/IGeometryProvider.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * IKeyframeTarget — any plain object whose numeric properties can be driven
3
+ * by KeyframeTrack or QuaternionTrack from st-keyframe.
4
+ *
5
+ * In practice this is always the `.parameters` object of an IAnimatable,
6
+ * but it can also be any other record of numbers — e.g. a camera's uniforms,
7
+ * a custom simulation state, or a UI value.
8
+ *
9
+ * @example
10
+ * const target: IKeyframeTarget = { opacity: 1, scale: 1 }
11
+ * const track = new KeyframeTrack(target, 'opacity', [
12
+ * { time: 0, value: 0 },
13
+ * { time: 1, value: 1, easing: easeInOutSine },
14
+ * ])
15
+ */
16
+ export type IKeyframeTarget = Record<string, number>;
17
+ //# sourceMappingURL=IKeyframeTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IKeyframeTarget.d.ts","sourceRoot":"","sources":["../src/IKeyframeTarget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IKeyframeTarget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IKeyframeTarget.js","sourceRoot":"","sources":["../src/IKeyframeTarget.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import type { BufferGeometry } from 'three';
2
+ /**
3
+ * IModifier — the contract every st-modifier-core modifier fulfils.
4
+ *
5
+ * Modifiers are non-destructive: `apply()` always returns a NEW
6
+ * BufferGeometry and never mutates the input. They can be toggled with
7
+ * `enabled` and stacked via ModifierStack.
8
+ *
9
+ * @example
10
+ * function applyAll(geo: BufferGeometry, mods: IModifier[]): BufferGeometry {
11
+ * return mods.filter(m => m.enabled).reduce((g, m) => m.apply(g), geo)
12
+ * }
13
+ */
14
+ export interface IModifier {
15
+ /** Human-readable name matching Blender's modifier name. */
16
+ readonly name: string;
17
+ /** When false the modifier passes geometry through unchanged. */
18
+ enabled: boolean;
19
+ /** All scalar parameters — GSAP / st-keyframe compatible. */
20
+ parameters: Record<string, number>;
21
+ /**
22
+ * Apply this modifier to the input geometry.
23
+ * Never mutates the input — always returns a new BufferGeometry.
24
+ */
25
+ apply(geometry: BufferGeometry): BufferGeometry;
26
+ }
27
+ //# sourceMappingURL=IModifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IModifier.d.ts","sourceRoot":"","sources":["../src/IModifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAA;IAChB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAAA;CAChD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IModifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IModifier.js","sourceRoot":"","sources":["../src/IModifier.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import type { Vector3, Quaternion } from 'three';
2
+ /**
3
+ * IParticleLike — the minimal shape of a particle in the pool.
4
+ * Used by forces, renderers, and anything that reads the live particle state
5
+ * without importing the concrete Particle class from st-particle-core.
6
+ */
7
+ export interface IParticleLike {
8
+ alive: boolean;
9
+ position: Vector3;
10
+ velocity: Vector3;
11
+ size: number;
12
+ /** Normalised lifetime progress: 0 at birth → 1 at death. */
13
+ normalised: number;
14
+ /** Age in seconds since birth. */
15
+ age: number;
16
+ rotation: Quaternion;
17
+ angularVel: Vector3;
18
+ }
19
+ /**
20
+ * IParticlePool — the live particle array exposed by ParticleSystem.
21
+ * BoidField, FlowFieldForce and other cross-system forces accept this
22
+ * instead of a concrete ParticleSystem to avoid coupling.
23
+ *
24
+ * @example
25
+ * // Wire two particle systems together via pool reference:
26
+ * const field = new BoidField(predatorSystem.pool as IParticlePool)
27
+ * preySystem.addForce(field)
28
+ */
29
+ export type IParticlePool = IParticleLike[];
30
+ //# sourceMappingURL=IParticlePool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IParticlePool.d.ts","sourceRoot":"","sources":["../src/IParticlePool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEhD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAO,OAAO,CAAA;IACnB,QAAQ,EAAI,OAAO,CAAA;IACnB,QAAQ,EAAI,OAAO,CAAA;IACnB,IAAI,EAAQ,MAAM,CAAA;IAClB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,GAAG,EAAS,MAAM,CAAA;IAClB,QAAQ,EAAI,UAAU,CAAA;IACtB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IParticlePool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IParticlePool.js","sourceRoot":"","sources":["../src/IParticlePool.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import type { Matrix4, Quaternion } from 'three';
2
+ /**
3
+ * IPoseBone — the minimal interface for a pose bone in st-animation-core.
4
+ *
5
+ * Use this when bone constraints or external animation systems need to
6
+ * read/write bone transform without importing the concrete PoseBone class.
7
+ */
8
+ export interface IPoseBone {
9
+ readonly name: string;
10
+ parameters: {
11
+ locationX: number;
12
+ locationY: number;
13
+ locationZ: number;
14
+ rotationX: number;
15
+ rotationY: number;
16
+ rotationZ: number;
17
+ scaleX: number;
18
+ scaleY: number;
19
+ scaleZ: number;
20
+ };
21
+ worldMatrix: Matrix4;
22
+ localMatrix: Matrix4;
23
+ setQuaternion(q: Quaternion): void;
24
+ getQuaternion(out?: Quaternion): Quaternion;
25
+ }
26
+ //# sourceMappingURL=IPoseBone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPoseBone.d.ts","sourceRoot":"","sources":["../src/IPoseBone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE;QACV,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;QACvD,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;QACvD,MAAM,EAAK,MAAM,CAAC;QAAC,MAAM,EAAK,MAAM,CAAC;QAAC,MAAM,EAAK,MAAM,CAAA;KACxD,CAAA;IACD,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IAClC,aAAa,CAAC,GAAG,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;CAC5C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IPoseBone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPoseBone.js","sourceRoot":"","sources":["../src/IPoseBone.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import type { Object3D } from 'three';
2
+ import type { IParticleLike } from './IParticlePool.js';
3
+ /**
4
+ * IRenderer — the contract every st-particle-core renderer fulfils.
5
+ *
6
+ * Renderers translate the particle pool into a Three.js Object3D each frame.
7
+ * The object is added to the scene once; update() refreshes its geometry/attributes.
8
+ */
9
+ export interface IRenderer {
10
+ /** The Three.js object to add to the scene. Add once; never remove and re-add. */
11
+ readonly object3D: Object3D;
12
+ parameters: Record<string, number>;
13
+ /**
14
+ * Refresh the rendered output from the current particle pool.
15
+ * Called by ParticleSystem.update() after physics integration.
16
+ */
17
+ update(particles: IParticleLike[], aliveCount: number, params?: Record<string, number>, childRng?: {
18
+ next(): number;
19
+ signed(): number;
20
+ }): void;
21
+ dispose(): void;
22
+ }
23
+ //# sourceMappingURL=IRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRenderer.d.ts","sourceRoot":"","sources":["../src/IRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC;;;OAGG;IACH,MAAM,CACJ,SAAS,EAAG,aAAa,EAAE,EAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,QAAQ,CAAC,EAAG;QAAE,IAAI,IAAI,MAAM,CAAC;QAAC,MAAM,IAAI,MAAM,CAAA;KAAE,GAC/C,IAAI,CAAA;IACP,OAAO,IAAI,IAAI,CAAA;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRenderer.js","sourceRoot":"","sources":["../src/IRenderer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import type { Vector3, Quaternion } from 'three';
2
+ /**
3
+ * IRigidBody — the minimal readable interface for a rigid body in
4
+ * st-physics-core's RigidBodyWorld.
5
+ *
6
+ * Use this when a force field or constraint needs to read body state
7
+ * without importing the concrete RigidBody class.
8
+ */
9
+ export interface IRigidBody {
10
+ position: Vector3;
11
+ velocity: Vector3;
12
+ orientation: Quaternion;
13
+ angularVel: Vector3;
14
+ isStatic: boolean;
15
+ parameters: {
16
+ mass: number;
17
+ linearDamping: number;
18
+ angularDamping: number;
19
+ restitution: number;
20
+ };
21
+ }
22
+ //# sourceMappingURL=IRigidBody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRigidBody.d.ts","sourceRoot":"","sources":["../src/IRigidBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAK,OAAO,CAAA;IACpB,QAAQ,EAAK,OAAO,CAAA;IACpB,WAAW,EAAE,UAAU,CAAA;IACvB,UAAU,EAAG,OAAO,CAAA;IACpB,QAAQ,EAAK,OAAO,CAAA;IACpB,UAAU,EAAE;QACV,IAAI,EAAY,MAAM,CAAA;QACtB,aAAa,EAAG,MAAM,CAAA;QACtB,cAAc,EAAE,MAAM,CAAA;QACtB,WAAW,EAAK,MAAM,CAAA;KACvB,CAAA;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IRigidBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRigidBody.js","sourceRoot":"","sources":["../src/IRigidBody.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import type { ShaderMaterial } from 'three';
2
+ /**
3
+ * IShaderNode — the minimal interface shared by all st-shader-core nodes.
4
+ *
5
+ * Nodes compile to GLSL functions. Terminal nodes (MaterialOutput) also
6
+ * expose compile() which produces the final ShaderMaterial.
7
+ *
8
+ * Use this when writing utilities that accept any node without importing
9
+ * the concrete ShaderNode class from st-shader-core.
10
+ */
11
+ export interface IShaderNode {
12
+ /** Unique stable ID for this node instance. */
13
+ readonly id: string;
14
+ /** Node type name matching Blender's node name. */
15
+ readonly nodeType: string;
16
+ /** All scalar parameters — GSAP / st-keyframe compatible. */
17
+ parameters: Record<string, number | [number, number, number]>;
18
+ }
19
+ /**
20
+ * IOutputNode — a terminal node that can compile to a ShaderMaterial.
21
+ * Implemented by MaterialOutput.
22
+ */
23
+ export interface IOutputNode extends IShaderNode {
24
+ material: ShaderMaterial | null;
25
+ compile(): ShaderMaterial;
26
+ }
27
+ //# sourceMappingURL=IShaderNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IShaderNode.d.ts","sourceRoot":"","sources":["../src/IShaderNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC9D;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IAC/B,OAAO,IAAI,cAAc,CAAA;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IShaderNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IShaderNode.js","sourceRoot":"","sources":["../src/IShaderNode.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * IStrand — a single hair or fur strand: an ordered list of world-space
3
+ * control points from root to tip.
4
+ *
5
+ * Used by st-hair-core (HairSystem, HairDynamics, StrandGenerator) and any
6
+ * code that generates or consumes strand geometry without importing st-hair-core.
7
+ *
8
+ * @example
9
+ * const strand: IStrand = {
10
+ * points: [[0,0,0], [0,0.3,0], [0.1,0.6,0], [0.2,1.0,0]],
11
+ * normal: [0, 0, 1],
12
+ * width: 0.8,
13
+ * }
14
+ */
15
+ export interface IStrand {
16
+ /** World-space control points [x,y,z], root first. Minimum 2. */
17
+ points: [number, number, number][];
18
+ /** Root surface normal — used to orient ribbons and for physics. */
19
+ normal?: [number, number, number];
20
+ /** Per-strand width multiplier [0..1]. */
21
+ width?: number;
22
+ }
23
+ //# sourceMappingURL=IStrand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IStrand.d.ts","sourceRoot":"","sources":["../src/IStrand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,OAAO;IACtB,iEAAiE;IACjE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;IAClC,oEAAoE;IACpE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IStrand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IStrand.js","sourceRoot":"","sources":["../src/IStrand.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @st-core-types — Shared TypeScript interfaces for the st- ecosystem.
3
+ *
4
+ * All packages communicate only through Three.js primitives (BufferGeometry,
5
+ * Material, Texture). These interfaces describe the shapes of objects passed
6
+ * at those boundaries, letting user code stay type-safe without any package
7
+ * importing from another package.
8
+ *
9
+ * Import only what you need — all types are pure interfaces (no runtime code).
10
+ */
11
+ export type { IAnimatable } from './IAnimatable.js';
12
+ export type { IModifier } from './IModifier.js';
13
+ export type { IGeometryProvider } from './IGeometryProvider.js';
14
+ export type { ICurve } from './ICurve.js';
15
+ export type { IStrand } from './IStrand.js';
16
+ export type { IEmitter } from './IEmitter.js';
17
+ export type { IForce } from './IForce.js';
18
+ export type { IParticleLike } from './IParticlePool.js';
19
+ export type { IParticlePool } from './IParticlePool.js';
20
+ export type { IRenderer } from './IRenderer.js';
21
+ export type { IKeyframeTarget } from './IKeyframeTarget.js';
22
+ export type { IShaderNode } from './IShaderNode.js';
23
+ export type { ICollider } from './ICollider.js';
24
+ export type { IConstraint } from './IConstraint.js';
25
+ export type { IRigidBody } from './IRigidBody.js';
26
+ export type { IPoseBone } from './IPoseBone.js';
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAa,kBAAkB,CAAA;AAC1D,YAAY,EAAE,SAAS,EAAE,MAAe,gBAAgB,CAAA;AACxD,YAAY,EAAE,iBAAiB,EAAE,MAAO,wBAAwB,CAAA;AAChE,YAAY,EAAE,MAAM,EAAE,MAAkB,aAAa,CAAA;AACrD,YAAY,EAAE,OAAO,EAAE,MAAiB,cAAc,CAAA;AACtD,YAAY,EAAE,QAAQ,EAAE,MAAgB,eAAe,CAAA;AACvD,YAAY,EAAE,MAAM,EAAE,MAAkB,aAAa,CAAA;AACrD,YAAY,EAAE,aAAa,EAAE,MAAW,oBAAoB,CAAA;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAW,oBAAoB,CAAA;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAe,gBAAgB,CAAA;AACxD,YAAY,EAAE,eAAe,EAAE,MAAS,sBAAsB,CAAA;AAC9D,YAAY,EAAE,WAAW,EAAE,MAAa,kBAAkB,CAAA;AAC1D,YAAY,EAAE,SAAS,EAAE,MAAe,gBAAgB,CAAA;AACxD,YAAY,EAAE,WAAW,EAAE,MAAa,kBAAkB,CAAA;AAC1D,YAAY,EAAE,UAAU,EAAE,MAAc,iBAAiB,CAAA;AACzD,YAAY,EAAE,SAAS,EAAE,MAAe,gBAAgB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @st-core-types — Shared TypeScript interfaces for the st- ecosystem.
3
+ *
4
+ * All packages communicate only through Three.js primitives (BufferGeometry,
5
+ * Material, Texture). These interfaces describe the shapes of objects passed
6
+ * at those boundaries, letting user code stay type-safe without any package
7
+ * importing from another package.
8
+ *
9
+ * Import only what you need — all types are pure interfaces (no runtime code).
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@triforge/core-types",
3
+ "version": "0.1.0",
4
+ "description": "Shared TypeScript interfaces for the st- Three.js ecosystem",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "package.json"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc",
20
+ "test": "node test/run-tests.js"
21
+ },
22
+ "devDependencies": {
23
+ "@types/three": "^0.165.0",
24
+ "three": "^0.165.0",
25
+ "typescript": "^5.3.0"
26
+ },
27
+ "peerDependencies": {
28
+ "three": ">=0.159.0"
29
+ },
30
+ "license": "MIT",
31
+ "author": "Aftab Ibrahim Kazi",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/AftabIbrahimKazi/triforge.git",
35
+ "directory": "st-core-types"
36
+ },
37
+ "homepage": "https://github.com/AftabIbrahimKazi/triforge#readme",
38
+ "publishConfig": {
39
+ "access": "public"
40
+ }
41
+ }