import React from 'react'; import type { ReactNode } from 'react'; import type { SemanticClassNamesType, SemanticStylesType } from '../_util/hooks'; export type CheckableTagOption = { value: CheckableTagValue; label: ReactNode; }; interface CheckableTagGroupSingleProps { multiple?: false; value?: CheckableTagValue | null; defaultValue?: CheckableTagValue | null; onChange?: (value: CheckableTagValue | null) => void; } interface CheckableTagGroupMultipleProps { multiple: true; value?: CheckableTagValue[]; defaultValue?: CheckableTagValue[]; onChange?: (value: CheckableTagValue[]) => void; } export type SemanticName = keyof TagGroupSemanticClassNames & keyof TagGroupSemanticStyles; export type TagGroupSemanticClassNames = { root?: string; item?: string; }; export type TagGroupSemanticStyles = { root?: React.CSSProperties; item?: React.CSSProperties; }; type CheckableTagGroupBaseProps = { prefixCls?: string; rootClassName?: string; options?: (CheckableTagOption | CheckableTagValue)[]; disabled?: boolean; } & (CheckableTagGroupSingleProps | CheckableTagGroupMultipleProps) & Pick, 'className' | 'style' | 'id' | 'role'> & { [key: `data-${string}`]: any; [key: `aria-${string}`]: any; }; export type CheckableTagGroupClassNamesType = SemanticClassNamesType, TagGroupSemanticClassNames>; export type CheckableTagGroupStylesType = SemanticStylesType, TagGroupSemanticStyles>; export type CheckableTagGroupProps = CheckableTagGroupBaseProps & { classNames?: CheckableTagGroupClassNamesType; styles?: CheckableTagGroupStylesType; }; export interface CheckableTagGroupRef { nativeElement: HTMLDivElement; } declare const CheckableTagGroup: ((props: CheckableTagGroupProps & { ref?: React.Ref; }) => React.ReactElement) & { displayName?: string; }; export default CheckableTagGroup;