algolia / algolia/autocomplete

SearchOptions does not exist

Closed Beginner friendly
#1,320 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
341
Avg merge
3d 1h
Merged PRs (30d)
5

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used [patch-package](https://github.com/ds300/patch-package) to patch `@algolia/autocomplete-plugin-recent-searches@1.19.2` for the project I'm working on.

I had an import problem since SearchOptions doesn't exist.

Here is the diff that solved my problem:

```diff
diff --git a/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createRecentSearchesPlugin.d.ts b/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createRecentSearchesPlugin.d.ts
index da5907f..62151b8 100644
--- a/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createRecentSearchesPlugin.d.ts
+++ b/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createRecentSearchesPlugin.d.ts
@@ -1,6 +1,6 @@
import { PluginSubscribeParams } from '@algolia/autocomplete-core';
import { AutocompleteSource, AutocompleteState, AutocompletePlugin } from '@algolia/autocomplete-js';
-import { SearchOptions } from '@algolia/client-search';
+import { SearchParams } from '@algolia/client-search';
import { RecentSearchesItem, Storage, StorageApi, AutocompleteRecentSearchesPluginTranslations } from './types';
export interface RecentSearchesPluginData extends StorageApi {
/**
@@ -11,7 +11,7 @@ export interface RecentSearchesPluginData exte
* - Using a shared `hitsPerPage` value to get a group limit of Query Suggestions and recent searches.
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-plugin-recent-searches/createLocalStorageRecentSearchesPlugin/#param-getalgoliasearchparams
*/
- getAlgoliaSearchParams(params?: SearchOptions): SearchOptions;
+ getAlgoliaSearchParams(params?: SearchParams): SearchParams;
}
export declare type CreateRecentSearchesPluginParams = {
/**
```

This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).

Contributor guide

Open the contributing guide

Research direction

Start with dist/esm/createRecentSearchesPlugin.d.ts and inspect the @algolia/client-search type imported by getAlgoliaSearchParams. Verify the declaration uses a type that exists in the installed client-search package, then run the package's type-check or build validation to confirm the import problem is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.