* If the id was provided to `useCompoundItem`, this will be the same value.
6
* Otherwise, this will be a value generated by the `id` function.
7
*/
8
id: Key | undefined;
9
/**
10
* The 0-based index of the child component in the parent component's list of registered children.
11
*/
12
index: number;
13
/**
14
* The total number of child components registered with the parent component.
15
* This value will be correct after the effect phase of the component (as children are registered with the parent during the effect phase).
16
*/
17
totalItemCount: number;
18
}
19
/**
20
* Registers a child component with the parent component.
21
*
22
* @param id A unique key for the child component. If the `id` is `undefined`, the registration logic will not run (this can sometimes be the case during SSR).
23
* This can be either a value, or a function that generates a value based on already registered siblings' ids.
24
* If a function, it's called with the set of the ids of all the items that have already been registered.
25
* Return `existingKeys.size` if you want to use the index of the new item as the id.
26
* @param itemMetadata Arbitrary metadata to pass to the parent component. This should be a stable reference (for example a memoized object), to avoid unnecessary re-registrations.