Skip to content

v1.2.1 — Major DX upgrade: smarter autocomplete & clearer TypeScript typings

Choose a tag to compare

@Tfoucher5 Tfoucher5 released this 22 Apr 09:26
· 104 commits to master since this release

✨ Highlights

This release is focused on developer experience: improved IDE autocomplete, safer configuration objects,
and clearer “hover docs” — without changing runtime behavior.

If you use VS Code / WebStorm (or any TypeScript-powered editor), you’ll immediately notice:

  • better suggestions for options (algorithm, normalize, hybrid, etc.)
  • clearer inline documentation for each option
  • smarter return types when using explain: true

✅ What changed

1) Stronger TypeScript declarations (.d.ts)

  • Expanded and clarified public API types
  • Improved descriptions on key options and behavior
  • Added more precise types for algorithm-specific options (jaroWinkler, tokenSort, tokenSet, hybrid)

2) Overloads for better IDE inference

The typings now correctly infer return values based on explain:

  • rate(..., { explain: true }) → returns an object (RateExplainResult)
  • rate(..., { explain: false }) or without explain → returns a number

Same improvement applies to:

  • rankCandidates() (returns explained items when explain: true)
  • findBestMatch() (returns explained best match when explain: true)

3) Clearer documentation in tooltips

Key options are now documented directly in hover tooltips, including:

  • algorithm guidance (when to use what)
  • normalization behavior
  • spaceInsensitive behavior (opt-in, char-based only)

🛠 Runtime impact

  • No runtime changes
  • No behavior changes unless you update your own code usage
  • This is a DX-only release: safer types + better autocomplete

🔄 Versioning

  • 1.2.0 → 1.2.1
  • Patch release (backward compatible)

❤️ Thanks

Thanks to everyone testing and providing feedback -- keep the issues and PRs coming!