import { HTMLAttributes } from 'react'; import { TCheckboxOption } from '../Checkbox'; export interface IState { availableList: TCheckboxOption[]; activeList: TCheckboxOption[]; checkedAvailable: string[]; checkedActive: string[]; } export type TLists = 'activeList' | 'availableList'; export type TAction = { type: 'SET_INITIAL_LISTS'; available: TCheckboxOption[]; active: TCheckboxOption[]; } | { type: 'MOVE_ALL_TO_ACTIVE'; } | { type: 'SELECT_ALL_ACTIVE'; event: React.ChangeEvent; } | { type: 'SELECT_ALL_AVAILABLE'; event: React.ChangeEvent; } | { type: 'MOVE_ALL_TO_AVAILABLE'; } | { type: 'MOVE_AVAILABLE_TO_ACTIVE'; } | { type: 'MOVE_ACTIVE_TO_AVAILABLE'; } | { type: 'DRAG_END'; oldIndex: number; newIndex: number; list: TLists; } | { type: 'TOGGLE_CHECK'; list: TLists; isChecked: boolean; id: string; }; export interface ITransferProps extends HTMLAttributes { /** * show or hide the headers in each of the transfer lists * @default false */ noHeaders?: boolean; /** * show or hide the buttons to move all items between the lists * @default true */ hasMoveAllButtons?: boolean; /** * set the custom label for the active list */ availableLabel: string; /** * set the custom label for the available list */ activeLabel: string; /** * set the active items * @default [] */ active: TCheckboxOption[]; /** * set the available items * @default [] */ available: TCheckboxOption[]; /** * Control the drag and drop functionality. * Accepts a boolean to enable/disable for both sides, * or an object to specify for each side. * @default false */ isDraggable?: boolean | { active: boolean; available: boolean; }; /** * callback function that is triggered when the active items change */ onActiveChange?: (activeItems: TCheckboxOption[]) => void; /** * callback function that is triggered when the available items change */ onAvailableChange?: (availableItems: TCheckboxOption[]) => void; } export interface ITransferItemProps { /** * each item needs a unique id */ id: string; /** * the label for the item */ label: React.ReactNode; /** * whether the item is checked */ checked: boolean; /** * show or hide the drag and drop functionality * @default false */ isDraggable?: boolean; /** * callback function that is triggered when the checked state changes */ onChange: (e: React.ChangeEvent) => void; } //# sourceMappingURL=types.d.ts.map