import * as React from 'react'; import type { HasRootRef } from '../types'; type InjectProps = React.HTMLAttributes & React.Attributes & { ref?: React.Ref; }; type ExpectedReactElement = React.ReactElement & React.DOMAttributes>; type ChildrenElement = ExpectedReactElement | React.ReactNode; /** * Хук позволяет пропатчить переданный компонент так, чтобы можно было получить ссылку на его * DOM-элемент. Также есть возможность прокинуть дополнительные параметры. * * @param children * @param injectProps * @param externRef – полезен когда нужно прокинуть `ref` элементу выше. * * 👎 Без параметра `externRef` * ```ts * const { ref } = useSomeHook(); * const [childRef, child] = usePatchChildren(children); * React.useLayoutEffect(() => { * ref.current = childRef.current; // или ref.current(childRef.current) * }, [childRef]); * ``` * * 👍 С параметром `externRef` * ```ts * const { ref } = useSomeHook(); * const [childRef, child] = usePatchChildren(children, undefined, ref); * ``` */ export declare const usePatchChildren: (children?: ChildrenElement, injectProps?: InjectProps, externRef?: React.Ref) => [React.RefObject, ChildrenElement | undefined]; export {}; //# sourceMappingURL=usePatchChildren.d.ts.map