Closed pixelzoom closed 3 years ago
By the way... Navigating to Intersection
from Shape's @returns {Array.<Intersection>}
takes me to an unreleated class with the same name in bending-light.
After inspecting what intersection
is returning in geomtric-optics, I change my method param to {Array.<RayIntersection>}
, see above commit. TS is happy now and requires no @ts-ignore
.
Apologies about the improper type docs! This looks like it's working well, anything else to do?
👍🏻 closing
Encountered while working on https://github.com/phetsims/geometric-optics/issues/229.
Geometric Optics makes calls to
Shape intersection
, which is defined as:The
Array.<Intersection>
type is problematic for TypeScript. As far as I can tell, there is no such type, it's a non-existent abstraction used in documentation.Segment.js says:
So can we simply change the return type of Shape
intersection
to@returns {Array.<RayIntersection>}
? Or some union of the concrete Intersection types?