-
Notifications
You must be signed in to change notification settings - Fork 115
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
typescript definition #64
Comments
I think it's a good idea, and one that would sit well with a pull-req I got a while back (IIRC) about adding package support (AMD/require/browserify-kinda stuff). Could you link me to the definitelyTyped entry for Three.js? |
Sure, here it is: |
Nice one, cheers. I'll take a peek. |
Ha, that's so foreign to me. If you're up for making a draft version of a definition for this lib, that would be super handy. I've not used TypeScript very much at all, so I'd be best deferring to you with regards to that. |
The linked file above (http://jppresents.net/static/files/ShaderParticles.d.ts) is actually enough to get up and running with your lib in typescript. This way typescript knows which classes ShaderParticles offers and what their functions and datatypes are. Typescript to create group / emitter with this definition looks like this:
I am not sure if or how browserify/require use typescript definitions. To clarify: I think if you put the linked ShaderParticles.d.ts file into the repository then typescript-people can directly start using the lib, no more work required by you or me. |
Okay, just noticed when continuing with my game: All the ones, that you are supposed to be able to change after the creation of the emitter. (So they can be accessed on the emitter object in typescript.) If you tell me where in the repo the file is supposed to go, I will submit a pull request when I got it done. Phaser (another lib I like to use) has them simply in a directory called typescript. (Linked as an example: https://github.com/photonstorm/phaser/tree/master/typescript ) |
I'm so glad you're doing this - I'd be lost in documentation right about now ;) A new subfolder on |
The link above for the typescript file (http://jppresents.net/static/files/ShaderParticles.d.ts) doesnt work any more, any chance you've got it around any more and can submit a pull request? Thanks. |
hi,
I am using typescript to create my game.
(Typescript compiles down to javascript and can use typescript definitions to use pure javascript libs such as three.js or the ShaderParticleEngine.)
For three.js there is a definition available at definitelyTyped on github (they gather definitions for libs that don't provide them themself).
I made a minimal ShaderParticle.d.ts definition file, which enables use of groups and emitters in typescript.
It's only a few lines, would you be interested to host it in this project?
(It's ok if you are not, I'll then look into getting it into definitelyTyped - but I have not yet looked into their policies regarding size of projects or how to get definitions there.)
If you would just like to include it, here is the file:
http://jppresents.net/static/files/ShaderParticles.d.ts
The text was updated successfully, but these errors were encountered: