-
Notifications
You must be signed in to change notification settings - Fork 5
getters setters and other enhancement to typescript definitions #57
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
base: master
Are you sure you want to change the base?
Conversation
|
Unfortunately, clang-format doesn't really work well with typescript |
…ers' into mapped-getters-setters
Mapped getters setters fixup
…libui-napi into mapped-getters-setters
Use tsc instead of tslint
…libui-napi into mapped-getters-setters
Fix matrix typings
| /** | ||
| * Create a new UiControl object. | ||
| */ | ||
| constructor(handle: any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the last remaining "private/internal" constructor that should be removed from the public API definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you said constructor? Anyway, I never exactly understand how that could be used, apart for read. Do you never try to set toplevel=false on a toplevel control?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No 😄 , I meant this part:
Lines 354 to 357 in dade525
| /** | |
| * Create a new UiControl object. | |
| */ | |
| constructor(handle: any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sure! I guess it should be protected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just remove it, because libui-napi (js/*.js) itself isn't typechecked. This is just the public API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And toplevel is just a getter, so it should be readonly: (the documentation is wrong as well)
Lines 36 to 42 in 5e32314
| /** | |
| * Set or return whether the control is a top level one. | |
| * @return {boolean} | |
| */ | |
| get toplevel() { | |
| return ControlBase.toplevel(this.handle); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That explains my previous doubt on its being writable 😊
tslintpackage to lint typescript defs file.While doing these changes, I also find some error in type of properties that I'm going to fix with further commits here.