Closed LanceEa closed 3 years ago
Thanks for reporting this. I have published a new package (v0.8.1) to fix this.
I have pulled in 0.8.2
and verified the typings are now published to NPM.
Thanks for getting this resolved so quickly!
One other thing that might be beneficial in the Readme is to point out for Typescript is they should do the following:
import { curve, Curve } from 'leaflet';
import '@elfalem/leaflet-curve';
Based on the typings the curve
is imported from the leaflet module and not from the leaflet-curve module. At first I was trying to import from leaflet-curve and only saw the internal types. Which in hindsight makes since because it is a plugin extending leaflet object.
By importing from leaflet the code is properly compiled (in my cause Angular) so that the curve function hangs off the window.L
global object.
I've updated the Readme. Thanks for pointing this out!
The type declaration file was added in #38. However, it looks like the declaration file is not being published to NPM so it doesn't show up in the
node_modules/@elfalem/leaflet-curve
.Based on the Typescript docs the two main ways are either via NPM with the library or through the @types organization on NPM. https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html
The previous PR included the types in the
package.json
and I also see someone already has submitted a version to the @types organization that separate from the ones included in this repository.https://www.typescriptlang.org/dt/search?search=leaflet-curve
So, my guess is that it just got missed during the npm publish process?