// Type definitions for ui/Repeater import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef"; import * as React from "react"; type Omit = Pick>; type Merge = Omit> & N; export interface RepeaterBaseProps { /** * Component type to repeat. * * This can be a React component or a string describing a DOM node (e.g. `'div'` ). */ childComponent: string | React.ComponentType; /** * An array of data to be mapped onto the `childComponent` . * * This supports two data types. If an array of strings is provided, the strings will be used in the generated `childComponent` as the readable text. If an array of objects is provided, each object will be spread onto the generated `childComponent` with no interpretation. You'll be responsible for setting properties like `disabled` , `className` , and setting the text content using the `children` key. * * NOTE : When an array of objects is provided, make sure a unique `key` is assigned to each data. See for more information. */ children: string[] | { key: number | string; [propName: string]: any }[]; /** * The property on each `childComponent` that receives the data in `children` . */ childProp?: string; /** * Component type to wrap around all the repeated elements. * * This can be a string describing a DOM node or React component (e.g. `'div'` or `Layout` ). */ component?: string | React.ComponentType; /** * Called with a reference to the root component. * * When using , the `ref` prop is forwarded to this component as `componentRef` . */ componentRef?: object | Function; /** * The property on each `childComponent` that receives the index of the item in the `Repeater` . */ indexProp?: string; /** * An object containing properties to be passed to each child. */ itemProps?: object; } /** * A stateless component that stamps out copies of `childComponent` , without applied. */ export class RepeaterBase extends React.Component< Merge, RepeaterBaseProps> > {} export interface RepeaterDecoratorProps extends ui_ForwardRef_ForwardRefProps {} export function RepeaterDecorator

( Component: React.ComponentType

| string, ): React.ComponentType

; export interface RepeaterProps extends Omit< Merge, "componentRef" > {} /** * A stateless component that stamps out copies of `childComponent` . */ export class Repeater extends React.Component< Merge, RepeaterProps> > {} export default Repeater;