Skip to content

Commit

Permalink
fix(recent-searches): type getTemplates internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Nov 4, 2020
1 parent 8fcff45 commit 1ff6a0d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { SourceTemplates } from '@algolia/autocomplete-js';

import { recentIcon, resetIcon } from './icons';
import { RecentSearchesItem } from './types';

export type GetTemplatesParams = {
onRemove(id: string): void;
};

export function getTemplates({ onRemove }: GetTemplatesParams) {
export function getTemplates<TItem extends RecentSearchesItem>({
onRemove,
}: GetTemplatesParams): SourceTemplates<TItem>['templates'] {
return {
item({ item, root }) {
const content = document.createElement('div');
Expand Down

0 comments on commit 1ff6a0d

Please sign in to comment.