UNPKG

@yandex/ui

Version:

Yandex UI components

21 lines (20 loc) 718 B
import { FocusEventHandler, MouseEventHandler, ComponentType, ComponentClass, Ref } from 'react'; export interface IWithControlProps<T = Element> { disabled?: boolean; focused?: boolean; onBlur?: FocusEventHandler<T>; onFocus?: FocusEventHandler<T>; onMouseDown?: MouseEventHandler<T>; onMouseUp?: MouseEventHandler<T>; pressed?: boolean; /** * Ссылка на дом-ноду нативного контрола. */ controlRef?: Ref<T>; } export interface IWithControlState { disabled?: boolean; focused?: boolean; pressed?: boolean; } export declare function withControl<T extends IWithControlProps>(WrappedComponent: ComponentType<T>): ComponentClass<T>;