@wandelbots/wandelbots-js-react-components 2.26.0-pr.feature-update-to-react-19.361.c3fd41e → 2.26.0-pr.feature-update-to-react-19.361.1e3686f

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.
@@ -59,32 +59,46 @@ export declare class ValueInterpolator {
59
59
  private targetUpdateTime;
60
60
  private animationId;
61
61
  private options;
62
+ private updateCount;
62
63
  private velocities;
63
64
  constructor(initialValues?: number[], options?: InterpolationOptions);
64
65
  /**
65
- * Update interpolation using spring physics (call this in useFrame for frame-rate independence)
66
- * @param delta - Frame delta time for smooth animation
66
+ * Update interpolation using spring physics
67
+ *
68
+ * Call this method every frame for smooth animation. In React Three Fiber,
69
+ * call from within useFrame callback with the provided delta time.
70
+ *
71
+ * @param delta - Time elapsed since last update in seconds (e.g., 1/60 ≈ 0.0167 for 60fps)
72
+ * @returns true when interpolation is complete (all values reached their targets)
67
73
  */
68
74
  update(delta?: number): boolean;
69
75
  /**
70
- * Set new target values to interpolate towards
71
- * Handles irregular target updates smoothly by considering update frequency
76
+ * Set new target values for the interpolation to move towards
77
+ *
78
+ * Includes smart blending for very rapid target updates (faster than 120fps)
79
+ * to prevent jarring movements when targets change frequently.
72
80
  */
73
81
  setTarget(newValues: number[]): void;
74
82
  /**
75
- * Get the current interpolated values
83
+ * Get a copy of all current interpolated values
76
84
  */
77
85
  getCurrentValues(): number[];
78
86
  /**
79
- * Get a specific interpolated value by index
87
+ * Get a single interpolated value by its array index
80
88
  */
81
89
  getValue(index: number): number;
82
90
  /**
83
- * Check if interpolation is currently active
91
+ * Check if automatic interpolation is currently running
92
+ *
93
+ * This only tracks auto-interpolation started with startAutoInterpolation().
94
+ * Manual update() calls are not tracked by this method.
84
95
  */
85
96
  isInterpolating(): boolean;
86
97
  /**
87
- * Stop the current interpolation
98
+ * Stop automatic interpolation if it's running
99
+ *
100
+ * This cancels the internal animation frame loop but does not affect
101
+ * manual update() calls.
88
102
  */
89
103
  stop(): void;
90
104
  /**
@@ -96,11 +110,18 @@ export declare class ValueInterpolator {
96
110
  */
97
111
  updateOptions(newOptions: Partial<InterpolationOptions>): void;
98
112
  /**
99
- * Start automatic interpolation (use when not calling update() manually)
113
+ * Start automatic interpolation with an animation loop
114
+ *
115
+ * This begins a requestAnimationFrame loop that calls update() automatically.
116
+ * For React Three Fiber components, prefer using manual update() calls
117
+ * within useFrame hooks instead.
100
118
  */
101
119
  startAutoInterpolation(): void;
102
120
  /**
103
- * Destroy the interpolator and clean up resources
121
+ * Clean up all resources and stop any running animations
122
+ *
123
+ * This cancels any active animation frames and resets internal state.
124
+ * Call this when the component unmounts or is no longer needed.
104
125
  */
105
126
  destroy(): void;
106
127
  private startInterpolation;
@@ -1 +1 @@
1
- {"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../../../src/components/utils/interpolation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACrC,wDAAwD;IACxD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACxC;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,oBAAoB,CAAe;IAC3C,OAAO,CAAC,gBAAgB,CAAY;IACpC,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,OAAO,CAAgC;IAG/C,OAAO,CAAC,UAAU,CAAe;gBAG/B,aAAa,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