New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZoomToFit Typescript issue #1280
Comments
It looks like you found a bug, but your suggested fix is backwards. The return type of If you look at how it's used in practice, the data type is a list of entities, which contain geometry as one of the properties: Would you be willing to make a PR with a type definition fix? |
Has the entity type been defined anywhere yet? |
I don't believe so. The closest is the inline type definition here for
But I think it would be nicer if we defined the Entity type explicitly. |
Is something like this ok? Im not great with typescript and dont really understand the way that you have structured the types, perhaps you can guide me if Im way off. |
Yes that's looking very nice, pretty much the same way I would have done it. Notes:
Thanks for looking into this! |
zoomToFit causes a typescript error saying that Geometry[] is not the correct type for the entities argument.
The return type of the function entitiesFromSolids is Geometry[] and zoomToFit is expecting this as input, so I assume this is a bug in the type declarations. If I change the zoomToFit function to expect Geometry[] then everything works as expected.
The text was updated successfully, but these errors were encountered: