-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(create-instantsearch-app): support Autocomplete in InstantSearch…
….js template (#5857) Co-authored-by: Dhaya <154633+dhayab@users.noreply.github.com>
- Loading branch information
1 parent
771deea
commit 4a27e5b
Showing
8 changed files
with
269 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/create-instantsearch-app/src/templates/InstantSearch.js/src/global.d.ts.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
{{#if flags.autocomplete}} | ||
import { autocomplete } from '@algolia/autocomplete-js'; | ||
import { createLocalStorageRecentSearchesPlugin } from '@algolia/autocomplete-plugin-recent-searches'; | ||
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions'; | ||
{{/if}} | ||
import algoliasearch from 'algoliasearch/lite'; | ||
import instantsearch from 'instantsearch.js/dist/instantsearch.production.min'; | ||
|
||
declare global { | ||
interface Window { | ||
algoliasearch: typeof algoliasearch; | ||
instantsearch: typeof instantsearch; | ||
{{#if flags.autocomplete}} | ||
'@algolia/autocomplete-js': { | ||
autocomplete: typeof autocomplete; | ||
}; | ||
'@algolia/autocomplete-plugin-recent-searches': { | ||
createLocalStorageRecentSearchesPlugin: typeof createLocalStorageRecentSearchesPlugin; | ||
}; | ||
'@algolia/autocomplete-plugin-query-suggestions': { | ||
createQuerySuggestionsPlugin: typeof createQuerySuggestionsPlugin; | ||
}; | ||
{{/if}} | ||
} | ||
} |