From 4606eb58d364cebdc4b8084aab43a2204bd3249e Mon Sep 17 00:00:00 2001 From: lopesc Date: Tue, 12 Nov 2019 18:43:49 +0000 Subject: [PATCH] FIX (types): fix item type for IItemRenderer (#47) Fix IItemRenderer interface to make item type generic and update addItem interface to include item as a parameter --- types.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types.d.ts b/types.d.ts index 9586edb7..3f9ff170 100644 --- a/types.d.ts +++ b/types.d.ts @@ -11,7 +11,7 @@ export interface IState { export interface IMethods { removeItem: () => void; dropDown: () => void; - addItem: () => void; + addItem: (item: IItemRenderer['item']) => void; setSearch: () => void; getInputSize: () => void; toggleSelectAll: () => void; @@ -43,8 +43,8 @@ export interface IKeyDown { setState?: () => void; } -export interface IItemRenderer { - item?: number; +export interface IItemRenderer { + item?: T; itemIndex?: number; props?: ISelectProps; state?: IState;