Skip to content

Commit 1ff6a0d

Browse files
fix(recent-searches): type getTemplates internal function
1 parent 8fcff45 commit 1ff6a0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/autocomplete-plugin-recent-searches/src/getTemplates.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
import { SourceTemplates } from '@algolia/autocomplete-js';
2+
13
import { recentIcon, resetIcon } from './icons';
4+
import { RecentSearchesItem } from './types';
25

36
export type GetTemplatesParams = {
47
onRemove(id: string): void;
58
};
69

7-
export function getTemplates({ onRemove }: GetTemplatesParams) {
10+
export function getTemplates<TItem extends RecentSearchesItem>({
11+
onRemove,
12+
}: GetTemplatesParams): SourceTemplates<TItem>['templates'] {
813
return {
914
item({ item, root }) {
1015
const content = document.createElement('div');

0 commit comments

Comments
 (0)