Skip to content

Typing issue with StringKeyframeTrack, ColorKeyframeTrack and others #31374

@Scarabol

Description

@Scarabol

Description

Thank you for this amazing library! I'm using it to build my own project for years. I'm using three.js with a TypeScript project and found a minor issue with types given for different KeyframeTrack implementations. I use typings generated by @types/three

Reproduction steps

  1. Check generic type of array values for KeyframeTrack implementations like: StringKeyframeTrack, BooleanKeyframeTrack, ColorKeyframeTrack, VectorKeyframeTrack, QuaternionKeyframeTrack
  2. Notice that all typings say Array<number> regardless of the actual implementation or the correctly given ValueTypeName

I expect the respective generic type to match with the implementation class type. So for

  • StringKeyframeTrack: I expect Array<string> in the docs comment
  • BooleanKeyframeTrack: I expect Array<boolean> in the docs comment
  • ColorKeyframeTrack: I expect Array<Color> in the docs comment
  • VectorKeyframeTrack: I expect Array<Vector2 | Vector3 | Vector4> in the docs comment
  • QuaternionKeyframeTrack: I expect Array<Quaternion> in the docs comment

Code

tbd

Live example

tbd

Screenshots

No response

Version

178

Device

No response

Browser

No response

OS

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions