-
Notifications
You must be signed in to change notification settings - Fork 435
Open
Description
Description
In #2831 the dependency on @algolia/autocomplete-core has been moved to devDependencies, but I believe this was the wrong decision.
The DocSearch/react API relies on these types in its API contract.
When the types are unavailable, inference breaks.
Steps to reproduce
In v4.5, params has type any, because TypeScript can't figure out the types since they are not available in node modules anymore:
import type {DocSearchModalProps} from '@docsearch/react';
const navigator: DocSearchModalProps['navigator'] = {
navigate(params) {
params.whateverIWant;
},
};In v4.4, params has type AutocompleteOptions found in node modules, and we can autocomplete on the params attributes with the IDE
import type {DocSearchModalProps} from '@docsearch/react';
const navigator: DocSearchModalProps['navigator'] = {
navigate(params) {
params.state;
},
};Expected behavior
Types that are part of the DocSearch React publicly accessible API should be in dependencies (even if they are not directly re-exported, they are still accessible and useful to users).
I suspect this
Environment
"@docsearch/react": "^4.5.3"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels