jsgeoda icon indicating copy to clipboard operation
jsgeoda copied to clipboard

5 update add type declaration dts file

Open dpeachpeach opened this issue 2 years ago • 5 comments

Adding type declarations for the src code.

dpeachpeach avatar Sep 01 '23 17:09 dpeachpeach

Thanks @dpeachpeach! The next step is to combine these d.ts files into index.d.ts, which will work with index.js under lib directory. To make the type declaration index.d.ts working, you also need to add the following line in package.json:

  "main": "./lib/index.js",
 + "types": "./lib/index.d.ts",

lixun910 avatar Sep 05 '23 17:09 lixun910

@dpeachpeach See my changes and comments above. You should be able to run yarn and then yarn build:bundle to generate the file lib/index.d.ts for the library.

lixun910 avatar Sep 05 '23 18:09 lixun910

Hey @lixun910 , I successfully generated the file and it is more precise but it still seems like it sets multiple type signatures to any. We can discuss in the meeting.

dpeachpeach avatar Sep 08 '23 15:09 dpeachpeach

@dpeachpeach I've made some changes to this branch, you can do git pull to get these changes on your side. The index.d.ts should be auto-generated when you run yarn build.

lixun910 avatar Sep 08 '23 16:09 lixun910

@dpeachpeach Please also update the version to 0.2.10 in package.json Thanks!

lixun910 avatar Sep 08 '23 22:09 lixun910