mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 22:02:24 -06:00
[GH-ISSUE #122] TypeScript type declaration #74
Labels
No labels
bug
documentation
enhancement
libui issue
pull-request
question
wait for libui implementation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/proton-native#74
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @khanhas on GitHub (May 11, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/122
I have recently just pulled request new definition files for our package on DefinitelyTyped. If this goes through, TypeScript user will be able to install
@types/proton-nativepackage and start making app with TypeScript easier and faster.I covered almost all Components , but it still has some problems and I need your help:
row,columnor Form'slabelare props that are only available for components inside them. They shouldn't available for components outside of<Grid></Grid>,<Form></Form>. I don't know how to achieve that.extendsprops list for all components.If you like TypeScript and Proton-native and want to contribute, please do comment it here or my pull request on DefinitelyTyped or pull a request on my fork.
Any help would be greatly appreciated!
Happy coding!
@kusti8 commented on GitHub (May 11, 2018):
Looks nice. I haven't done TypeScript at all, so I wouldn't really be of much use. So as for your first point, I don't know what's available or what can be done. For your second point, universal props aren't a set list with set exclusions. They're a list of props that most items implement.
@khanhas commented on GitHub (May 12, 2018):
Thank you very much! I will include universal prop soon.
I create this Issue for more like a discussion thread than an actual issue. So can you add some label for this thread to gain some attention from user/dev that are familiar with using React/React Native + TypeScript?
@kusti8 commented on GitHub (May 21, 2018):
Hey @khanhas what's the status on this?
@parro-it commented on GitHub (May 22, 2018):
@khanhas, you may find helpful to coordinate your efforts with @sandangel that is working on https://github.com/parro-it/libui-node/pull/112 to add typescript types in libui-node.
@khanhas commented on GitHub (May 22, 2018):
New update waiting for approval: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25936
Changes:
Added Grid children, label, stretchy props
Since I haven't figured it out how to pass props for children, I let all components have Grid children and
labelprops.stretchyadded where needed. This solution ensure that it won't raise any error on these props.Although so, I'm still not quite happy with it. Because we have to sacrifice "strictness" of type of certain components, like
stretchystill can be applied in grid children and Grid children props can be used in every components even they're not inside aGrid.On the bright side, we are able to outsource children component in another class and still have its proper additional props.
Specified children type for some components.
Slider: addedmax,minpropsColorButton:onClicktoonChangeRemoved undocumented components.
I just realized they are just components for bigger wrapper components, not "new,
cutting edge" components waiting to be finished and released. User can't use them anyway so their definition are better be removed.
@khanhas commented on GitHub (May 22, 2018):
@parro-it If you don't want to unnecessarily include Typescript and its dependencies for your project, I think it's best to pull a "Add type" request on DefinitelyTyped and let them do the job.
@parro-it commented on GitHub (May 22, 2018):
I don't know exactly, I never used typescript, as I said, @sandangel is doing the work...
Anyway, the typescript dependency is actually added as a dev dependency, which I don't care.
@khanhas commented on GitHub (Jun 10, 2018):
Area.Text are already added in @types/proton-native and waiting for approval.
Tracks its progress here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26406
Changes:
If you want to play with Area.Text right now, manually replace this
index.d.tswith the one in./node_modules/@types/proton-native/.Reload your editor.
@kusti8 commented on GitHub (Jun 19, 2018):
Thanks for the work on this! Added to docs in
62e4b00