Skip to content

Commit

Permalink
FIX (types): update type definitions for methods closes #53 thanks to
Browse files Browse the repository at this point in the history
…@lopesc

*  FIX (types): update type definitions for methods

* Update types.d.ts

* FIX (types): update event type

* FIX (types): add null as option for event params
  • Loading branch information
lopesc authored and sanusart committed Nov 22, 2019
1 parent 4b5e21c commit 5e31adb
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions types.d.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import React from 'react';
import { React, SyntheticEvent, KeyboardEvent } from 'react';

export interface IState {
dropdown: boolean;
values: object;
search: string;
selectBounds: object;
cursor: object;
cursor: number;
}

export interface IMethods {
removeItem: () => void;
dropDown: () => void;
removeItem: (event: SyntheticEvent | null, item: IItemRenderer['item'], close: boolean) => void;
dropDown: (action: string, event: SyntheticEvent | null) => void;
addItem: (item: IItemRenderer['item']) => void;
setSearch: () => void;
getInputSize: () => void;
setSearch: (event: SyntheticEvent) => void;
getInputSize: () => number;
toggleSelectAll: () => void;
clearAll: () => void;
selectAll: () => void;
searchResults: () => void;
getSelectRef: () => void;
isSelected: () => void;
getSelectBounds: () => void;
areAllSelected: () => void;
handleKeyDown: () => void;
getSelectRef: () => React.RefObject;
isSelected: (item: IItemRenderer['item']) => boolean;
getSelectBounds: () => ClientRect;
areAllSelected: () => boolean;
handleKeyDown: (event: KeyboardEvent) => void;
activeCursorItem: () => void;
createNew: () => void;
sortBy: () => void;
safeString: () => void;
createNew: (item: IItemRenderer['item']) => void;
sortBy: () => ISelectProps['options'];
safeString: (input: string) => string;
}

export interface IRenderer<T extends object = object> {
Expand All @@ -36,7 +36,7 @@ export interface IRenderer<T extends object = object> {
}

export interface IKeyDown<T extends object = object> {
event: Event;
event: KeyboardEvent;
props?: ISelectProps<T>;
state?: IState;
methods?: IMethods;
Expand Down

0 comments on commit 5e31adb

Please sign in to comment.