import { DomContents } from './domComputed'; import { MaybeObsArray } from './obsArray'; /** * Creates DOM elements for each element of an observable array. As the array is changed, children * are added or removed. This works for any array-valued observable, and for obsArray() and * computedArray() it works more efficiently for simple changes. * * The given itemCreateFunc() should return a single DOM node for each item, or null to skip that * item. It is called for new items whenever they are spliced in, or the array replaced. The * forEach() owns the created nodes, and runs domDispose() on them when they are spliced out. * * If the created nodes are removed from their parent externally, forEach() will cope with it, but * will consider these elements as no longer owned, and will not run domDispose() on them. * * Note that itemCreateFunc() is called with an index as the second argument, but that index is * only accurate at the time of the call, and will stop reflecting the true index if more items * are inserted or removed before it. * * If you'd like to map the DOM node back to its source item, use dom.data() and dom.getData() in * itemCreateFunc(). */ export declare function forEach(obsArray: MaybeObsArray, itemCreateFunc: (item: T, index: number) => Node | null): DomContents;