import * as React from 'react'; import { As } from './types'; export declare type PropsWithAs = Props & Omit, 'as' | keyof Props> & { as?: Type; }; export interface ComponentWithAs { (props: PropsWithAs & { as: Type; }): JSX.Element; (props: PropsWithAs): JSX.Element; } declare type ReactRef = React.Ref | React.RefObject | React.MutableRefObject; export declare function setRef(ref: React.Ref | undefined, value: T): void; /** * Assigns a value to a ref function or object * * @param ref the ref to assign to * @param value the value */ export declare function assignRef(ref: ReactRef | undefined, value: T): void; /** * Combine multiple React refs into a single ref function. * This is used mostly when you need to allow consumers forward refs to * internal components * * @param refs refs to assign to value to */ export declare function mergeRefs(...refs: (ReactRef | undefined)[]): (node: T | null) => void; export declare function forwardRefWithAs(component: React.ForwardRefRenderFunction): ComponentWithAs; /** * Gets only the valid children of a component, * and ignores any nullish or falsy child. * * @param children the children */ export declare function cleanChildren(children: React.ReactChildren | React.ReactNode): React.ReactElement[]; /** * Get a list of all children matching the specified type(s) * @param children * @param type */ export declare function filterChildren(children: React.ReactChildren | React.ReactNode, type: any | any[]): Array; /** * Get a list of children, including those within Fragments * @param children */ export declare function flattenChildren(children: React.ReactChildren | React.ReactNode): Array; export {};