typesense / typesense-js

JavaScript / TypeScript client for Typesense
https://typesense.org/docs/api
Apache License 2.0
400 stars 74 forks source link

Expose types again #153

Open nandorojo opened 1 year ago

nandorojo commented 1 year ago

I previously imported these types:

import { SearchResponse, SearchResponseHit } from 'typesense'

It looks like they're no longer exported by the library. Would be nice to have this to build custom hooks with.

jasonbosco commented 1 year ago

I don't recall exporting these types at the top level...

This should still work:

import { SearchResponse, SearchResponseHit } from "typesense/lib/Typesense/Documents";
egorkel-altexsoft commented 10 months ago

+1 for top level imports It looks terrible

import { SearchClient } from 'typesense';
import { ConfigurationOptions } from 'typesense/lib/Typesense/Configuration';
import { SearchParams } from 'typesense/lib/Typesense/Documents';
import { SearchOnlyCollection } from 'typesense/lib/Typesense/SearchOnlyCollection';
christiankaindl commented 7 months ago

Just ran into this issue, would be good to at least document how Typesense is supposed to be used with TypeScript.

The import path is not at all obvious and there is no auto-import in VS Code. If I wouldn't have found this open issue on GH, I'd be stuck with no types from Typesense.