geokdbush icon indicating copy to clipboard operation
geokdbush copied to clipboard

Updating kdbush and geokdbush types on DefinitelyTyped

Open smallsaucepan opened this issue 7 months ago • 2 comments

Hi @mourner. Have taken your advice to use kdbush in Turf to improve performance. Results look very promising so far. Thank you!

Did come across a typing issue though between kdbush and geokdbush. Namely around KDBush no longer being a named export or a generic.

Wanted to check in to go through steps to tidy this up. I think I need to:

  1. create a DT PR to snapshot the kdbush DT types as v3 - like has been done here for v1. Process described here. Think that should keep everyone still on v3 happy.
  2. once the above is merged, request that kdbush no longer requires its types on DT as it packages it's own as of v4. This step is described at Removing a package. Believe the asOfVersion should be 4.0.0. @types/kdbush are currently at 3.0.5 so that should suit the criteria.
  3. once the above takes effect, create a second DT PR to update the geokdbush types to import KDBush as the default export, and define index as KDBush without the generic.

Does that sit well with you? Anything I've missed?

smallsaucepan avatar May 17 '25 10:05 smallsaucepan

Hi @smallsaucepan, this sounds good to me! Perhaps instead of 3, we should do the same treatment to geokdbush as I did for kdbush (first-class types), but that can wait if 3 is easier.

mourner avatar May 17 '25 12:05 mourner

Might as well aim for the gold standard. Would you have time to look at 3 if I got started on 1 and 2?

smallsaucepan avatar May 18 '25 00:05 smallsaucepan