typesense / typesense/typesense-js
Improve TypeScript compatibility
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 569
- Forks
- 99
- Avg merge
- 5h 6m
- Merged PRs (30d)
- 2
Description
Description
When using TypeScript > 5.1, there are numerous type check errors, most of which are related to Element implicitly has an 'any' type because expression of type 'string' can't be used to index type (…), but also Parameter (…) implicitly has an 'any' type.. My tsconfig.json already includes "skipLibCheck": true so there is not a lot I can do to work around besides pinning the TS version.
Steps to reproduce
Include typesense in a JS project and e.g. import type { SearchResponse } from "typesense/lib/Typesense/Documents";. Run tsc >= 5.2.
Expected Behavior
The project compiles without any issues.
Actual Behavior
There are a lot of typescript issues, probably depending on how much typesense interfaces are imported.
Metadata
Typesense Version:
1.7.2
OS:
MacOS 14.1.1
Node 21.2.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the problem in a TypeScript project using the import from typesense/lib/Typesense/Documents and tsc >= 5.2. Inspect the reported type errors across the imported Typesense interfaces, then verify that the project compiles without those errors while retaining TypeScript compatibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100