react-use/lib/useList.d.ts
2018-10-28 14:30:17 +01:00

9 lines
281 B
TypeScript

export interface Actions<T> {
set: (list: T[]) => void;
push: (item: T) => void;
filter: (fn: (value: T) => boolean) => void;
sort: (fn?: (a: T, b: T) => number) => void;
}
declare const useList: <T>(initialList?: T[]) => [T[], Actions<T>];
export default useList;