Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): correct type for SearchClient #1195

Merged
merged 1 commit into from Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,7 +2,10 @@ import * as ClientSearch from '@algolia/client-search';
import type * as AlgoliaSearch from 'algoliasearch/lite';

// turns any to unknown, so it can be used as a conditional
type AnyToUnknown<TSubject> = (any extends TSubject ? true : false) extends true
// https://github.com/algolia/instantsearch/blob/18959b47f2f541f410e091a0cb7140f40e0956c2/packages/algoliasearch-helper/types/algoliasearch.d.ts#L14-L18
type AnyToUnknown<TSubject> = (
0 extends 1 & TSubject ? true : false
) extends true
? unknown
: TSubject;

Expand Down