WinJS typings - are they complete?

Topics: General
Feb 28, 2013 at 10:39 PM
I'm working in VS2012 with the TypeScript 0.8.3 extension and the typings available from the downloads section, writing a Windows Store JavaScript project.

The following light up as errors:
///<reference path='typings/winjs.d.ts'/>

var list = new WinJS.Binding.List(); // <-- error, I need to put in [] to get past it

var list2 = new WinJS.Binding.List([]);
var filtered = list2.filter(function (item) { return true; }); // <-- error, "filter does not exist"
var len = list2.length; // <-- error, "length does not exist"

var myxhr = WinJS.xhr({ url: "#url" }); // <-- error, wants all optional params

var myxhr2 = WinJS.xhr({ url: "#url", type: "GET", user: "", password: "", headers: null, data: null, responseType: "text" }); // <-- works, but slightly verbose eh?
The filter method and length property should be valid according to and having to put in [] to new up a List feels wrong. Also the xhr method should only have url as a required option acording to

I guess my question is if there is any reason behind this or if the WinJS typing downloadable from this site is just work in progress? And if there is a more complete WinJS typing available?
Mar 1, 2013 at 3:10 PM
There's another thread on this here:

In short, we're looking into ways to improve the default library typings, especially with generics coming.