import * as React from 'react'; import { IDescendantDepth } from '../types'; /** * Gets the depth to the first descendant (or self) of each root child that match the specified types * * @since v2.6.0 * @template T * @template TC * @param {T} children - JSX children * @param {TC | TC[]} types - Types of children to match * @param {GetDescendantDepthByTypeConfig} [config={ customTypeKey: '__TYPE' }] - The configuration params * @returns {IDescendantDepth[]} - The oldest ancestor with the depth to the matching descendant * @example * // Gets depth for all descendants that are of type ToDo (custom component), div, or React Fragment * getDescendantDepthByType(children, ['ToDo', 'div', 'react.fragment']); * * // Gets depth for all descendants that are of type MyComponent (custom component - full component passed in), a div, and React Fragment * import MyComponent from './MyComponent'; * getDescendantDepthByType(children, [MyComponent, 'div', 'react.fragment']); * * // Gets depth for all descendants that are of type ToDo (custom component) with a customized {customTypeKey} * getDescendantDepthByType(children, ['ToDo'], { customTypeKey: 'myTypeKey' }); */ export declare const getDescendantDepthByType: (children: T, types: TC | TC[], { customTypeKey }?: GetDescendantDepthByTypeConfig) => IDescendantDepth[]; export declare type GetDescendantDepthByTypeConfig = { customTypeKey?: string; };