Compound field that includes a file field
A file field is an entity reference field pointing to the File entity (or in D8.4 to the Media entity). To build such a file field extend FileItem (which parent is EntityReferenceItem). An example for this would be the image field ImageItem, which is a compound field adding properties like title, alt, height and width:

ImageItem::propertyDefinitions()

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
    $properties = parent::propertyDefinitions($field_definition);

    unset($properties['display']);
    unset($properties['description']);

    $properties['alt'] = DataDefinition::create('string')
      -&gt;setLabel(t('Alternative text'))
      -&gt;setDescription(t("Alternative image text, for the image's 'alt' attribute."));

    $properties['title'] = DataDefinition::create('string')
      -&gt;setLabel(t('Title'))
      -&gt;setDescription(t("Image title text, for the image's 'title' attribute."));

    $properties['width'] = DataDefinition::create('integer')
      -&gt;setLabel(t('Width'))
      -&gt;setDescription(t('The width of the image in pixels.'));

    $properties['height'] = DataDefinition::create('integer')
      -&gt;setLabel(t('Height'))
      -&gt;setDescription(t('The height of the image in pixels.'));

    return $properties;
  }


The properties for the referencing part are inherited from the parent.