import { RuleConfig, OptionItem, SelectionValuePrimitive, SelectionValue, OptionKey } from '../types'; declare type ErrorItem = { type: 'required' | 'max' | 'min' | 'optionMin' | 'optionMax' | 'requireOneOf' | 'mutex'; message: string; _key?: OptionKey; }; declare type InnerOptionItem = OptionItem & { _key: OptionKey; _label: string; selected: boolean; quantity: number; disabled: boolean; }; export default function useSelectionController(props: { dataSource?: OptionItem[]; ruleConfig?: RuleConfig; fieldNames?: { label?: string; value?: string; cover?: string; }; mode?: 'single' | 'multiple'; valueType?: 'primitive' | 'object'; value?: SelectionValuePrimitive | SelectionValue; defaultValue?: SelectionValuePrimitive | SelectionValue; onChange?: (value: SelectionValuePrimitive | SelectionValue) => void; }): { state: { options: InnerOptionItem[]; values: SelectionValue; errors: Array; validated: boolean; quantityInfo: { showQuantity: boolean; maxReached: boolean; remainingCount: number; selectedCount: number; }; }; actions: { toggle: (optionKey: OptionKey) => void; update: (optionKey: OptionKey, payload?: any) => void; setValue: (value: SelectionValuePrimitive | SelectionValue) => void; clear: () => void; validate: () => Promise; reset: () => void; }; }; export {};