reblendjs
Version:
ReblendJs uses Reactjs pradigm to build UI components, with isolated state for each components.
18 lines (17 loc) • 704 B
TypeScript
/**
* Deeply flattens an array or set of elements.
*
* @template T
* @param {T[] | Set<T>} data - The data to flatten.
* @returns {T[]} A flattened array of elements.
*/
export declare function deepFlat<T>(data: T[] | Set<T>): T[];
/**
* Flattens a nested array or set of virtual nodes (VNode) and adds the result to the `containerArr`.
*
* @template T
* @param {(T | T[])[] | Set<T | T[]>} arr - The array or set of VNode children to flatten.
* @param {T[]} [containerArr=[]] - The container array to store flattened nodes.
* @returns {T[]} The flattened array of VNode children.
*/
export declare function flattenVNodeChildren<T>(arr: (T | T[])[] | Set<T | T[]>, containerArr?: T[]): T[];