Java input:
@JsFunction
public interface TransportFactory {
Transport create(Options options);
}
@JsNullable
public TransportFactory transportFactory
Resulting field:
transportFactory?:(options:Options)=>Transport|null;
The type of that field is incorrect - as written it says that the function might return null, instead of saying that the field is allowed to be null. Correct options could be
Put the null first:
transportFactory?:null|(options:Options)=>Transport;
Add parens around functions if they are going to be unioned
transportFactory?:((options:Options)=>Transport)|null;