type UseListActions = { set: (newList: T[] | ((previous: T[]) => T[])) => void; push: (item: T) => void; removeAt: (index: number) => void; insertAt: (index: number, item: T) => void; updateAt: (index: number, item: T) => void; clear: () => void; reset: () => void; }; type UseListReturn = readonly [T[], UseListActions]; /** * Hook for managing array state with helper methods * * @template T - The type of array elements * @param initialList - Initial array (default: []) * @returns Tuple of [list, { set, push, removeAt, insertAt, updateAt, clear, reset }] * * @example * ```tsx * const TodoList = () => { * const [todos, { push, removeAt, clear }] = useList([]); * return ( *
* {todos.map((todo, i) => ( *
* {todo} * *
* ))} * * *
* ); * }; * ``` */ export declare function useList(initialList?: T[]): UseListReturn; export {}; //# sourceMappingURL=useList.d.ts.map