Open DjulLau opened 3 years ago
Click Proton constructor type declaration to see detail types definition.
Thanks for your answer. I know where to look for the definitions. I don't understand why the basic example generate so many errors (and so my old JS proton codes). Versions incompatibilities ? Wrong/incomplete types definitions ?
Please download the latest version of proton and try
Still doesn't help (using 5.3.2). Looks like the types are incorrect/don't match optional or polymorphic paramters:
For example, the addBehaviour
function takes in a Behaviour
array, but at no point does color implement a Behavior interface, so you can't call it with a Color.
/**
* add the Behaviour to particles;
*
* you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);
* @method addBehaviour
* @param {Behaviour} behaviour like this new Color('random')
*/
addBehaviour(...args: Behaviour[]): void;
Same goes for many different functions/constructors/etc
Are the types generated or hand crafted?
Are the types generated or hand crafted?
sorry, most of d.ts file content is generated by dts-gen, only a few part is written by hand, we appreciate it if you can help us to improve this d.ts file。
Hi there,
First thanks for this great lib ! I've used it some years ago in pure JS with success. Now I'm trying to use it in a typescript project with no luck. I've just installed it with npm and tried to run the example but I'm getting lots of errors like if the types were not in sync or so.
What am I missing ?
Thanks,
Julien