Closed gavinr-maps closed 1 month ago
Hey @gavinr I am interested in this task. Can you please assign me ? Also which specific type need to be added ?
Sorry @nooras I just found out that @gavinr was out of the office last week. Let me ping @patrickarlt & @cyatteau
I am interested in this task. Can you please assign me ?
It is not necessary for you to be assigned in order for you to work on this task - please feel to go ahead and work on it! Just fork the repo, create a branch, make the changes in that branch, and then send a PR back to this repo.
Also which specific type need to be added ?
I think it would be types for any of the pubic APIs, i.e. what is listed here: https://github.com/Esri/esri-leaflet-geocoder?tab=readme-ov-file#api-reference
Is @nooras assigned to this? I don't want to pick up an issue if someone is already on it.
Is @nooras assigned to this? I don't want to pick up an issue if someone is already on it.
Hey @kimmykokonut I am working on it. Thanks
hey @gavinr-maps, @hhkaos I am done with changes in local. how can i verify these changes are working fine in local ?
@gavinr-maps Please review the PR. Let me know if any changes required
I'm trying to test, but I'm not as familiar as I should be with TypeScript these days.... So I'm going to defer to @gavinr-maps 😅
@hhkaos I have added replication steps to the original issue above.
I have followed the steps. Is the error in the IDE or the terminal?
At first, as I expected, the IDE still shows a couple of errors (because @nooras changes shouldn't be present, right?):
To test her changes, locally, I have:
feat-typescript-types
branchnpm install
and npm run build
successfullydist
folder and replaced the files in test-esri-leaflet-geocoder/node_modules/esri-leaflet-geocoder/dist
folderIs that the right way to test it? 😅
The app is building and the terminal is not showing any errors:
So... I'm confused because you mention:
Actual: Could not find a declaration file for module 'esri-leaflet-geocoder'. 'c:/../node_modules/esri-leaflet-geocoder/dist/esri-leaflet-geocoder-debug.js' implicitly has an 'any' type. Try npm i --save-dev @types/esri-leaflet-geocoder if it exists or add a new declaration (.d.ts) file containing declare module 'esri-leaflet-geocoder';ts(7016)
But I don't see that error anywhere. Does it mean it is fixed? 😅
@nooras, just FYI, I just checked with @gavinr-maps on a call, and the issue on my side was that I had @types/esri-leaflet-geocoder installed globally; that's why I didn't have that issue 😅. So you can proceed with his instructions
Thanks!
Problem
As a follow-up from #259 and https://github.com/Esri/esri-leaflet-geocoder/issues/318#issuecomment-2312706576, it seems like the TypeScript types at https://www.npmjs.com/package/@types/esri-leaflet are ok but not working in certain situations.
Solution
We should publish our own typescript types file within this repo, like we did within https://github.com/Esri/esri-leaflet-vector/pull/114
Replication Steps
src/style.css
:REPLACE the file
src/main.ts
with this:npm i --save-dev @types/esri-leaflet-geocoder
if it exists or add a new declaration (.d.ts) file containingdeclare module 'esri-leaflet-geocoder';
ts(7016)