Microsoft is working on better code completion in Visual Studio using special, annotated JavaScript source files. This should work great for libraries that are used heavily by lots of programmers.
You can take a look at an annotated version of JQuery here:
http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2-vsdoc2.js
The documentation for the attr function e.g. looks like this:
attr: function( name, value, type ) {
/// <summary>
/// Set a single property to a computed value, on all matched elements.
/// Instead of a value, a function is provided, that computes the value.
/// Part of DOM/Attributes
/// </summary>
/// <returns type="jQuery" />
/// <param name="name" type="String">
/// The name of the property to set.
/// </param>
/// <param name="value" type="Function">
/// A function returning the value to set.
/// </param>
..
}
Writing all this XML in your own JavaScript files may however be somewhat overkill.