@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
25 lines • 891 B
TypeScript
interface UseControlledList<T> {
/** Initial value for uncontrolled state */
defaultValue?: T[];
/** Value for controlled state */
value?: T[];
/** Controlled state onChange handler */
onChange?: (values: T[]) => void;
}
interface ListHandlers<T> {
/** Appends the item at the end of the list */
append: (item: T) => void;
/** Removes the item at the index from the list */
remove: (index: number) => void;
/** Moves the item at the "from" position to another position within the list */
reorder: ({ from, to }: {
from: number;
to: number;
}) => void;
}
/**
* Manage a list of items in a controlled fashion, to be used with inputs
*/
export declare const useControlledList: <T>({ defaultValue, value, onChange }: UseControlledList<T>) => [T[], ListHandlers<T>];
export {};
//# sourceMappingURL=useControlledList.d.ts.map