The option map which the js library expects has many optional fields like username(string), password(string).
 directoryEntry(Entry)  (non optional).

Additional question. When I tried to pass the dart DirectoryEntry it was passed as DartProxy rather than an object and it failed in the js code. What is the right way to pass dart DirectoryEntry to js code.

the code I was using was

<code>
DirectoryEntry entry;
var options = js.jsify( {
  "dir" : entry,
  "url" :"http://foo.com"
});
</code>