just-js / lo

it's JavaScript Jim, but not as we know it. :space_invader:
MIT License
220 stars 9 forks source link

Feat/typedefs #36

Closed lostrepo closed 2 months ago

lostrepo commented 3 months ago

added lo type <config path> to autogenerate subset of types based on included embeds/libs/bindings (as much as possible)
replaced api schema typing imports with type comments
added optional array to hint optional params in api definitions
reduced amount of file rewrites with lo init and lo type <config path>

lostrepo commented 3 months ago

Edit: done*
Also we can add globals.d.ts, lib/globals.d.ts, lib/apis.all.d.ts to .gitignore since all info is in lib/types.js and all final type changes should go there
But must update symbols

billywhizz commented 3 months ago

@lostrepo thanks for this! will take a look over the weekend. :pray:

billywhizz commented 2 months ago

@lostrepo sorry - i had to push some changes up before i had a chance to review this. would you mind rebasing when you have a chance? i will get this merged over next couple days once i have had a look. :pray:

lostrepo commented 2 months ago

rebased
resolved 1 merge conflict in main.js:

ideally, we should have 2 objects so real type of one returned by lo.load/lo.library remains unchanged => api.js based types and override types will correspond to separate js objects but I don't know the cost of that so only added some variable handles with type casts for core in main.js lib/<lib_name>.js files also have issue of changing object returned by lo.load

lostrepo commented 2 months ago

Detected missing typedef on lo image