This documentation is archived and is not being maintained.
<signature> (JavaScript)
Visual Studio 2012
Groups a set of related elements for a function or method to provide documentation for overloaded functions.
<signature externalid="id" externalFile="filename" helpKeyword="keyword" locid="descriptionID" ></signature>
Use one <signature> element for each overloaded function description in the .js file, or use one <signature> element for each external member ID specified.
The <signature> element must be placed in the function body before any statements. When using <summary> (JavaScript), <param> (JavaScript), or <returns> (JavaScript) elements with the <signature> element, place the other elements inside the <signature> block.
The following code example shows how to use the <signature> element.
// Use of <signature> with externalid.
// Requires use of the <loc> tag to identify the external functions.
function illuminate(light) {
/// <signature externalid='M:Windows.Devices.Light.Illuminate()' />
/// <signature externalid='M:Windows.Devices.Light.Illuminate(System.Int32)'>
/// <param name='light' type='Number' />
/// </signature>
}
// Use of <signature> for overloads implemented in JavaScript.
function add(a, b) {
/// <signature>
/// <summary>function summary 1</summary>
/// <param name="a" type="Number">The first number</param>
/// <param name="b" type="Number">The second number</param>
/// <returns type="Number" />
/// </signature>
/// <signature>
/// <summary>function summary 2 – differ by number of params</summary>
/// <param name="a" type="Number">Only 1 parameter</param>
/// <returns type="Number" />
/// </signature>
/// <signature>
/// <summary>function summary 3 – differ by parameter type</summary>
/// <param name="a" type="Number">Number parameter</param>
/// <param name="b" type="String">String parameter</param>
/// <returns type="Number" />
/// </signature>
/// <signature>
/// <summary>function summary 4 – differ by return type</summary>
/// <param name="a" type="Number">The first number</param>
/// <param name="b" type="Number">The second number</param>
/// <returns type="String" />
/// </signature>
return a + b;
}
Show: