import * as React from 'react'; /** * Gets all children by specified type * * @since v1.0.0 (modified v2.0.0) * @template T * @template TC * @param {T} children - JSX children * @param {TC | TC[]} types - Types of children to match * @param {GetChildrenByTypeConfig} [config={ customTypeKey: '__TYPE' }] - The configuration params * @returns {T[]} - Array of matching children * @example * // Finds all occurrences of ToDo (custom component), div, and React Fragment * getChildrenByType(children, ['ToDo', 'div', 'react.fragment']); * * // Finds all occurrences of MyComponent (custom component - full component passed in), a div, and React Fragment * import MyComponent from './MyComponent'; * getChildrenByType(children, [MyComponent, 'div', 'react.fragment']); * * // Finds all occurrences of ToDo (custom component) with a customized {customTypeKey} * getChildrenByType(children, ['ToDo'], { customTypeKey: 'myTypeKey' }); */ export declare const getChildrenByType: (children: T, types: TC | TC[], { customTypeKey }?: GetChildrenByTypeConfig) => T[]; /** * Gets all children by specified type (deep search) * * @since v1.0.0 (modified v2.0.0) * @template TC * @param {T} children - JSX children * @param {TC | TC[]} types - Types of children to match * @param {GetChildrenByTypeConfig} [{ customTypeKey: '__TYPE', skipWhenFound: false }] - The configuration params * @returns {T[]} - Array of matching children * @example * // Finds all occurrences of ToDo (custom component), div, and React Fragment * getChildrenByTypeDeep(children, ['ToDo', 'div', 'react.fragment']); * * // Finds all occurrences of MyComponent (custom component - full component passed in), a div, and React Fragment * import MyComponent from './MyComponent'; * getChildrenByTypeDeep(children, [MyComponent, 'div', 'react.fragment']); * * // Finds all occurrences of ToDo (custom component) with a customized {customTypeKey} * getChildrenByTypeDeep(children, ['ToDo'], { customTypeKey: 'myTypeKey' }); */ export declare const getChildrenByTypeDeep: (children: T, types: TC | TC[], { customTypeKey, skipWhenFound }?: GetChildrenByTypeConfig) => T[]; export declare type GetChildrenByTypeConfig = { customTypeKey?: string; skipWhenFound?: boolean; };