import * as React from 'react'; /** * Removes 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 {RemoveChildrenByTypeConfig} [config={ customTypeKey: '__TYPE' }] - The configuration params * @returns {T[]} - All non-matching children * @example * // Removes all occurrences of ToDo (custom component), div, and React Fragment * removeChildrenByType(children, ['ToDo', 'div', 'react.fragment']); * * // Removes all occurrences of MyComponent (custom component - from import), a div, and React Fragment * import MyComponent from './MyComponent'; * removeChildrenByType(children, [MyComponent, 'div', 'react.fragment']); * * // Removes all occurrences of MyComponent (custom component - as React.ReactNode), a div, and React Fragment * const component = getChildByType(['MyComponent']); * removeChildrenByType(children, [component, 'div', 'react.fragment']); * * // Removes all occurrences of ToDo (custom component) with a customized {customTypeKey} * removeChildrenByType(children, ['ToDo'], { customTypeKey: 'myTypeKey' }); */ export declare const removeChildrenByType: (children: T, types: TC | TC[], { customTypeKey }?: RemoveChildrenByTypeConfig) => T[]; /** * Removes all children by specified type (deep search) * * @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 {RemoveChildrenByTypeConfig} [{ customTypeKey: '__TYPE' }] - The configuration params * @returns {T[]} - All non-matching children * @example * // Removes all occurrences of ToDo (custom component), div, and React Fragment * removeChildrenByTypeDeep(children, ['ToDo', 'div', 'react.fragment']); * * // Removes all occurrences of MyComponent (custom component - full component passed in), a div, and React Fragment * import MyComponent from './MyComponent'; * removeChildrenByTypeDeep(children, [MyComponent, 'div', 'react.fragment']); * * // Removes all occurrences of MyComponent (custom component - as React.ReactNode), a div, and React Fragment * const component = getChildByType(['MyComponent']); * removeChildrenByTypeDeep(children, [component, 'div', 'react.fragment']); * * // Removes all occurrences of ToDo (custom component) with a customized {customTypeKey} * removeChildrenByTypeDeep(children, ['ToDo'], { customTypeKey: 'myTypeKey' }); */ export declare const removeChildrenByTypeDeep: (children: T, types: TC | TC[], { customTypeKey }?: RemoveChildrenByTypeConfig) => T[]; export declare type RemoveChildrenByTypeConfig = { customTypeKey?: string; };