typesense / typesense/typesense-js

Improve TypeScript compatibility

Open
#183 9 comments 3 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.