TypeScript support
See original GitHub issueI’m using Leaflet.GeometryUtil in a TypeScript project. As far as I’m aware, there are no typings yet, as mentioned in #73.
I would like to write some typings. There are 3 options:
- Write typings and publish them as a separate
@types/leaflet-geometryutil
package. - Write typings and include them in this repository. This would involve creating a
.d.ts
definition file and referencing it in the"types"
field inpackage.json
. - Convert the whole source code to TypeScript. This would involve changing the setup a bit. A build script would have to be run before publishing the project.
The first option is the least intrusive to this project, the third one is the most proper one, since it makes sure that the type definitions are really in sync with the code.
Which one would you prefer?
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
TypeScript: JavaScript With Syntax For Types.
TypeScript extends JavaScript by adding types to the language. TypeScript speeds up your development experience by catching errors and providing fixes ...
Read more >TypeScript - Wikipedia
TypeScript supports definition files that can contain type information of existing JavaScript libraries, much like C++ header files can describe the ...
Read more >TypeScript Programming with Visual Studio Code
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It offers classes, modules, and interfaces to help you build robust...
Read more >TypeScript | WebStorm Documentation - JetBrains
WebStorm supports developing, running, and debugging TypeScript source code. ... Learn more from Compiling TypeScript into JavaScript.
Read more >TypeScript support in Svelte - Learn web development
First-class TypeScript support has been Svelte's most requested feature for quite some time. Thanks to the hard work of the Svelte team, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The JS vs TS debate is a bit like the C vs C++ debate. It’s pointless without context - JS is better for some projects, TS is better for others. I’d like to point out that this project is a plugin for a JS library itself included in JS applications. So having to “compile” from TS to use it, or (more importantly) having to know TS to contribute to it would be a huge drawback. TS coders are supposed to be familiar with JS but not the other way around.
That makes sense.
Also, once the typings are there, it’s less work to convert the existing code to TypeScript.