From 10b89752c31992937d229d7aa3ff56fa3ad3580d Mon Sep 17 00:00:00 2001 From: ngorin Date: Fri, 3 Nov 2023 18:15:21 +0300 Subject: [PATCH] refactor: fix types --- src/hooks/private/useRadioGroup/useRadioGroup.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/hooks/private/useRadioGroup/useRadioGroup.ts b/src/hooks/private/useRadioGroup/useRadioGroup.ts index 85c51cc849..09ea31eae8 100644 --- a/src/hooks/private/useRadioGroup/useRadioGroup.ts +++ b/src/hooks/private/useRadioGroup/useRadioGroup.ts @@ -3,6 +3,16 @@ import React from 'react'; import {useUniqId} from '../..'; import type {ControlGroupOption, ControlGroupProps} from '../../../components/types'; +interface OptionsProps + extends Omit< + ControlGroupProps, + 'options' | 'defaultValue' | 'aria-label' | 'aria-labelledby' | 'onUpdate' | 'value' + > { + value: string; + checked: boolean; + content: ControlGroupOption['content']; +} + export type UseRadioGroupProps = ControlGroupProps; export type UseRadioGroupResult = { @@ -10,11 +20,7 @@ export type UseRadioGroupResult = { role: string; 'aria-disabled': ControlGroupProps['disabled']; }; - optionsProps: Omit< - ControlGroupProps, - 'options' | 'defaultValue' | 'aria-label' | 'aria-labelledby' | 'onUpdate' - > & - {checked: boolean; content: ControlGroupOption['content']}[]; + optionsProps: OptionsProps[]; }; export function useRadioGroup(props: UseRadioGroupProps): UseRadioGroupResult {