love2d-tl
love2d-tl copied to clipboard
Copy over to teal-language/teal-types?
Very nice declaration file :)
Do you mind if we copy the .d.tl output to the official Teal type definitions repo? Otherwise, I think we should at least put a link to your repo somewhere in Teal's documentation.
I actually need someone to check the correctness of the generated definitions, mainly the ones that return function like love.event.poll, File:lines, love.filesystem.lines and ones that expect function like ImageData:mapPixel. If that looks good, then my suggestion is to only link this repository instead, as there's still blacklisted functions due to limitations in my definition generator.
I actually need someone to check the correctness of the generateddefinitions, mainly the ones that return function like love.event.poll, File:lines, love.filesystem.lines and ones that expect function like ImageData:mapPixel
At a glance, these declarations seem to be correct.
love.event.poll's return type should probably be Event, any... The Event enum is missing from the love.event declarations (looking at generate_tl.lua, it seems to have been removed on purpose?)
If that looks good, then my suggestion is to only link this repository instead, as there's still blacklisted functions due to limitations in my definition generator.
Okay, though we don't mind incomplete type definitions for now. You can send a PR at teal-types when you feel like it :+1:
Also, I think the love.handlers table is missing from the declaration file. It is used in the default love.run implementation.
I pushed bc43830b90a5e90c098321239f7885a4fac2f061 to fix love.event.poll. I replaced the Event enum to string on purpose. Mind if you check if that's correct way to define it?
I can't think of way to add love.handlers yet due to same reason as functions listed in readme.md are blacklisted.
Yes, the declaration for love.event.poll seems fine.
The last thing I've noticed is that the default main loop in love.run returns a value on exit. So, its signature should probably be run: function(): function(): any (or maybe number | string instead of any)
Please see my comment at https://github.com/teal-language/teal-types/pull/17#issuecomment-791184958
I may consider copything this over to teal-types once I resolved all the blacklisted functions and #4.