@tempots/dom
Version:
Fully-typed frontend framework alternative to React and Angular
16 lines (15 loc) • 763 B
TypeScript
import { TNode, Renderable } from '../types/domain';
import { Signal } from '../std/signal';
import { ElementPosition } from '../std/element-position';
import { Value } from '../std/value';
/**
* Renders a list of items based on a signal of arrays.
*
* @typeParam T - The type of items in the array.
* @param value - The signal of arrays to iterate over.
* @param item - The function that renders each item in the array.
* @param separator - The function that renders the separator between items.
* @returns - The renderable function that renders the list of items.
* @public
*/
export declare const ForEach: <T>(value: Value<T[]>, item: (value: Signal<T>, position: ElementPosition) => TNode, separator?: (pos: ElementPosition) => TNode) => Renderable;