@types/three - Obect3D.children type is incorrect #53851
Unanswered
baremaximum
asked this question in
Issues with a @types package
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Object3D.children attribute is defined as having the type
Object3D[]
. This is incorrect.Object3D is the base class for many different types of objects. The children attribute can return an array of any of these types - not just the base type.
Unfortunately, with the definition as it is, any code that attempts to access any method or attribute not shared by the base class fails to compile, and the type needs to be coerced - even if the code is correct.
I'm not really sure what a good solution to this would be. I don't know this library well enough to make a very good suggestion.
Beta Was this translation helpful? Give feedback.
All reactions