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"
Description
In #2831 the dependency on
@algolia/autocomplete-corehas been moved todevDependencies, 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,
paramshas typeany, because TypeScript can't figure out the types since they are not available in node modules anymore:In v4.4,
paramshas typeAutocompleteOptionsfound in node modules, and we can autocomplete on the params attributes with the IDEExpected 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"