Is the layer option mandatory? Looking at the code it seems to me that the Draw interaction does not require a layer. If it's optional the property should be defined like this:

```
 * @property {ol.layer.Vector|undefined} layer
```