UNPKG

599 BTypeScriptView Raw
1declare const useDynamicList: <T>(initialList?: T[]) => {
2 list: T[];
3 insert: (index: number, item: T) => void;
4 merge: (index: number, items: T[]) => void;
5 replace: (index: number, item: T) => void;
6 remove: (index: number) => void;
7 getKey: (index: number) => number;
8 getIndex: (key: number) => number;
9 move: (oldIndex: number, newIndex: number) => void;
10 push: (item: T) => void;
11 pop: () => void;
12 unshift: (item: T) => void;
13 shift: () => void;
14 sortList: (result: T[]) => T[];
15 resetList: (newList: T[]) => void;
16};
17export default useDynamicList;