/** * Utility to render a series of items as Elements into a container * * @param {Object} opts - Repeat options * @param {ServerElement} opts.container - Container into which to render repeated items * @param {any[]} opts.items - Array of items which are used to create/update elements * @param {string} opts.html - HTML template which will be used to create elements * @param {((value: any, index: number) => string)} opts.keyFn - Key function which is used to create unique id for each item/element * @param {import("../types").Target[]} [opts.targets] - How to update an element when an item changes * @param { ((el: ServerElement, item?: any, index?: number) => void) | null} [opts.init] - function to apply when an element is first created * @param {import("../types").Registry} [opts.registry] - Object of tag names to Wafer component definitions * @returns */ export function repeat({ container, items, html, keyFn, targets, init, registry, }: { container: ServerElement; items: any[]; html: string; keyFn: (value: any, index: number) => string; targets?: import("../types").Target[] | undefined; init?: ((el: ServerElement, item?: any, index?: number | undefined) => void) | null | undefined; registry?: { [x: string]: import("../types").RegistryEntry; } | undefined; }): Promise; /** * Take a target DOM element and a selector to apply to that element * and run a function on every match. A promise is returned so that * the result can be `await`ed - important in the server context * where we want all asynchronous updates can complete before the * response is sent * * @param {Element|import("./wafer").default} el * @param {string} selector * @param {(el: Element|import("./element").ServerElement) => void} func * * @returns {Promise} */ export function apply(el: Element | import("./wafer").default, selector: string, func: (el: Element | import("./element").ServerElement) => void): Promise; import { ServerElement } from "./element.js";