diff --git a/types.d.ts b/types.d.ts index 3f9ff170..f571eff0 100644 --- a/types.d.ts +++ b/types.d.ts @@ -29,34 +29,34 @@ export interface IMethods { safeString: () => void; } -export interface IRenderer { - props?: ISelectProps; +export interface IRenderer { + props?: ISelectProps; state?: IState; methods?: IMethods; } -export interface IKeyDown { +export interface IKeyDown { event: Event; - props?: ISelectProps; + props?: ISelectProps; state?: IState; methods?: IMethods; setState?: () => void; } -export interface IItemRenderer { +export interface IItemRenderer { item?: T; itemIndex?: number; - props?: ISelectProps; + props?: ISelectProps; state?: IState; methods?: IMethods; } -export interface ISelectProps { +export interface ISelectProps { className?: string; addPlaceholder?: string; placeholder?: string; - values: object[]; - options: object[]; + values: T[]; + options: T[]; multi?: boolean; disabled?: boolean; searchBy?: string; @@ -92,21 +92,21 @@ export interface ISelectProps { onClearAll?: () => void; onSelectAll?: () => void; onCreateNew?: () => void; - searchFn?: ({ props, state, methods }: IRenderer) => object[]; - handleKeyDownFn?: ({ event, props, state, methods, setState }: IKeyDown) => void; - clearRenderer?: ({ props, state, methods }: IRenderer) => void; - contentRenderer?: ({ props, state, methods }: IRenderer) => void; - dropdownRenderer?: ({ props, state, methods }: IRenderer) => void; - dropdownHandleRenderer?: ({ props, state, methods }: IRenderer) => void; - inputRenderer?: ({ props, state, methods }: IRenderer) => void; - itemRenderer?: ({ item, itemIndex, props, state, methods }: IItemRenderer) => void; - loadingRenderer?: ({ props }: IItemRenderer) => void; - noDataRenderer?: ({ props, state, methods }: IRenderer) => void; - optionRenderer?: ({ item, props, state, methods }: IItemRenderer) => void; - separatorRenderer?: ({ props, state, methods }: IRenderer) => void; - additionalProps?: object; + searchFn?: ({ props, state, methods }: IRenderer) => T[]; + handleKeyDownFn?: ({ event, props, state, methods, setState }: IKeyDown) => void; + clearRenderer?: ({ props, state, methods }: IRenderer) => void; + contentRenderer?: ({ props, state, methods }: IRenderer) => void; + dropdownRenderer?: ({ props, state, methods }: IRenderer) => void; + dropdownHandleRenderer?: ({ props, state, methods }: IRenderer) => void; + inputRenderer?: ({ props, state, methods }: IRenderer) => void; + itemRenderer?: ({ item, itemIndex, props, state, methods }: IItemRenderer) => void; + loadingRenderer?: ({ props }: IItemRenderer) => void; + noDataRenderer?: ({ props, state, methods }: IRenderer) => void; + optionRenderer?: ({ item, props, state, methods }: IItemRenderer) => void; + separatorRenderer?: ({ props, state, methods }: IRenderer) => void; + additionalProps?: T; } -declare const Select: React.SFC; +declare const Select: React.SFC>; export default Select;