-
Notifications
You must be signed in to change notification settings - Fork 5
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
chore(typings): add basic typings #53
Conversation
Part of this PR typings is from here https://github.com/parro-it/libui-node/pull/112/files#diff-b52768974e6bc0faccb7d4b75b162c99 |
There are classes / APIs without any comments so I'm not sure how to add. i.e UiDialogs, UiDrawMatrix |
The typings work is complete from my side. There could be incorrect typings around matrix / drawing classes. |
Thank you, @bigopon, good job!
I'll open a specific issue to remember directly exporting UiControl.
I'll add comment for them, we can improve typing after that. Can you add the new file to the "files" section of package.json, so it will be published to npm? |
@parro-it Added 👍
Awesome. |
I'll make some correction after this gets merged, but in the big picture @parro-it: I guess the type definitions shouldn't include deprecated & undocumented parts (like unscoped enums). |
@bigopon It the |
I'm not sure if they can be dynamically added to the TS types too... @bigopon: basically, for each control property, we dinamically create and expose two methods: a getter and a setter. |
@mischnic Everything is
Can you help clarify which ones, I was unsure about the enums and mostly copypasted them |
Ok
I'm going fix that in a followup PR. |
Ok, so I merge this and we'll do the corrections in other PR. |
Nice, looking for ui table and typings in the new release 🍻 |
Checklist
npm run test
passesOne thing that doesn't feel right to me is there is no way to tell if a node is
UiControl
, I think it would be needed from times to times when integrated into other higher level templating frameworks. At the moment, I kind of have to do this:Maybe consider start exporting
UiControl
? For the typings,UiControl
,UiEntryBase
,UiBox
are marked asabstract
class and should be enough to prevent TypeScript user to avoid calling it directly.