Skip to content

[@types/three] Understanding interface changes #69506

Discussion options

You must be logged in to vote

Hey @EdwardMoyse thanks for raising this issue!

However if I look at the library documentation for FontLoader
it has a different interface, namely parse(json: Object) instead of parse(json: FontData) in https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.

I'm just wondering if it is normal to have a more restrictive interface here than in the base library? I was very confused about what was going on, until I looked at FontLoader.d.ts

In short, yes. The documentation doesn't always fully spell out the types of Object in cases like this, but the TypeScript types are a bit more fleshed out for better type-safety.

The issue that you're having is actually that some of …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@EdwardMoyse
Comment options

Answer selected by EdwardMoyse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pkg: three Discussions related to three
3 participants