Two.js: [Bug] Some methods seem to be missing from the v0.7.3 npm package

Created on 27 Mar 2021  路  7Comments  路  Source: jonobr1/two.js

Describe the bug
After upgrading to the v0.7.3, I found that the two.js was conflicted with the @types/two.js, and then I uninstalled the @types/two.js and used the

import Two from 'two'

, but two.makeXXX() or two.appendTo() method cannot be found in the two.module.d.ts, so these methods can't be used.

bug

All 7 comments

Ah shoot, sounds like the automated Typescript generator doesn't work too well. I'll have to continue to work on this. Thanks for reporting!

Unfortunately, in order to use this script it will take significant changes to the codebase. I think it would be better to generate the declaration file ourselves when the script generates the wiki documentation. This too, unfortunately, will take some time to get setup.

Sorry to be the bearer of this news.

Because of the semantics around how Two.js was originally wrote and how to get types declared properly, this issue relates to this issue in that there are number of stylistic changes the codebase could take in order to elegantly solve this issue.

I found a better library to convert JSDocs documentation into Typescript types. There are likely _a few_ rough edges still, but give the latest version a try: https://www.npmjs.com/package/two.js which is v0.7.4.

I tried installing the latest version but it seems like the types are missing from the npm package?
image

Sorry for the delay and thanks for sharing this @stefnotch. I'll update the NPM package today with the appropriate updates I just pushed to dev.

@stefnotch, types are now present in the NPM build. If you see issues with the types (which I'm sure there are, because i'm not a Typescript user!) please file a new issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ImedAdel picture ImedAdel  路  3Comments

anderspitman picture anderspitman  路  4Comments

hichem147 picture hichem147  路  3Comments

mariomeraz picture mariomeraz  路  6Comments

caracal7 picture caracal7  路  8Comments