react-use/lib/useList.d.ts
2019-02-07 11:58:29 +00:00

10 lines
329 B
TypeScript

export interface Actions<T> {
set: (list: T[]) => void;
updateAt: (index: number, item: 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;