Skip to content

Missing addForFacetValue in the SearchClient makes im not compatible for typescript users #460

@bidoubiwa

Description

@bidoubiwa

Description

see #48
Thanks a lot to @haoyun for raising this

When using typescript a searchClient has to response to the search client interface

export type SearchClient = {
  search: DefaultSearchClient['search'];
  searchForFacetValues: DefaultSearchClient['searchForFacetValues'];
  addAlgoliaAgent?: DefaultSearchClient['addAlgoliaAgent'];
  initIndex?: (
    indexName: string
  ) => SearchIndex extends { findAnswers: any }
    ? Partial<Pick<SearchIndex, 'findAnswers'>>
    : SearchIndex;
};

Accessible here: https://github.com/algolia/instantsearch.js/blob/16cc34155d8af25893db3e521b4a1da26ce591e4/src/types/algoliasearch.ts#L33-L42

Until recently it was an optional method.

Expected behavior
The method should be present to make instantMeiliSearch usable with typescript

Current behavior
As the method is missing it does not work on typescript projects

Environment (please complete the following information):

  • instantsearch.js version: [e.g. v4.23.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions