How to use DataDefinition::create('list')? This answer links to a list of all possible types that can be used with DataDefinition::create().

One plugin that can be used is ItemList.

But I can't find any documentation on how to define what items are on the list.

I would have expected something like this:

$status_definition = DataDefinition::create('list')
  -&gt;setLabel(new TranslatableMarkup('Status'))
  -&gt;setRequired(TRUE)
  -&gt;setListItems([
    1 =&gt; 'One',
    2 =&gt; 'Two',
    3 =&gt; 'Three',
  ]);


But the method setListItems (or anything similar) does not exist.

For some more context I'm following this article on how to extend the entity reference field type but instead of adding an integer field I want to add a list field.
ItemList is a generic base class. List is used here in the context of multivalued field items. Because Drupal has no separate class for single value fields (they are multivalued fields restricted to one value), this generic list data type is used in all Drupal fields.

When you look at the list of field types

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21Annotation%21FieldType.php/class/annotations/FieldType/8.4.x

you'll find ListStringItem, where List is used in the context you are probably looking for and you can use this as an example for this kind of field types implementing OptionsProviderInterface.