import { ReactNode } from 'react';
export declare type Key = number | string;
export declare type KeyMap = Map<Key, boolean>;
export declare type ChildrenMap = Map<Key, ReactNode>;
export interface GroupContext {
    selectedKeyMap?: KeyMap;
    selectedKeys?: Key[];
    toggleKey: (key: Key, selected?: boolean) => void;
    toggleKeys: (keys: Key[], selected: boolean) => void;
    multiple?: boolean;
    subGroupMap?: SubGroupMap;
}
export declare const defaultContext: GroupContext;
export declare type SelectedStatus = 'NONE' | 'ALL' | 'PART' | 'UNKNOWN';
export declare type SubGroupMap = Map<Key, {
    validKeys: Key[];
    disabledKeys: Key[];
}>;
/**
 * @param selectedKeys all selected keys
 * @param onChange callback when selectedKeys change
 */
declare const useGroup: (selectedKeys: Key[], onChange: (keys: Key[], selectedStatus?: SelectedStatus | undefined) => void, multiple?: boolean, validKeys?: Key[] | undefined, disabledKeys?: Key[] | undefined, subGroupMap?: SubGroupMap | undefined) => [GroupContext, SelectedStatus, () => void];
/**
 * @param key key of this item
 * @param groupContext context
 * @param selected selected prop from item
 */
declare const useItem: (key: Key, groupContext: GroupContext, selected?: boolean) => [boolean, (selected?: boolean | undefined) => void];
/**
 * @param groupContext context from group
 * @param validKeys valid wrapped item keys
 * @param disabledKeys disabled wrapped item keys
 */
declare const useSubGroup: (key: Key, groupContext: GroupContext) => [SelectedStatus, () => void];
declare const groupChildrenAsDataSource: (children: ReactNode, globalDisabled?: boolean, { itemTag, subGroupTag, itemKeyName, subGroupKeyName }?: {
    itemTag: string;
    subGroupTag?: string | undefined;
    itemKeyName: string;
    subGroupKeyName?: string | undefined;
}) => [Key[], Key[], ReactNode, SubGroupMap, ChildrenMap];
export { useGroup, useItem, useSubGroup, groupChildrenAsDataSource };
