algoliasearch-client-javascript icon indicating copy to clipboard operation
algoliasearch-client-javascript copied to clipboard

Add `multipleQueries` method to type definition for `algoliasearch/lite`

Open marcelgerber opened this issue 5 years ago • 1 comments

Hi!

I noticed when using algoliasearch/lite in TypeScript that there is no type definition for multipleQueries, even though it is clearly exported and is actually the same as search.

Here's where the algoliasearch-lite methods are defined: https://github.com/algolia/algoliasearch-client-javascript/blob/c6e8718c103680fafc2e5d365a5669fa3ea90520/packages/algoliasearch/src/builds/browserLite.ts#L59-L66

And there's the type definition file for alogliasearch/[email protected]: https://unpkg.com/browse/[email protected]/dist/algoliasearch-lite.d.ts

Sadly I haven't yet figured out how exactly these type definitions are getting generated, otherwise I would put up a PR myself. But fixing this would be greatly appreciated. Thanks.

marcelgerber avatar Aug 12 '20 17:08 marcelgerber

The types are computed from https://github.com/algolia/algoliasearch-client-javascript/blob/master/packages/algoliasearch/src/builds/browserLite.ts#L93 which is missing those functions, it indeed makes sense to add them, we'd be happy to accept a pull request to add it.

Looking at this code again, I wonder what would happen if we make SearchClient inferred instead of a type which is returned?

Haroenv avatar Aug 13 '20 09:08 Haroenv