import { TemplateResult } from '../processor/template-result'; /** * Key function: extracts a unique key from an item. */ export type KeyFn = (item: T, index: number) => unknown; /** * Template function: produces a TemplateResult for an item. */ export type TemplateFn = (item: T, index: number) => TemplateResult; /** * Marker object returned by repeat(). Detected by NodeBinding * to trigger keyed reconciliation instead of full teardown+rebuild. */ export declare class RepeatResult { readonly items: readonly unknown[]; readonly keyFn: KeyFn; readonly templateFn: TemplateFn; constructor(items: readonly unknown[], keyFn: KeyFn, templateFn: TemplateFn); } /** * Keyed list rendering directive. * * Usage: * ```ts * html` *
    * ${repeat( * this.items, * item => item.id, * (item, index) => html`
  • ${item.name}
  • ` * )} *
* ` * ``` * * When items change, the diff algorithm: * - Reuses DOM for items with the same key (calls instance.update()) * - Creates new DOM only for genuinely new items * - Removes DOM only for items that disappeared * - Moves DOM nodes to match the new order * * This is dramatically faster than the default array rendering * which tears down and rebuilds all DOM on every update. * * @param items - The array of items to render * @param keyFn - Function that returns a unique key for each item * @param templateFn - Function that returns a TemplateResult for each item */ export declare function repeat(items: readonly T[], keyFn: KeyFn, templateFn: TemplateFn): RepeatResult; //# sourceMappingURL=repeat.d.ts.map