import { type ComponentType, type FC, type PropsWithoutRef, type PropsWithRef, type RefAttributes } from 'react'; /** * Gets all available ref types from two prop sets and returns * them in a ref prop * * @example * ``` * type P1 = { ref: Ref(HTMLDivElement), ... }; * type P2 = { ref: Ref(HTMLSpanElement), ... }; * * GetRefAttributes(P1, P2) // {ref: Ref(HTMLDivElement | HTMLSpanElement)} * ``` */ type GetRefAttributes = A extends RefAttributes ? B extends RefAttributes ? RefAttributes : RefAttributes : B extends RefAttributes ? RefAttributes : unknown; /** * Returns one of components depending on a boolean condition. * The result component will be a union of the two props and * an or on both ref types. * * @example * ``` * const Component = componentWithCondition( * isBooleanConditionMet, * ComponentWithConditionMet, * ComponentWithConditionNotMet, * ); * * @param condition Function returning boolean value * @param componentTrue Component that will be returned if conditionGetter is "true" * @param componentFalse Component that will be returned if conditionGetter is "false" * @returns Component Depending on a Condition result */ export declare function componentWithCondition(condition: () => boolean, ComponentTrue: ComponentType, ComponentFalse: ComponentType): FC & PropsWithoutRef & GetRefAttributes, PropsWithRef>>; export {};