import React from "react"; /** * Extracts plain text content from a React node. * * This utility recursively traverses a React node structure to extract all text content, * handling strings, numbers, arrays, and React elements. Non-text content like fragments * or components without text children will return an empty string. * * @param node - A React node which can be a string, number, element, array, or fragment * * @returns The extracted text content as a string, or an empty string if no text is found * * @example * ```typescript * // Extracts simple strings * extractTextFromNode('Hello World') // returns 'Hello World' * * // Extracts from React elements * extractTextFromNode(Username) // returns 'Username' * * // Handles nested structures * extractTextFromNode(
First Second
) // returns 'First Second' * * // Returns empty for null/undefined * extractTextFromNode(null) // returns '' * ``` */ declare function extractTextFromNode(node: React.ReactNode): string; export default extractTextFromNode;