0.5.4 • Published 10 months ago

@ts-defold/type-gen v0.5.4

Weekly downloads
1
License
MIT
Repository
github
Last release
10 months ago

@ts-defold/type-gen

TypeScript type generator for Defold

type-gen is a TypeScript declarations generator for the Defold game engine.

  • types are parsed generated from the offical documentation
  • types will avoid any if they can
  • vmath.* types can all be used with number operators through Intersection Types
    • you will need to decorate with an aditional cast upon assignment, but a fair tradeoff vs. vector math function helpers
      function on_update(this:{pos: vmath.vector3, dir: vmath.vector3}, dt: number) {
        const speed = 331;
        this.pos = this.pos + this.dir * speed * dt as vmath.vector3;
      }
  • generated typdoc commnets from lua documentation
  • fully generated with no need to manually intervine

Usage: Install & {}

type-gen was made to generate types for @ts-defold/types and is included as a dev dependency. If you are simply wanting typescipt types for your Defold project @ts-defold/types is your best bet.

npm install -D @ts-defold/types

If you would like to generate your own types, hack on this project, or contribute in any way, i would suggest you try:

git clone https://github.com/ts-defold/type-gen.git
cd type-gen
npm install 
npm run build

Alternatively, if you would like to just generate your types without the dependency then simply:

npx @ts-defold/type-gen
#or
npx @ts-defold/type-gen -- defold.d.ts --channel stable --api latest

@ts-defold/type-gen can optionally take in arguments:

If being used in a project locked to a specific release channel or version of defold you may add configuration settings in your package.json instead:

"ts-defold": {
    "channel": "stable",
    "output": "index.d.ts"
},

Shoutouts 📢

@dasannikov and DefoldTypescript for a starting point and inspiration TypeScriptToLua for the awesome community and tools @hazzard993, @ark120202, @Perryvw and all the fine folks over on the tstl discord server.

0.5.4

10 months ago

0.5.3

10 months ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.2.10

3 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago