kittykatattack / ga

The world's tiniest, cutest and funnest game engine
451 stars 85 forks source link

Add Typescript support #69

Closed bsorrentino closed 5 years ago

bsorrentino commented 6 years ago

Hi

This is mostly a question. I would like to know if you are interested to add support for typescript language.

I've forked your project and, without change anything of your runtime js code, I have added typescript definitions in order to have for free type checking, intellisense, inline help etc .. Moreover I've converted tutorial and examples (see fork) (see typedoc generate doc)

If yes, I'll provide you the PR

kittykatattack commented 6 years ago

Wow, that's amazing!!! I wouldn't like to use Typescript in this main repo (it's all about minimalism), but we should definitely link to your fork in the docs.

(...Oh, and if anyone out there reading this would like to build an Elm (http://elm-lang.org) wrapper, please let me know!)

Permagate commented 5 years ago

Thanks for the definition files @bsorrentino. Rather than adding it in the main repo, might I suggest to publish it in a separate package @types/Ga! ?

bsorrentino commented 5 years ago

Ok

I’ll push to DefinitelyTyped for publishing as @types

bsorrentino commented 5 years ago

Hi @kittykatattack referring to @Permagate request could I publish on npm ( ga-ts ) this package using the typescript definitions from my fork ?

Note

Keep in mind that I haven't changed your javascript implementation

kittykatattack commented 5 years ago

@bsorrentino Yes, of course, go ahead! Thanks for doing all that, it's amazing!

We should add a link to your fork on the README too.

-kk.

bsorrentino commented 5 years ago

Thank you @kittykatattack for your amazing work ...

bsorrentino commented 5 years ago

I've published project on npm.

@Permagate typescript definitions are embedded so, if you use npm to download project (npm i kka-ga ) it already works for typescript

Permagate commented 5 years ago

Need to add /// <reference types="kka-ga" /> somewhere in the project in addition to installing kka-ga. It works well otherwise, thanks @bsorrentino!

bsorrentino commented 5 years ago

@Permagate, that should be one way to use it.

Really I would wanted that definition was auto loaded for this reason I've followed the standard naming index.d.ts. But it seems not enough .. I'll try to figure out how to do it