question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript type declaration

See original GitHub issue

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-native package 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:

  • Passing props for children.
    • Grid’s row, column or Form’s label are 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.
  • Universal props
    • Although currently, there’s only one universal prop but how it is defined halt me from adding it in. Are all universal props from now on always excluded from Tabs, Grid children, Combobox/RadioButton Items, MenuBar? Or each one of them will have a separate list of exclusion? Depends on that, I choose a fast approach to extends props 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!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
khanhascommented, 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:

  • Added AreaTextProps and AreaText component

If you want to play with Area.Text right now, manually replace this index.d.ts with the one in ./node_modules/@types/proton-native/.
Reload your editor.

0reactions
kusti8commented, Jun 19, 2018

Thanks for the work on this! Added to docs in 62e4b00

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Declaration Reference - TypeScript
Use declare var to declare variables. If the variable is read-only, you can use declare const . You can also use declare let...
Read more >
A quick introduction to “Type Declaration” files and adding ...
We can write our own TypeScript Declaration files or have them produced from the compilation of TypeScript files ( .ts ) by setting...
Read more >
TypeScript — Type Declaration Files | by Makesh Kumar
Type declaration files are the files with d.ts extension, where types were declared via interface or type . These declaration files have no...
Read more >
TypeScript - Variables - Tutorialspoint
The type syntax for declaring a variable in TypeScript is to include a colon (:) after the variable name, followed by its type....
Read more >
TypeScript Variable Declarations: var, let, const
To solve problems with var declarations, ES6 introduced two new types of variable declarations in JavaScript, using the keywords let and const ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found