@types/three 0.174.0 → 0.176.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 (102) hide show
  1. three/README.md +2 -2
  2. three/examples/jsm/Addons.d.ts +1 -1
  3. three/examples/jsm/controls/PointerLockControls.d.ts +4 -1
  4. three/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
  5. three/examples/jsm/helpers/RapierHelper.d.ts +13 -0
  6. three/examples/jsm/interactive/HTMLMesh.d.ts +9 -2
  7. three/examples/jsm/loaders/LUTImageLoader.d.ts +2 -2
  8. three/examples/jsm/loaders/LottieLoader.d.ts +4 -0
  9. three/examples/jsm/misc/MD2CharacterComplex.d.ts +1 -1
  10. three/examples/jsm/physics/RapierPhysics.d.ts +12 -0
  11. three/examples/jsm/postprocessing/BokehPass.d.ts +2 -2
  12. three/examples/jsm/postprocessing/HalftonePass.d.ts +1 -1
  13. three/examples/jsm/postprocessing/LUTPass.d.ts +1 -1
  14. three/examples/jsm/postprocessing/SMAAPass.d.ts +1 -1
  15. three/examples/jsm/transpiler/AST.d.ts +218 -1
  16. three/examples/jsm/transpiler/TSLEncoder.d.ts +35 -1
  17. three/examples/jsm/tsl/shadows/TileShadowNode.d.ts +14 -0
  18. three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts +14 -0
  19. three/examples/jsm/webxr/VRButton.d.ts +4 -2
  20. three/package.json +4 -3
  21. three/src/Three.Core.d.ts +2 -0
  22. three/src/Three.TSL.d.ts +11 -1
  23. three/src/animation/AnimationAction.d.ts +219 -19
  24. three/src/animation/AnimationClip.d.ts +140 -28
  25. three/src/animation/AnimationMixer.d.ts +100 -8
  26. three/src/animation/AnimationObjectGroup.d.ts +55 -14
  27. three/src/animation/AnimationUtils.d.ts +154 -43
  28. three/src/animation/KeyframeTrack.d.ts +134 -25
  29. three/src/animation/PropertyBinding.d.ts +89 -31
  30. three/src/animation/PropertyMixer.d.ts +62 -5
  31. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +12 -4
  32. three/src/animation/tracks/ColorKeyframeTrack.d.ts +10 -4
  33. three/src/animation/tracks/NumberKeyframeTrack.d.ts +10 -4
  34. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +10 -4
  35. three/src/animation/tracks/StringKeyframeTrack.d.ts +12 -4
  36. three/src/animation/tracks/VectorKeyframeTrack.d.ts +10 -4
  37. three/src/audio/AudioListener.d.ts +1 -1
  38. three/src/cameras/ArrayCamera.d.ts +5 -0
  39. three/src/constants.d.ts +18 -17
  40. three/src/core/BufferAttribute.d.ts +11 -0
  41. three/src/core/BufferGeometry.d.ts +1 -3
  42. three/src/core/RenderTarget.d.ts +9 -0
  43. three/src/extras/Controls.d.ts +1 -1
  44. three/src/extras/Earcut.d.ts +5 -3
  45. three/src/extras/ImageUtils.d.ts +1 -0
  46. three/src/geometries/CapsuleGeometry.d.ts +10 -3
  47. three/src/lights/LightShadow.d.ts +8 -0
  48. three/src/lights/PointLight.d.ts +1 -1
  49. three/src/loaders/FileLoader.d.ts +2 -2
  50. three/src/loaders/LoaderUtils.d.ts +0 -5
  51. three/src/materials/Material.d.ts +6 -8
  52. three/src/materials/ShaderMaterial.d.ts +1 -1
  53. three/src/materials/nodes/NodeMaterial.d.ts +10 -2
  54. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +8 -0
  55. three/src/math/FrustumArray.d.ts +27 -0
  56. three/src/nodes/Nodes.d.ts +1 -0
  57. three/src/nodes/TSL.d.ts +1 -0
  58. three/src/nodes/accessors/BufferAttributeNode.d.ts +11 -4
  59. three/src/nodes/accessors/InstanceNode.d.ts +2 -3
  60. three/src/nodes/accessors/Object3DNode.d.ts +6 -6
  61. three/src/nodes/accessors/SkinningNode.d.ts +4 -3
  62. three/src/nodes/accessors/StorageTextureNode.d.ts +2 -2
  63. three/src/nodes/accessors/TextureNode.d.ts +3 -1
  64. three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
  65. three/src/nodes/code/ExpressionNode.d.ts +3 -2
  66. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  67. three/src/nodes/code/ScriptableValueNode.d.ts +1 -1
  68. three/src/nodes/core/Node.d.ts +8 -5
  69. three/src/nodes/core/NodeVarying.d.ts +11 -1
  70. three/src/nodes/core/StackNode.d.ts +7 -1
  71. three/src/nodes/core/StructTypeNode.d.ts +1 -1
  72. three/src/nodes/core/VaryingNode.d.ts +6 -0
  73. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +3 -14
  74. three/src/nodes/lighting/ShadowFilterNode.d.ts +28 -0
  75. three/src/nodes/lighting/ShadowNode.d.ts +26 -24
  76. three/src/nodes/math/ConditionalNode.d.ts +4 -4
  77. three/src/nodes/math/MathNode.d.ts +20 -12
  78. three/src/nodes/math/OperatorNode.d.ts +65 -25
  79. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  80. three/src/nodes/tsl/TSLCore.d.ts +34 -26
  81. three/src/nodes/utils/DebugNode.d.ts +21 -0
  82. three/src/nodes/utils/ReflectorNode.d.ts +1 -1
  83. three/src/nodes/utils/SpriteSheetUVNode.d.ts +2 -2
  84. three/src/renderers/common/Animation.d.ts +4 -4
  85. three/src/renderers/common/Attributes.d.ts +1 -1
  86. three/src/renderers/common/Color4.d.ts +1 -1
  87. three/src/renderers/common/CubeRenderTarget.d.ts +6 -0
  88. three/src/renderers/common/RenderList.d.ts +2 -2
  89. three/src/renderers/common/RenderObject.d.ts +1 -1
  90. three/src/renderers/common/RenderObjects.d.ts +2 -2
  91. three/src/renderers/common/Renderer.d.ts +55 -27
  92. three/src/renderers/common/Textures.d.ts +0 -7
  93. three/src/renderers/common/TimestampQueryPool.d.ts +1 -0
  94. three/src/renderers/common/XRManager.d.ts +79 -4
  95. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
  96. three/src/renderers/webgpu/WebGPUBackend.d.ts +1 -0
  97. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
  98. three/src/textures/CanvasTexture.d.ts +1 -1
  99. three/src/textures/DepthArrayTexture.d.ts +14 -0
  100. three/src/textures/Texture.d.ts +8 -1
  101. three/src/textures/VideoFrameTexture.d.ts +1 -1
  102. three/examples/jsm/geometries/ParametricGeometries.d.ts +0 -32
@@ -1,17 +1,58 @@
1
- export class AnimationObjectGroup {
2
- constructor(...args: any[]);
1
+ import { Object3D } from "../core/Object3D.js";
3
2
 
4
- uuid: string;
5
- stats: {
6
- bindingsPerObject: number;
7
- objects: {
8
- total: number;
9
- inUse: number;
10
- };
11
- };
3
+ /**
4
+ * A group of objects that receives a shared animation state.
5
+ *
6
+ * Usage:
7
+ *
8
+ * - Add objects you would otherwise pass as 'root' to the
9
+ * constructor or the .clipAction method of AnimationMixer.
10
+ * - Instead pass this object as 'root'.
11
+ * - You can also add and remove objects later when the mixer is running.
12
+ *
13
+ * Note:
14
+ *
15
+ * - Objects of this class appear as one object to the mixer,
16
+ * so cache control of the individual objects must be done on the group.
17
+ *
18
+ * Limitation:
19
+ *
20
+ * - The animated properties must be compatible among the all objects in the group.
21
+ * - A single property can either be controlled through a target group or directly, but not both.
22
+ */
23
+ export class AnimationObjectGroup {
24
+ /**
25
+ * Constructs a new animation group.
26
+ *
27
+ * @param {...Object3D} arguments - An arbitrary number of 3D objects that share the same animation state.
28
+ */
29
+ constructor(...args: Object3D[]);
30
+ /**
31
+ * This flag can be used for type testing.
32
+ *
33
+ * @default true
34
+ */
12
35
  readonly isAnimationObjectGroup: true;
13
-
14
- add(...args: any[]): void;
15
- remove(...args: any[]): void;
16
- uncache(...args: any[]): void;
36
+ /**
37
+ * The UUID of the 3D object.
38
+ */
39
+ readonly uuid: string;
40
+ /**
41
+ * Adds an arbitrary number of objects to this animation group.
42
+ *
43
+ * @param {...Object3D} arguments - The 3D objects to add.
44
+ */
45
+ add(...args: Object3D[]): void;
46
+ /**
47
+ * Removes an arbitrary number of objects to this animation group
48
+ *
49
+ * @param {...Object3D} arguments - The 3D objects to remove.
50
+ */
51
+ remove(...args: Object3D[]): void;
52
+ /**
53
+ * Deallocates all memory resources for the passed 3D objects of this animation group.
54
+ *
55
+ * @param {...Object3D} arguments - The 3D objects to uncache.
56
+ */
57
+ uncache(...args: Object3D[]): void;
17
58
  }
@@ -1,60 +1,171 @@
1
+ import { TypedArray, TypedArrayConstructor } from "../core/BufferAttribute.js";
1
2
  import { AnimationClip } from "./AnimationClip.js";
2
3
 
3
- declare function convertArray(array: any, type: any, forceClone: boolean): any;
4
-
5
- declare function isTypedArray(object: any): boolean;
6
-
7
- declare function getKeyframeOrder(times: number[]): number[];
8
-
9
- declare function sortedArray(values: any[], stride: number, order: number[]): any[];
10
-
11
- declare function flattenJSON(jsonKeys: string[], times: any[], values: any[], valuePropertyName: string): void;
12
-
13
4
  /**
14
- * @param sourceClip
15
- * @param name
16
- * @param startFrame
17
- * @param endFrame
18
- * @param [fps=30]
5
+ * Converts an array to a specific type.
6
+ *
7
+ * @param {TypedArray|Array} array - The array to convert.
8
+ * @param {TypedArray.constructor} type - The constructor of a typed array that defines the new type.
9
+ * @return {TypedArray} The converted array.
10
+ */
11
+ export function convertArray(array: TypedArray | number[], type: TypedArrayConstructor): TypedArray | number[];
12
+ /**
13
+ * Returns `true` if the given object is a typed array.
14
+ *
15
+ * @param {any} object - The object to check.
16
+ * @return {boolean} Whether the given object is a typed array.
17
+ */
18
+ export function isTypedArray(object: unknown): boolean;
19
+ /**
20
+ * Returns an array by which times and values can be sorted.
21
+ *
22
+ * @param {Array<number>} times - The keyframe time values.
23
+ * @return {Array<number>} The array.
24
+ */
25
+ export function getKeyframeOrder(times: Array<number>): Array<number>;
26
+ /**
27
+ * Sorts the given array by the previously computed order via `getKeyframeOrder()`.
28
+ *
29
+ * @param {Array<number>} values - The values to sort.
30
+ * @param {number} stride - The stride.
31
+ * @param {Array<number>} order - The sort order.
32
+ * @return {Array<number>} The sorted values.
33
+ */
34
+ export function sortedArray(values: Array<number>, stride: number, order: Array<number>): Array<number>;
35
+ /**
36
+ * Used for parsing AOS keyframe formats.
37
+ *
38
+ * @param {Array<number>} jsonKeys - A list of JSON keyframes.
39
+ * @param {Array<number>} times - This array will be filled with keyframe times by this function.
40
+ * @param {Array<number>} values - This array will be filled with keyframe values by this function.
41
+ * @param {string} valuePropertyName - The name of the property to use.
42
+ */
43
+ export function flattenJSON(
44
+ jsonKeys: Array<number>,
45
+ times: Array<number>,
46
+ values: Array<number>,
47
+ valuePropertyName: string,
48
+ ): void;
49
+ /**
50
+ * Creates a new clip, containing only the segment of the original clip between the given frames.
51
+ *
52
+ * @param {AnimationClip} sourceClip - The values to sort.
53
+ * @param {string} name - The name of the clip.
54
+ * @param {number} startFrame - The start frame.
55
+ * @param {number} endFrame - The end frame.
56
+ * @param {number} [fps=30] - The FPS.
57
+ * @return {AnimationClip} The new sub clip.
19
58
  */
20
- declare function subclip(
59
+ export function subclip(
21
60
  sourceClip: AnimationClip,
22
61
  name: string,
23
62
  startFrame: number,
24
63
  endFrame: number,
25
64
  fps?: number,
26
65
  ): AnimationClip;
27
-
28
66
  /**
29
- * @param targetClip
30
- * @param [referenceFrame=0]
31
- * @param [referenceClip=targetClip]
32
- * @param [fps=30]
67
+ * Converts the keyframes of the given animation clip to an additive format.
68
+ *
69
+ * @param {AnimationClip} targetClip - The clip to make additive.
70
+ * @param {number} [referenceFrame=0] - The reference frame.
71
+ * @param {AnimationClip} [referenceClip=targetClip] - The reference clip.
72
+ * @param {number} [fps=30] - The FPS.
73
+ * @return {AnimationClip} The updated clip which is now additive.
33
74
  */
34
- declare function makeClipAdditive(
75
+ export function makeClipAdditive(
35
76
  targetClip: AnimationClip,
36
77
  referenceFrame?: number,
37
78
  referenceClip?: AnimationClip,
38
79
  fps?: number,
39
80
  ): AnimationClip;
40
-
41
- declare const AnimationUtils: {
42
- convertArray: typeof convertArray;
43
- isTypedArray: typeof isTypedArray;
44
- getKeyframeOrder: typeof getKeyframeOrder;
45
- sortedArray: typeof sortedArray;
46
- flattenJSON: typeof flattenJSON;
47
- subclip: typeof subclip;
48
- makeClipAdditive: typeof makeClipAdditive;
49
- };
50
-
51
- export {
52
- AnimationUtils,
53
- convertArray,
54
- flattenJSON,
55
- getKeyframeOrder,
56
- isTypedArray,
57
- makeClipAdditive,
58
- sortedArray,
59
- subclip,
60
- };
81
+ /**
82
+ * A class with various methods to assist with animations.
83
+ *
84
+ * @hideconstructor
85
+ */
86
+ export class AnimationUtils {
87
+ /**
88
+ * Converts an array to a specific type
89
+ *
90
+ * @static
91
+ * @param {TypedArray|Array} array - The array to convert.
92
+ * @param {TypedArray.constructor} type - The constructor of a type array.
93
+ * @return {TypedArray} The converted array
94
+ */
95
+ static convertArray(array: TypedArray | number[], type: TypedArrayConstructor): TypedArray | number[];
96
+ /**
97
+ * Returns `true` if the given object is a typed array.
98
+ *
99
+ * @static
100
+ * @param {any} object - The object to check.
101
+ * @return {boolean} Whether the given object is a typed array.
102
+ */
103
+ static isTypedArray(object: unknown): boolean;
104
+ /**
105
+ * Returns an array by which times and values can be sorted.
106
+ *
107
+ * @static
108
+ * @param {Array<number>} times - The keyframe time values.
109
+ * @return {Array<number>} The array.
110
+ */
111
+ static getKeyframeOrder(times: Array<number>): Array<number>;
112
+ /**
113
+ * Sorts the given array by the previously computed order via `getKeyframeOrder()`.
114
+ *
115
+ * @static
116
+ * @param {Array<number>} values - The values to sort.
117
+ * @param {number} stride - The stride.
118
+ * @param {Array<number>} order - The sort order.
119
+ * @return {Array<number>} The sorted values.
120
+ */
121
+ static sortedArray(values: Array<number>, stride: number, order: Array<number>): Array<number>;
122
+ /**
123
+ * Used for parsing AOS keyframe formats.
124
+ *
125
+ * @static
126
+ * @param {Array<number>} jsonKeys - A list of JSON keyframes.
127
+ * @param {Array<number>} times - This array will be filled with keyframe times by this method.
128
+ * @param {Array<number>} values - This array will be filled with keyframe values by this method.
129
+ * @param {string} valuePropertyName - The name of the property to use.
130
+ */
131
+ static flattenJSON(
132
+ jsonKeys: Array<number>,
133
+ times: Array<number>,
134
+ values: Array<number>,
135
+ valuePropertyName: string,
136
+ ): void;
137
+ /**
138
+ * Creates a new clip, containing only the segment of the original clip between the given frames.
139
+ *
140
+ * @static
141
+ * @param {AnimationClip} sourceClip - The values to sort.
142
+ * @param {string} name - The name of the clip.
143
+ * @param {number} startFrame - The start frame.
144
+ * @param {number} endFrame - The end frame.
145
+ * @param {number} [fps=30] - The FPS.
146
+ * @return {AnimationClip} The new sub clip.
147
+ */
148
+ static subclip(
149
+ sourceClip: AnimationClip,
150
+ name: string,
151
+ startFrame: number,
152
+ endFrame: number,
153
+ fps?: number,
154
+ ): AnimationClip;
155
+ /**
156
+ * Converts the keyframes of the given animation clip to an additive format.
157
+ *
158
+ * @static
159
+ * @param {AnimationClip} targetClip - The clip to make additive.
160
+ * @param {number} [referenceFrame=0] - The reference frame.
161
+ * @param {AnimationClip} [referenceClip=targetClip] - The reference clip.
162
+ * @param {number} [fps=30] - The FPS.
163
+ * @return {AnimationClip} The updated clip which is now additive.
164
+ */
165
+ static makeClipAdditive(
166
+ targetClip: AnimationClip,
167
+ referenceFrame?: number,
168
+ referenceClip?: AnimationClip,
169
+ fps?: number,
170
+ ): AnimationClip;
171
+ }
@@ -1,5 +1,5 @@
1
1
  import { InterpolationModes } from "../constants.js";
2
- import { Interpolant } from "../math/Interpolant.js";
2
+ import { TypedArray, TypedArrayConstructor } from "../core/BufferAttribute.js";
3
3
  import { CubicInterpolant } from "../math/interpolants/CubicInterpolant.js";
4
4
  import { DiscreteInterpolant } from "../math/interpolants/DiscreteInterpolant.js";
5
5
  import { LinearInterpolant } from "../math/interpolants/LinearInterpolant.js";
@@ -12,44 +12,153 @@ export interface KeyframeTrackJSON {
12
12
  type: string;
13
13
  }
14
14
 
15
+ /**
16
+ * Represents s a timed sequence of keyframes, which are composed of lists of
17
+ * times and related values, and which are used to animate a specific property
18
+ * of an object.
19
+ */
15
20
  export class KeyframeTrack {
16
21
  /**
17
- * @param name
18
- * @param times
19
- * @param values
20
- * @param [interpolation=THREE.InterpolateLinear]
22
+ * Converts the keyframe track to JSON.
23
+ *
24
+ * @static
25
+ * @param {KeyframeTrack} track - The keyframe track to serialize.
26
+ * @return {Object} The serialized keyframe track as JSON.
27
+ */
28
+ static toJSON(track: KeyframeTrack): KeyframeTrackJSON;
29
+ /**
30
+ * Constructs a new keyframe track.
31
+ *
32
+ * @param {string} name - The keyframe track's name.
33
+ * @param {Array<number>} times - A list of keyframe times.
34
+ * @param {Array<number>} values - A list of keyframe values.
35
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
36
+ */
37
+ constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
38
+ /**
39
+ * The track's name can refer to morph targets or bones or
40
+ * possibly other values within an animated object. See {@link PropertyBinding#parseTrackName}
41
+ * for the forms of strings that can be parsed for property binding.
21
42
  */
22
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>, interpolation?: InterpolationModes);
23
-
24
43
  name: string;
44
+ /**
45
+ * The keyframe times.
46
+ */
25
47
  times: Float32Array;
48
+ /**
49
+ * The keyframe values.
50
+ */
26
51
  values: Float32Array;
27
-
28
- ValueTypeName: string;
29
- TimeBufferType: Float32Array;
30
- ValueBufferType: Float32Array;
31
-
32
52
  /**
33
- * @default THREE.InterpolateLinear
53
+ * Factory method for creating a new discrete interpolant.
54
+ *
55
+ * @static
56
+ * @param {TypedArray} [result] - The result buffer.
57
+ * @return {DiscreteInterpolant} The new interpolant.
58
+ */
59
+ InterpolantFactoryMethodDiscrete(result?: TypedArray): DiscreteInterpolant;
60
+ /**
61
+ * Factory method for creating a new linear interpolant.
62
+ *
63
+ * @static
64
+ * @param {TypedArray} [result] - The result buffer.
65
+ * @return {LinearInterpolant} The new interpolant.
66
+ */
67
+ InterpolantFactoryMethodLinear(result?: TypedArray): LinearInterpolant;
68
+ /**
69
+ * Factory method for creating a new smooth interpolant.
70
+ *
71
+ * @static
72
+ * @param {TypedArray} [result] - The result buffer.
73
+ * @return {CubicInterpolant} The new interpolant.
74
+ */
75
+ InterpolantFactoryMethodSmooth(result?: TypedArray): CubicInterpolant;
76
+ /**
77
+ * Defines the interpolation factor method for this keyframe track.
78
+ *
79
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} interpolation - The interpolation type.
80
+ * @return {KeyframeTrack} A reference to this keyframe track.
34
81
  */
35
- DefaultInterpolation: InterpolationModes;
36
-
37
- InterpolantFactoryMethodDiscrete(result: any): DiscreteInterpolant;
38
- InterpolantFactoryMethodLinear(result: any): LinearInterpolant;
39
- InterpolantFactoryMethodSmooth(result: any): CubicInterpolant;
40
-
41
82
  setInterpolation(interpolation: InterpolationModes): KeyframeTrack;
83
+ /**
84
+ * Returns the current interpolation type.
85
+ *
86
+ * @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} The interpolation type.
87
+ */
42
88
  getInterpolation(): InterpolationModes;
43
- createInterpolant(): Interpolant;
44
-
89
+ /**
90
+ * Returns the value size.
91
+ *
92
+ * @return {number} The value size.
93
+ */
45
94
  getValueSize(): number;
46
-
95
+ /**
96
+ * Moves all keyframes either forward or backward in time.
97
+ *
98
+ * @param {number} timeOffset - The offset to move the time values.
99
+ * @return {KeyframeTrack} A reference to this keyframe track.
100
+ */
47
101
  shift(timeOffset: number): KeyframeTrack;
102
+ /**
103
+ * Scale all keyframe times by a factor (useful for frame - seconds conversions).
104
+ *
105
+ * @param {number} timeScale - The time scale.
106
+ * @return {KeyframeTrack} A reference to this keyframe track.
107
+ */
48
108
  scale(timeScale: number): KeyframeTrack;
109
+ /**
110
+ * Removes keyframes before and after animation without changing any values within the defined time range.
111
+ *
112
+ * Note: The method does not shift around keys to the start of the track time, because for interpolated
113
+ * keys this will change their values
114
+ *
115
+ * @param {number} startTime - The start time.
116
+ * @param {number} endTime - The end time.
117
+ * @return {KeyframeTrack} A reference to this keyframe track.
118
+ */
49
119
  trim(startTime: number, endTime: number): KeyframeTrack;
120
+ /**
121
+ * Performs minimal validation on the keyframe track. Returns `true` if the values
122
+ * are valid.
123
+ *
124
+ * @return {boolean} Whether the keyframes are valid or not.
125
+ */
50
126
  validate(): boolean;
51
- optimize(): KeyframeTrack;
127
+ /**
128
+ * Optimizes this keyframe track by removing equivalent sequential keys (which are
129
+ * common in morph target sequences).
130
+ *
131
+ * @return {AnimationClip} A reference to this animation clip.
132
+ */
133
+ optimize(): this;
134
+ /**
135
+ * Returns a new keyframe track with copied values from this instance.
136
+ *
137
+ * @return {KeyframeTrack} A clone of this instance.
138
+ */
52
139
  clone(): this;
53
-
54
- static toJSON(track: KeyframeTrack): KeyframeTrackJSON;
140
+ /**
141
+ * The value type name.
142
+ *
143
+ * @default ''
144
+ */
145
+ ValueTypeName: string;
146
+ /**
147
+ * The time buffer type of this keyframe track.
148
+ *
149
+ * @default Float32Array.constructor
150
+ */
151
+ TimeBufferType: TypedArrayConstructor | ArrayConstructor;
152
+ /**
153
+ * The value buffer type of this keyframe track.
154
+ *
155
+ * @default Float32Array.constructor
156
+ */
157
+ ValueBufferType: TypedArrayConstructor | ArrayConstructor;
158
+ /**
159
+ * The default interpolation type of this keyframe track.
160
+ *
161
+ * @default InterpolateLinear
162
+ */
163
+ DefaultInterpolation: InterpolationModes;
55
164
  }
@@ -1,3 +1,6 @@
1
+ import { Object3D } from "../core/Object3D.js";
2
+ import { Skeleton } from "../objects/Skeleton.js";
3
+
1
4
  export interface ParseTrackNameResults {
2
5
  nodeName: string;
3
6
  objectName: string;
@@ -6,38 +9,93 @@ export interface ParseTrackNameResults {
6
9
  propertyIndex: string;
7
10
  }
8
11
 
9
- declare class Composite {
10
- constructor(targetGroup: any, path: any, parsedPath?: any);
11
-
12
- getValue(array: any, offset: number): any;
13
- setValue(array: any, offset: number): void;
14
- bind(): void;
15
- unbind(): void;
16
- }
17
-
18
- declare class PropertyBinding {
19
- constructor(rootNode: any, path: string, parsedPath?: any);
20
-
12
+ /**
13
+ * This holds a reference to a real property in the scene graph; used internally.
14
+ */
15
+ export class PropertyBinding {
16
+ /**
17
+ * Factory method for creating a property binding from the given parameters.
18
+ *
19
+ * @static
20
+ * @param {Object} root - The root node.
21
+ * @param {string} path - The path.
22
+ * @param {?Object} [parsedPath] - The parsed path.
23
+ * @return {PropertyBinding|Composite} The created property binding or composite.
24
+ */
25
+ static create(root: object, path: string, parsedPath?: object | null): PropertyBinding | Composite;
26
+ /**
27
+ * Replaces spaces with underscores and removes unsupported characters from
28
+ * node names, to ensure compatibility with parseTrackName().
29
+ *
30
+ * @param {string} name - Node name to be sanitized.
31
+ * @return {string} The sanitized node name.
32
+ */
33
+ static sanitizeNodeName(name: string): string;
34
+ /**
35
+ * Parses the given track name (an object path to an animated property) and
36
+ * returns an object with information about the path. Matches strings in the following forms:
37
+ *
38
+ * - nodeName.property
39
+ * - nodeName.property[accessor]
40
+ * - nodeName.material.property[accessor]
41
+ * - uuid.property[accessor]
42
+ * - uuid.objectName[objectIndex].propertyName[propertyIndex]
43
+ * - parentName/nodeName.property
44
+ * - parentName/parentName/nodeName.property[index]
45
+ * - .bone[Armature.DEF_cog].position
46
+ * - scene:helium_balloon_model:helium_balloon_model.position
47
+ *
48
+ * @static
49
+ * @param {string} trackName - The track name to parse.
50
+ * @return {Object} The parsed track name as an object.
51
+ */
52
+ static parseTrackName(trackName: string): ParseTrackNameResults;
53
+ /**
54
+ * Searches for a node in the hierarchy of the given root object by the given
55
+ * node name.
56
+ *
57
+ * @static
58
+ * @param {Object} root - The root object.
59
+ * @param {string|number} nodeName - The name of the node.
60
+ * @return {?Object} The found node. Returns `null` if no object was found.
61
+ */
62
+ static findNode(root: object, nodeName: string | number): object | null;
63
+ /**
64
+ * Constructs a new property binding.
65
+ *
66
+ * @param {Object} rootNode - The root node.
67
+ * @param {string} path - The path.
68
+ * @param {?Object} [parsedPath] - The parsed path.
69
+ */
70
+ constructor(rootNode: Object3D | Skeleton, path: string, parsedPath?: object | null);
71
+ /**
72
+ * The object path to the animated property.
73
+ */
21
74
  path: string;
22
- parsedPath: any;
23
- node: any;
24
- rootNode: any;
25
-
26
- getValue(targetArray: any, offset: number): any;
27
- setValue(sourceArray: any, offset: number): void;
75
+ /**
76
+ * An object holding information about the path.
77
+ */
78
+ parsedPath: object;
79
+ /**
80
+ * The object owns the animated property.
81
+ */
82
+ node: object | null;
83
+ /**
84
+ * The root node.
85
+ */
86
+ rootNode: Object3D | Skeleton;
87
+ /**
88
+ * Creates a getter / setter pair for the property tracked by this binding.
89
+ */
28
90
  bind(): void;
91
+ /**
92
+ * Unbinds the property.
93
+ */
29
94
  unbind(): void;
30
-
31
- BindingType: { [bindingType: string]: number };
32
- Versioning: { [versioning: string]: number };
33
-
34
- GetterByBindingType: Array<() => void>;
35
- SetterByBindingTypeAndVersioning: Array<Array<() => void>>;
36
-
37
- static create(root: any, path: any, parsedPath?: any): PropertyBinding | Composite;
38
- static sanitizeNodeName(name: string): string;
39
- static parseTrackName(trackName: string): ParseTrackNameResults;
40
- static findNode(root: any, nodeName: string): any;
41
95
  }
42
-
43
- export { PropertyBinding };
96
+ export namespace PropertyBinding {
97
+ export { Composite };
98
+ }
99
+ declare class Composite {
100
+ }
101
+ export {};
@@ -1,17 +1,74 @@
1
- export class PropertyMixer {
2
- constructor(binding: any, typeName: string, valueSize: number);
1
+ import { PropertyBinding } from "./PropertyBinding.js";
3
2
 
4
- binding: any;
3
+ /**
4
+ * Buffered scene graph property that allows weighted accumulation; used internally.
5
+ */
6
+ export class PropertyMixer {
7
+ /**
8
+ * Constructs a new property mixer.
9
+ *
10
+ * @param {PropertyBinding} binding - The property binding.
11
+ * @param {string} typeName - The keyframe track type name.
12
+ * @param {number} valueSize - The keyframe track value size.
13
+ */
14
+ constructor(binding: PropertyBinding, typeName: string, valueSize: number);
15
+ /**
16
+ * The property binding.
17
+ */
18
+ binding: PropertyBinding;
19
+ /**
20
+ * The keyframe track value size.
21
+ */
5
22
  valueSize: number;
6
- buffer: any;
23
+ /**
24
+ * TODO
25
+ *
26
+ * @default 0
27
+ */
7
28
  cumulativeWeight: number;
29
+ /**
30
+ * TODO
31
+ *
32
+ * @default 0
33
+ */
8
34
  cumulativeWeightAdditive: number;
35
+ /**
36
+ * TODO
37
+ *
38
+ * @default 0
39
+ */
9
40
  useCount: number;
41
+ /**
42
+ * TODO
43
+ *
44
+ * @default 0
45
+ */
10
46
  referenceCount: number;
11
-
47
+ /**
48
+ * Accumulates data in the `incoming` region into `accu<i>`.
49
+ *
50
+ * @param {number} accuIndex - The accumulation index.
51
+ * @param {number} weight - The weight.
52
+ */
12
53
  accumulate(accuIndex: number, weight: number): void;
54
+ /**
55
+ * Accumulates data in the `incoming` region into `add`.
56
+ *
57
+ * @param {number} weight - The weight.
58
+ */
13
59
  accumulateAdditive(weight: number): void;
60
+ /**
61
+ * Applies the state of `accu<i>` to the binding when accus differ.
62
+ *
63
+ * @param {number} accuIndex - The accumulation index.
64
+ */
14
65
  apply(accuIndex: number): void;
66
+ /**
67
+ * Remembers the state of the bound property and copy it to both accus.
68
+ */
15
69
  saveOriginalState(): void;
70
+ /**
71
+ * Applies the state previously taken via {@link PropertyMixer#saveOriginalState} to the binding.
72
+ */
16
73
  restoreOriginalState(): void;
17
74
  }