typesense-js icon indicating copy to clipboard operation
typesense-js copied to clipboard

Expose types again

Open nandorojo opened this issue 2 years ago • 4 comments

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.

nandorojo avatar Mar 16 '23 23:03 nandorojo

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

This should still work:

import { SearchResponse, SearchResponseHit } from "typesense/lib/Typesense/Documents";

jasonbosco avatar Mar 16 '23 23:03 jasonbosco

+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';

egorkel-altexsoft avatar Oct 31 '23 18:10 egorkel-altexsoft

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.

christiankaindl avatar Feb 08 '24 10:02 christiankaindl