From f674ffa0aea7c40523be64b0e903f81632d630aa Mon Sep 17 00:00:00 2001 From: serkan-inci Date: Fri, 6 Nov 2015 04:00:45 -0500 Subject: [PATCH] Adding declare files for M90. --- typings/jquery.d.ts | 3212 ++++ typings/knockout.d.ts | 387 + typings/q.d.ts | 390 + typings/vss.d.ts | 41586 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 45575 insertions(+) create mode 100644 typings/jquery.d.ts create mode 100644 typings/knockout.d.ts create mode 100644 typings/q.d.ts create mode 100644 typings/vss.d.ts diff --git a/typings/jquery.d.ts b/typings/jquery.d.ts new file mode 100644 index 0000000..75d6184 --- /dev/null +++ b/typings/jquery.d.ts @@ -0,0 +1,3212 @@ +// Type definitions for jQuery 1.10.x / 2.0.x +// Project: http://jquery.com/ +// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/* ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/** + * Interface for the AJAX setting that will configure the AJAX request + */ +interface JQueryAjaxSettings { + /** + * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + */ + accepts?: any; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). + */ + async?: boolean; + /** + * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + */ + beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + complete? (jqXHR: JQueryXHR, textStatus: string): any; + /** + * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) + */ + contents?: { [key: string]: any; }; + //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" + // https://github.com/borisyankov/DefinitelyTyped/issues/742 + /** + * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. + */ + contentType?: any; + /** + * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). + */ + context?: any; + /** + * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) + */ + converters?: { [key: string]: any; }; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) + */ + crossDomain?: boolean; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + */ + data?: any; + /** + * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. + */ + dataFilter? (data: any, ty: any): any; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). + */ + dataType?: string; + /** + * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + */ + error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; + /** + * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. + */ + global?: boolean; + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) + */ + headers?: { [key: string]: any; }; + /** + * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. + */ + ifModified?: boolean; + /** + * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) + */ + isLocal?: boolean; + /** + * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } + */ + jsonp?: any; + /** + * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. + */ + jsonpCallback?: any; + /** + * A mime type to override the XHR mime type. (version added: 1.5.1) + */ + mimeType?: string; + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + /** + * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. + */ + processData?: boolean; + /** + * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + */ + scriptCharset?: string; + /** + * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) + */ + statusCode?: { [key: string]: any; }; + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; + /** + * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. + */ + timeout?: number; + /** + * Set this to true if you wish to use the traditional style of param serialization. + */ + traditional?: boolean; + /** + * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. + */ + type?: string; + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + username?: string; + /** + * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. + */ + xhr?: any; + /** + * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) + */ + xhrFields?: { [key: string]: any; }; +} + +/** + * Interface for the jqXHR object + */ +interface JQueryXHR extends XMLHttpRequest, JQueryPromise { + /** + * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). + */ + overrideMimeType(mimeType: string): any; + /** + * Cancel the request. + * + * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" + */ + abort(statusText?: string): void; + /** + * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. + */ + then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; + /** + * Property containing the parsed response if the response Content-Type is json + */ + responseJSON?: any; +} + +/** + * Interface for the JQuery callback + */ +interface JQueryCallback { + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function): JQueryCallback; + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function[]): JQueryCallback; + + /** + * Disable a callback list from doing anything more. + */ + disable(): JQueryCallback; + + /** + * Determine if the callbacks list has been disabled. + */ + disabled(): boolean; + + /** + * Remove all of the callbacks from a list. + */ + empty(): JQueryCallback; + + /** + * Call all of the callbacks with the given arguments + * + * @param arguments The argument or list of arguments to pass back to the callback list. + */ + fire(...arguments: any[]): JQueryCallback; + + /** + * Determine if the callbacks have already been called at least once. + */ + fired(): boolean; + + /** + * Call all callbacks in a list with the given context and arguments. + * + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. + */ + fireWith(context?: any, ...args: any[]): JQueryCallback; + + /** + * Determine whether a supplied callback is in a list + * + * @param callback The callback to search for. + */ + has(callback: Function): boolean; + + /** + * Lock a callback list in its current state. + */ + lock(): JQueryCallback; + + /** + * Determine if the callbacks list has been locked. + */ + locked(): boolean; + + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function): JQueryCallback; + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function[]): JQueryCallback; +} + +/** + * Allows jQuery Promises to interop with non-jQuery promises + */ +interface JQueryGenericPromise { + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; +} + +/** + * Interface for the JQuery promise/deferred callbacks + */ +interface JQueryPromiseCallback { + (value?: T, ...args: any[]): void; +} + +interface JQueryPromiseOperator { + (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; +} + + +/** + * Interface for the JQuery promise, part of callbacks + */ +interface JQueryPromise extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +} + +/** + * Interface for the JQuery deferred, part of callbacks + */ +interface JQueryDeferred extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given args. + * + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notify(value?: any, ...args: any[]): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * + * @param context Context passed to the progressCallbacks as the this object. + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notifyWith(context: any, value?: any, ...args: any[]): JQueryDeferred; + + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * + * @param args Optional arguments that are passed to the failCallbacks. + */ + reject(value?: any, ...args: any[]): JQueryDeferred; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + */ + rejectWith(context: any, value?: any, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * + * @param value First argument passed to doneCallbacks. + * @param args Optional subsequent arguments that are passed to the doneCallbacks. + */ + resolve(value?: T, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + */ + resolveWith(context: any, value?: T, ...args: any[]): JQueryDeferred; + + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + */ + promise(target?: any): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +} + +/** + * Interface of the JQuery extension of the W3C event object + */ +interface BaseJQueryEventObject extends Event { + data: any; + delegateTarget: Element; + isDefaultPrevented(): boolean; + isImmediatePropagationStopped(): boolean; + isPropagationStopped(): boolean; + namespace: string; + originalEvent: Event; + preventDefault(): any; + relatedTarget: Element; + result: any; + stopImmediatePropagation(): void; + stopPropagation(): void; + target: Element; + pageX: number; + pageY: number; + which: number; + metaKey: boolean; +} + +interface JQueryInputEventObject extends BaseJQueryEventObject { + altKey: boolean; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; +} + +interface JQueryMouseEventObject extends JQueryInputEventObject { + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} + +interface JQueryKeyEventObject extends JQueryInputEventObject { + char: any; + charCode: number; + key: any; + keyCode: number; +} + +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { +} + +/** TFS Customization **/ +interface JQueryEventHandler { + (eventObject: JQueryEventObject, args?: any): any; +} + +/* + Collection of properties of the current browser +*/ + +interface JQuerySupport { + ajax?: boolean; + boxModel?: boolean; + changeBubbles?: boolean; + checkClone?: boolean; + checkOn?: boolean; + cors?: boolean; + cssFloat?: boolean; + hrefNormalized?: boolean; + htmlSerialize?: boolean; + leadingWhitespace?: boolean; + noCloneChecked?: boolean; + noCloneEvent?: boolean; + opacity?: boolean; + optDisabled?: boolean; + optSelected?: boolean; + scriptEval? (): boolean; + style?: boolean; + submitBubbles?: boolean; + tbody?: boolean; +} + +interface JQueryParam { + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + */ + (obj: any): string; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + */ + (obj: any, traditional: boolean): string; +} + +/** + * The interface used to construct jQuery events (with $.Event). It is + * defined separately instead of inline in JQueryStatic to allow + * overriding the construction function with specific strings + * returning specific event objects. + */ +interface JQueryEventConstructor { + (name: string, eventProperties?: any): JQueryEventObject; + new (name: string, eventProperties?: any): JQueryEventObject; +} + +/** + * The interface used to specify coordinates. + */ +interface JQueryCoordinates { + left: number; + top: number; +} + +/** + * Elements in the array returned by serializeArray() + */ +interface JQuerySerializeArrayElement { + name: string; + value: string; +} + +interface JQueryAnimationOptions { + /** + * A string or number determining how long the animation will run. + */ + duration?: any; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to call once the animation is complete. + */ + complete?: Function; + /** + * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?: (now: number, tween: any) => any; + /** + * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) + */ + progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; + /** + * A function to call when the animation begins. (version added: 1.8) + */ + start?: (animation: JQueryPromise) => any; + /** + * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) + */ + done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) + */ + fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) + */ + always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: any; + /** + * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) + */ + specialEasing?: Object; +} + +/** + * Static members of jQuery (those on $ and jQuery themselves) + */ +interface JQueryStatic { + + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + */ + ajax(settings: JQueryAjaxSettings): JQueryXHR; + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param url A string containing the URL to which the request is sent. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + */ + ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; + + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param dataTypes An optional string containing one or more space-separated dataTypes + * @param handler A handler to set default values for future Ajax requests. + */ + ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param handler A handler to set default values for future Ajax requests. + */ + ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + + ajaxSettings: JQueryAjaxSettings; + + /** + * Set default values for future Ajax requests. Its use is not recommended. + * + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + */ + ajaxSetup(options: JQueryAjaxSettings): void; + + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + */ + get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + */ + get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + */ + getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + */ + getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + */ + getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + */ + param: JQueryParam; + + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + */ + post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + */ + post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + + /** + * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + * + * @param flags An optional list of space-separated flags that change how the callback list behaves. + */ + Callbacks(flags?: string): JQueryCallback; + + /** + * Holds or releases the execution of jQuery's ready event. + * + * @param hold Indicates whether the ready hold is being requested or released + */ + holdReady(hold: boolean): void; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + */ + (selector: string, context?: Element|JQuery): JQuery; + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param element A DOM element to wrap in a jQuery object. + */ + (element: Element): JQuery; + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + */ + (elementArray: Element[]): JQuery; + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object A plain object to wrap in a jQuery object. + */ + (object: {}): JQuery; + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object An existing jQuery object to clone. + */ + (object: JQuery): JQuery; + /** + * Specify a function to execute when the DOM is fully loaded. + */ + (): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. + * @param ownerDocument A document in which the new elements will be created. + */ + (html: string, ownerDocument?: Document): JQuery; + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string defining a single, standalone, HTML element (e.g.
or
). + * @param attributes An object of attributes, events, and methods to call on the newly-created element. + */ + (html: string, attributes: Object): JQuery; + + /** + * Binds a function to be executed when the DOM has finished loading. + * + * @param callback A function to execute after the DOM is ready. + */ + (callback: Function): JQuery; + + /** + * Relinquish jQuery's control of the $ variable. + * + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + */ + noConflict(removeAll?: boolean): Object; + + /** + * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * + * @param deferreds One or more Deferred objects, or plain JavaScript objects. + */ + when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; + + /** + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + */ + cssHooks: { [key: string]: any; }; + cssNumber: any; + css(e: any, propertyName: string, value?: any): JQuery; + css(e: any, propertyName: any, value?: any): JQuery; + + /** + * Store arbitrary data associated with the specified element. Returns the value that was set. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @param value The new data value. + */ + data(element: Element, key: string, value: T): T; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + */ + data(element: Element, key: string): any; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + */ + data(element: Element): any; + + /** + * Execute the next function on the queue for the matched element. + * + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(element: Element, queueName?: string): void; + + /** + * Determine whether an element has any jQuery data associated with it. + * + * @param element A DOM element to be checked for data. + */ + hasData(element: Element): boolean; + + /** + * Show the queue of functions to be executed on the matched element. + * + * @param element A DOM element to inspect for an attached queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(element: Element, queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(element: Element, queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element on which to add a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue. + */ + queue(element: Element, queueName: string, callback: Function): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + */ + removeData(element: Element, name?: string): JQuery; + + /** + * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + * + * @param beforeStart A function that is called just before the constructor returns. + */ + Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; + + /** + * Effects + */ + fx: { + tick: () => void; + /** + * The rate (in milliseconds) at which animations fire. + */ + interval: number; + stop: () => void; + speeds: { slow: number; fast: number; }; + /** + * Globally disable all animations. + */ + off: boolean; + step: any; + }; + + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param fnction The function whose context will be changed. + * @param context The object to which the context (this) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + */ + proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param context The object to which the context (this) of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + */ + proxy(context: Object, name: string, ...additionalArguments: any[]): any; + + Event: JQueryEventConstructor; + + /** + * Takes a string and throws an exception containing it. + * + * @param message The message to send out. + */ + error(message: any): JQuery; + + expr: any; + fn: any; //TODO: Decide how we want to type this + + isReady: boolean; + + // Properties + support: JQuerySupport; + + /** + * Check to see if a DOM element is a descendant of another DOM element. + * + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + */ + contains(container: Element, contained: Element): boolean; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: T[], + callback: (indexInArray: number, valueOfElement: T) => any + ): any; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: any, + callback: (indexInArray: any, valueOfElement: any) => any + ): any; + + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(target: any, object1?: any, ...objectN: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; + + /** + * Execute some JavaScript code globally. + * + * @param code The JavaScript code to execute. + */ + globalEval(code: string): any; + + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * + * @param array The array to search through. + * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. + * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. + */ + grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; + + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array. + */ + inArray(value: T, array: T[], fromIndex?: number): number; + + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + */ + isArray(obj: any): boolean; + /** + * Check to see if an object is empty (contains no enumerable properties). + * + * @param obj The object that will be checked to see if it's empty. + */ + isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a Javascript function object. + * + * @param obj Object to test whether or not it is a function. + */ + isFunction(obj: any): boolean; + /** + * Determines whether its argument is a number. + * + * @param obj The value to be tested. + */ + isNumeric(value: any): boolean; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * + * @param obj The object that will be checked to see if it's a plain object. + */ + isPlainObject(obj: any): boolean; + /** + * Determine whether the argument is a window. + * + * @param obj Object to test whether or not it is a window. + */ + isWindow(obj: any): boolean; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * + * @param node he DOM node that will be checked to see if it's in an XML document. + */ + isXMLDoc(node: Node): boolean; + + /** + * Convert an array-like object into a true JavaScript array. + * + * @param obj Any object to turn into a native Array. + */ + makeArray(obj: any): any[]; + + /** + * Translate all items in an array or object to new array of items. + * + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + */ + map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; + /** + * Translate all items in an array or object to new array of items. + * + * @param arrayOrObject The Array or Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + */ + map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; + + /** + * Merge the contents of two arrays together into the first array. + * + * @param first The first array to merge, the elements of second added. + * @param second The second array to merge into the first, unaltered. + */ + merge(first: T[], second: T[]): T[]; + + /** + * An empty function. + */ + noop(): any; + + /** + * Return a number representing the current time. + */ + now(): number; + + /** + * Takes a well-formed JSON string and returns the resulting JavaScript object. + * + * @param json The JSON string to parse. + */ + parseJSON(json: string): any; + + /** + * Parses a string into an XML document. + * + * @param data a well-formed XML string to be parsed + */ + parseXML(data: string): XMLDocument; + + /** + * Remove the whitespace from the beginning and end of a string. + * + * @param str Remove the whitespace from the beginning and end of a string. + */ + trim(str: string): string; + + /** + * Determine the internal JavaScript [[Class]] of an object. + * + * @param obj Object to get the internal JavaScript [[Class]] of. + */ + type(obj: any): string; + + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + * + * @param array The Array of DOM elements. + */ + unique(array: Element[]): Element[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; + + /******************************************************************************* + * START TFS Customizations + ********************************************************************************/ + //Event(...args: any[]): JQueryEventObject; + //map(jquery: JQuery, callback: (elementOfArray: any, indexInArray: any) => any): any[]; + postMessage(stringifiedJson: string, targetUrl: string, contentWindow: JQuery); + receiveMessage(callback: (event: any) => any); + + ui: any; + Widget: any; + widget: any; + jqplot: any; + connection: any; + + /******************************************************************************* + * END TFS Customizations + ********************************************************************************/ +} + +/** + * The jQuery instance members + */ +interface JQuery { + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * + * @param handler The function to be invoked. + */ + ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxStart(handler: () => any): JQuery; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxStop(handler: () => any): JQuery; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + + /** + * Load data from the server and place the returned HTML into the matched element. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + */ + load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; + + /** + * Encode a set of form elements as a string for submission. + */ + serialize(): string; + /** + * Encode a set of form elements as an array of names and values. + */ + serializeArray(): JQuerySerializeArrayElement[]; + + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + */ + addClass(className: string): JQuery; + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + */ + addClass(func: (index: number, className: string) => string): JQuery; + + /** + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + */ + addBack(selector?: string): JQuery; + + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + */ + attr(attributeName: string): string; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param value A value to set for the attribute. + */ + attr(attributeName: string, value: string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. + */ + attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributes An object of attribute-value pairs to set. + */ + attr(attributes: Object): JQuery; + + /** + * Determine whether any of the matched elements are assigned the given class. + * + * @param className The class name to search for. + */ + hasClass(className: string): boolean; + + /** + * Get the HTML contents of the first element in the set of matched elements. + */ + html(): string; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + */ + html(htmlString: string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + html(func: (index: number, oldhtml: string) => string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + + /** + * Get the value of a property for the first element in the set of matched elements. + * + * @param propertyName The name of the property to get. + */ + prop(propertyName: string): any; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param value A value to set for the property. + */ + prop(propertyName: string, value: string|number|boolean): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + prop(properties: Object): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. + */ + prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; + + /** + * Remove an attribute from each element in the set of matched elements. + * + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + */ + removeAttr(attributeName: string): JQuery; + + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + */ + removeClass(className?: string): JQuery; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + */ + removeClass(func: (index: number, className: string) => string): JQuery; + + /** + * Remove a property for the set of matched elements. + * + * @param propertyName The name of the property to remove. + */ + removeProp(propertyName: string): JQuery; + + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + */ + toggleClass(className: string, swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param swtch A boolean value to determine whether the class should be added or removed. + */ + toggleClass(swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. + * @param swtch A boolean value to determine whether the class should be added or removed. + */ + toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; + + /** + * Get the current value of the first element in the set of matched elements. + */ + val(): any; + /** + * Set the value of each element in the set of matched elements. + * + * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. + */ + val(value: string|string[]): JQuery; + /** + * Set the value of each element in the set of matched elements. + * + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + val(func: (index: number, value: string) => string): JQuery; + + + /** + * Get the value of style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + */ + css(propertyName: string): string; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + */ + css(propertyName: string, value: string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + css(properties: Object): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements. + */ + height(): number; + /** + * Set the CSS height of every matched element. + * + * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). + */ + height(value: number|string): JQuery; + /** + * Set the CSS height of every matched element. + * + * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. + */ + height(func: (index: number, height: number) => number|string): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding but not border. + */ + innerHeight(): number; + + /** + * Sets the inner height on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding but not border. + */ + innerWidth(): number; + + /** + * Sets the inner width on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + */ + offset(): JQueryCoordinates; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + */ + offset(coordinates: JQueryCoordinates): JQuery; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. + */ + offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ + outerHeight(includeMargin?: boolean): number; + + /** + * Sets the outer height on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding and border. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ + outerWidth(includeMargin?: boolean): number; + + /** + * Sets the outer width on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + */ + position(): JQueryCoordinates; + + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. + */ + scrollLeft(): number; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ + scrollLeft(value: number): JQuery; + + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. + */ + scrollTop(): number; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ + scrollTop(value: number): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements. + */ + width(): number; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + width(value: number|string): JQuery; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. + */ + width(func: (index: number, width: number) => number|string): JQuery; + + /** + * Remove from the queue all items that have not yet been run. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + clearQueue(queueName?: string): JQuery; + + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + */ + data(key: string, value: any): JQuery; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + */ + data(obj: { [key: string]: any; }): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * + * @param key Name of the data stored. + */ + data(key: string): any; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + */ + data(): any; + + /** + * Execute the next function on the queue for the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(queueName?: string): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. + */ + /****TFS Customization****/ + removeData(name?: string): JQuery; + /****END TFS Customization****/ + + /** + * Remove a previously-stored piece of data. + * + * @param list An array of strings naming the pieces of data to delete. + */ + removeData(list: string[]): JQuery; + + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * + * @param type The type of queue that needs to be observed. (default: fx) + * @param target Object onto which the promise methods have to be attached + */ + promise(type?: string, target?: Object): JQueryPromise; + + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. (default: swing) + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param options A map of additional options to pass to the method. + */ + animate(properties: Object, options: JQueryAnimationOptions): JQuery; + + /** + * Set a timer to delay execution of subsequent items in the queue. + * + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + delay(duration: number, queueName?: string): JQuery; + + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param options A map of additional options to pass to the method. + */ + fadeIn(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param options A map of additional options to pass to the method. + */ + fadeOut(options: JQueryAnimationOptions): JQuery; + + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; + + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param options A map of additional options to pass to the method. + */ + fadeToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + * + * @param queue The name of the queue in which to stop animations. + */ + finish(queue?: string): JQuery; + + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + hide(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + show(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideDown(options: JQueryAnimationOptions): JQuery; + + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideUp(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation on the matched elements. + * + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + /** + * Stop the currently-running animation on the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + toggle(options: JQueryAnimationOptions): JQuery; + /** + * Display or hide the matched elements. + * + * @param showOrHide A Boolean indicating whether to show or hide the elements. + */ + toggle(showOrHide: boolean): JQuery; + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param events An object containing one or more DOM event types and functions to execute for them. + */ + bind(events: any): JQuery; + + /** TFS Customizations */ + bind(...events: any[]): JQuery; + + /** + * Trigger the "blur" event on an element + */ + blur(): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + blur(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "change" event on an element. + */ + change(): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + change(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "click" event on an element. + */ + click(): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + */ + click(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "dblclick" event on an element. + */ + dblclick(): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focus" event on an element. + */ + focus(): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focus(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + * + * @param handlerIn A function to execute when the mouse pointer enters the element. + * @param handlerOut A function to execute when the mouse pointer leaves the element. + */ + hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. + * + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + */ + hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "keydown" event on an element. + */ + keydown(): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keypress" event on an element. + */ + keypress(): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keyup" event on an element. + */ + keyup(): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + load(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "mousedown" event on an element. + */ + mousedown(): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseenter" event on an element. + */ + mouseenter(): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param handler A function to execute when the event is triggered. + */ + mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseleave" event on an element. + */ + mouseleave(): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param handler A function to execute when the event is triggered. + */ + mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mousemove" event on an element. + */ + mousemove(): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseout" event on an element. + */ + mouseout(): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseover" event on an element. + */ + mouseover(): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseup" event on an element. + */ + mouseup(): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Remove an event handler. + */ + off(): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + */ + off(events: { [key: string]: any; }, selector?: string): JQuery; + + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). + */ + on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param data An object containing data that will be passed to the event handler. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, data?: any): JQuery; + + + /** + * Specify a function to execute when the DOM is fully loaded. + * + * @param handler A function to execute after the DOM is ready. + */ + ready(handler: Function): JQuery; + + /* TFS Customization */ + ready(handler: any): JQuery; + + /** + * Trigger the "resize" event on an element. + */ + resize(): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + resize(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "scroll" event on an element. + */ + scroll(): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "select" event on an element. + */ + select(): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + select(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "submit" event on an element. + */ + submit(): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + submit(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(eventType: string, extraParameters?: any[]|Object): JQuery; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param event A jQuery.Event object. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; + + /** + * Execute all handlers attached to an element for an event. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(eventType: string, ...extraParameters: any[]): Object; + + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param handler The function that is to be no longer executed. + */ + unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). + */ + unbind(eventType: string, fls: boolean): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param evt A JavaScript event object as passed to an event handler. + */ + unbind(evt: any): JQuery; + + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + */ + undelegate(): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute at the time the event is triggered. + */ + undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param events An object of one or more event types and previously bound functions to unbind from them. + */ + undelegate(selector: string, events: Object): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param namespace A string containing a namespace to unbind all events from. + */ + undelegate(namespace: string): JQuery; + + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ + unload(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) + */ + context: Element; + + jquery: string; + + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ + error(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + */ + pushStack(elements: any[]): JQuery; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param arguments The arguments that were passed in to the jQuery method (for serialization). + */ + pushStack(elements: any[], name: string, arguments: any[]): JQuery; + + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + */ + after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + after(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + */ + append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + append(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. + */ + appendTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + */ + before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + before(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Create a deep copy of the set of matched elements. + * + * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. + * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). + */ + clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * param selector A selector expression that filters the set of matched elements to be removed. + */ + detach(selector?: string): JQuery; + + /** + * Remove all child nodes of the set of matched elements from the DOM. + */ + empty(): JQuery; + + /** + * Insert every element in the set of matched elements after the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. + */ + insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert every element in the set of matched elements before the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. + */ + insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. + */ + prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. + */ + prependTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + */ + remove(selector?: string): JQuery; + + /** + * Replace each target element with the set of matched elements. + * + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + */ + replaceAll(target: JQuery|any[]|Element|string): JQuery; + + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. + */ + replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param func A function that returns content with which to replace the set of matched elements. + */ + replaceWith(func: () => Element|JQuery): JQuery; + + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + */ + text(): string; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. + */ + text(text: string|number|boolean): JQuery; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. + */ + text(func: (index: number, text: string) => string): JQuery; + + /** + * Retrieve all the elements contained in the jQuery set, as an array. + */ + toArray(): any[]; + + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + */ + unwrap(): JQuery; + + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrap(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrap(func: (index: number) => string|JQuery): JQuery; + + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrapAll(wrappingElement: JQuery|Element|string): JQuery; + wrapAll(func: (index: number) => string): JQuery; + + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. + */ + wrapInner(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrapInner(func: (index: number) => string): JQuery; + + /** + * Iterate over a jQuery object, executing a function for each matched element. + * + * @param func A function to execute for each matched element. + */ + each(func: (index: number, elem: Element) => any): JQuery; + + /** + * Retrieve one of the elements matched by the jQuery object. + * + * @param index A zero-based integer indicating which element to retrieve. + */ + get(index: number): HTMLElement; + /** + * Retrieve the elements matched by the jQuery object. + */ + get(): any[]; + + /** + * Search for a given element from among the matched elements. + */ + index(): number; + /** + * Search for a given element from among the matched elements. + * + * @param selector A selector representing a jQuery collection in which to look for an element. + */ + index(selector: string|JQuery|Element): number; + + /** + * The number of elements in the jQuery object. + */ + length: number; + /** + * A selector representing selector passed to jQuery(), if any, when creating the original set. + * version deprecated: 1.7, removed: 1.9 + */ + selector: string; + [index: string]: any; + [index: number]: HTMLElement; + + /** + * Add elements to the set of matched elements. + * + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. + */ + add(selector: string, context?: Element): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param elements One or more elements to add to the set of matched elements. + */ + add(...elements: Element[]): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param html An HTML fragment to add to the set of matched elements. + */ + add(html: string): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param obj An existing jQuery object to add to the set of matched elements. + */ + add(obj: JQuery): JQuery; + + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + children(selector?: string): JQuery; + + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + */ + closest(selector: string): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ + closest(selector: string, context?: Element): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param obj A jQuery object to match elements against. + */ + closest(obj: JQuery): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param element An element to match elements against. + */ + closest(element: Element): JQuery; + + /** + * Get an array of all the elements and selectors matched against the current element up through the DOM tree. + * + * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ + closest(selectors: any, context?: Element): any[]; + + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + */ + contents(): JQuery; + + /** + * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + */ + end(): JQuery; + + /** + * Reduce the set of matched elements to the one at the specified index. + * + * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. + * + */ + eq(index: number): JQuery; + + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param selector A string containing a selector expression to match the current set of elements against. + */ + filter(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + filter(func: (index: number, element: Element) => any): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param element An element to match the current set of elements against. + */ + filter(element: Element): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + filter(obj: JQuery): JQuery; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param selector A string containing a selector expression to match elements against. + */ + find(selector: string): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param element An element to match elements against. + */ + find(element: Element): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param obj A jQuery object to match elements against. + */ + find(obj: JQuery): JQuery; + + /** + * Reduce the set of matched elements to the first in the set. + */ + first(): JQuery; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ + has(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + */ + has(contained: Element): JQuery; + + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ + is(selector: string): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. + */ + is(func: (index: number, element: Element) => boolean): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + is(obj: JQuery): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + is(elements: any): boolean; + + /** + * Reduce the set of matched elements to the final one in the set. + */ + last(): JQuery; + + /** + * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + * + * @param callback A function object that will be invoked for each element in the current set. + */ + map(callback: (index: number, domElement: Element) => any): JQuery; + + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + next(selector?: string): JQuery; + + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + nextAll(selector?: string): JQuery; + + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(selector?: string, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(element?: Element, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Remove elements from the set of matched elements. + * + * @param selector A string containing a selector expression to match elements against. + */ + not(selector: string): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + not(func: (index: number, element: Element) => boolean): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param elements One or more DOM elements to remove from the matched set. + */ + not(...elements: Element[]): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + not(obj: JQuery): JQuery; + + /** + * Get the closest ancestor element that is positioned. + */ + offsetParent(): JQuery; + + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + parent(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + parents(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(selector?: string, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(element?: Element, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + prev(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + prevAll(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(selector?: string, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(element?: Element, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + siblings(selector?: string): JQuery; + + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + */ + slice(start: number, end?: number): JQuery; + + /** + * Show the queue of functions to be executed on the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(callback: Function): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(queueName: string, callback: Function): JQuery; + + /******************************************************************************* + * START TFS Customizations + ********************************************************************************/ + button(...args: any[]): JQuery; + dialog(...args: any[]): JQuery; + droppable(...args: any[]): JQuery; + draggable(...args: any[]): JQuery; + autocomplete(...args: any[]): JQuery; + live(...args: any[]): JQuery; + has(...args: any[]): JQuery; + tabs(...args: any[]): JQuery; + sortable(...args: any[]): JQuery; + disableSelection(...args: any[]): JQuery; + error(...args: any[]): JQuery; + IdentityInput(...args: any[]): JQuery; + IdentitySearchControl(...args: any[]): JQuery; + HorizontalPanel(...args: any[]): JQuery; + /******************************************************************************* + * END TFS Customizations + ********************************************************************************/ +} +declare module "jquery" { + export = $; +} +declare var jQuery: JQueryStatic; +declare var $: JQueryStatic; \ No newline at end of file diff --git a/typings/knockout.d.ts b/typings/knockout.d.ts new file mode 100644 index 0000000..c53ae3d --- /dev/null +++ b/typings/knockout.d.ts @@ -0,0 +1,387 @@ +// Type definitions for Knockout 2.2 +// Project: http://knockoutjs.com +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Modified: Windows Azure Framework + +interface KnockoutDisposable { + dispose(): void; +} + +interface KnockoutSubscription extends KnockoutDisposable { + callback(value: T): void; + disposeCallback(): void; + target: KnockoutObservableBase; + isDisposed?: boolean; +} + +interface KnockoutObservableBase extends KnockoutSubscribable { + peek(): T; + (): T; + (value: T): void; +} + +interface KnockoutComputedOptions { + read?: () => T; + write?: (value: T, args: any) => void; + owner?: any; + disposeWhenNodeIsRemoved?: Element; + disposeWhen? (): boolean; + deferEvaluation?: boolean; +} + +interface KnockoutComputed extends KnockoutObservableBase, KnockoutDisposable { + getDependenciesCount(): number; + hasWriteFunction(): boolean; + isActive(): boolean; + dispose(): void; // Double-declaration is workaround for TypeScript bug with interface multiple inheritance +} + +interface KnockoutComputedStatic { + fn: KnockoutComputed; + + (func: () => T, context?: any, options?: KnockoutComputedOptions): KnockoutComputed; + (options?: KnockoutComputedOptions): KnockoutComputed; +} + +interface KnockoutObservable extends KnockoutObservableBase { + equalityComparer(a: T, b: T): boolean; + valueHasMutated(): void; + valueWillMutate(): void; +} + +interface KnockoutObservableArray extends KnockoutObservable { + // General Array functions + indexOf(searchElement: T, fromIndex?: number): number; + slice(start: number, end?: number): T[]; + splice(start: number, deleteCount?: number, ...items: T[]): T[]; + pop(): T; + push(...items: T[]): void; + shift(): T; + unshift(...items: T[]): number; + reverse(): T[]; + sort(compareFunction?: (a: T, b: T) => number): void; + + // Ko specific + replace(oldItem: T, newItem: T): void; + + remove(item: T): T[]; + remove(predicate: (item: T) => boolean): T[]; + removeAll(items?: T[]): T[]; + + destroy(item: T): void; + destroyAll(items?: T[]): void; + + subscribeArrayChanged(itemAddedCallback: (addedItem: T) => void, itemRemovedCallback: (removedItem: T) => void, context?: any): KnockoutSubscription[]; +} + +interface KnockoutObservableArrayStatic { + fn: KnockoutObservableArray; + + (value?: T[]): KnockoutObservableArray; +} + +interface KnockoutSubscribable { + extend(source: any): KnockoutObservableBase; + getSubscriptionsCount(): number; + subscribe(callback: (newValue: T) => void, target?: any, topic?: string): KnockoutSubscription; + notifySubscribers(valueToWrite: T, topic?: string): void; +} + +interface KnockoutObservableStatic { + fn: KnockoutObservable; + + (value?: T): KnockoutObservable; +} + +interface KnockoutBindingContext { + $parent: any; + $parents: any[]; + $root: any; + $data: any; + $index?: number; + $parentContext?: KnockoutBindingContext; + + extend(properties: any): KnockoutBindingContext; + createChildContext(dataItem: any, dataItemAlias?: any): KnockoutBindingContext; +} + +interface KnockoutBindingHandler { + init? (element: any, valueAccessor: () => any, allBindingsAccessor: () => any, viewModel: any, bindingContext: KnockoutBindingContext): void; + update? (element: any, valueAccessor: () => any, allBindingsAccessor: () => any, viewModel: any, bindingContext: KnockoutBindingContext): void; + options?: any; +} + +interface KnockoutBindingHandlers { + visible: KnockoutBindingHandler; + text: KnockoutBindingHandler; + html: KnockoutBindingHandler; + css: KnockoutBindingHandler; + style: KnockoutBindingHandler; + attr: KnockoutBindingHandler; + + foreach: KnockoutBindingHandler; + if: KnockoutBindingHandler; + ifnot: KnockoutBindingHandler; + with: KnockoutBindingHandler; + + click: KnockoutBindingHandler; + event: KnockoutBindingHandler; + submit: KnockoutBindingHandler; + enable: KnockoutBindingHandler; + disable: KnockoutBindingHandler; + value: KnockoutBindingHandler; + hasfocus: KnockoutBindingHandler; + checked: KnockoutBindingHandler; + options: KnockoutBindingHandler; + selectedOptions: KnockoutBindingHandler; + uniqueName: KnockoutBindingHandler; + + template: KnockoutBindingHandler; + + [key: string]: KnockoutBindingHandler; +} + +interface KnockoutMemoization { + memoize(callback: Function): string; + unmemoize(memoId: string, callbackParams?: any[]): boolean; + unmemoizeDomNodeAndDescendants(domNode: Element, extraCallbackParamsArray?: any[]): void; + parseMemoText(memoText: string): string; +} + +interface KnockoutExtenders { + throttle(target: any, timeout: number): KnockoutComputed; + notify(target: any, notifyWhen: string): any; +} + +interface KnockoutArrayEdit { + status: string; + index: number; + moved: number; + value: T; +} + +interface KnockoutUtils { + parseHtmlFragment(html: string): Element[]; + setHtml(node: Element, html: string): void; + + domData: { + get(node: Element, key: string): any; + set(node: Element, key: string, value: any): void; + getAll(node: Element, createIfNotFound?: boolean): any; + clear(node: Element): boolean; + }; + + domNodeDisposal: { + addDisposeCallback(node: Element, callback: (node: Element) => void): void; + removeDisposeCallback(node: Element, callback: (node: Element) => void): void; + }; + + fieldsIncludedWithJsonPost: any[]; + arrayForEach(array: T[], action: (item: T) => void): void; + arrayIndexOf(array: T[], item: T): number; + arrayFirst(array: T[], predicate: (item: T) => boolean, predicateOwner?: any): T; + arrayRemoveItem(array: T[], itemToRemove: T): void; + arrayGetDistinctValues(array: T[]): T[]; + arrayMap(array: T[], mapping: (item: T) => U): U[]; + arrayFilter(array: T[], predicate: (item: T) => boolean): T[]; + arrayPushAll(array: T[], valuesToPush: T[]): T[]; + arrayPushAll(array: KnockoutObservableArray, valuesToPush: T[]): KnockoutObservableArray; + compareArrays(oldArray: T[], newArray: T[], dontLimitMoves?: boolean): KnockoutArrayEdit[]; + extend(target: any, source: any): any; + emptyDomNode(domNode: Element): void; + moveCleanedNodesToContainerElement(nodes: Element[]): Element; + cloneNodes(nodesArray: Element[], shouldCleanNodes?: boolean): Element[]; + setDomNodeChildren(domNode: Element, childNodes: Element[]): void; + replaceDomNodes(nodeToReplaceOrNodeArray: Element[], newNodesArray: Element[]): void; + setOptionNodeSelectionState(optionNode: any, isSelected: boolean): void; + stringTrim(str: string): string; + stringTokenize(str: string, delimiter: string): string[]; + stringStartsWith(str: string, startsWith: string): boolean; + domNodeIsContainedBy(node: Element, containedByNode: Element): boolean; + domNodeIsAttachedToDocument(node: Element): boolean; + tagNameLower(element: Element): string; + registerEventHandler(element: Element, eventType: string, handler: Function): void; + triggerEvent(element: Element, eventType: string): void; + unwrapObservable(value: any): any; + peekObservable(value: any): any; + toggleDomNodeCssClass(node: Element, classNames: string, shouldHaveClass?: boolean): void; + setElementName(element: Element, name: string): void; + forceRefresh(node: Element): void; + ensureSelectElementIsRenderedCorrectly(selectElement: Element): void; + range(min: KnockoutObservable, max: KnockoutObservable): number[]; + range(min: number, max: number): number[]; + makeArray(arrayLikeObject: { [index: number]: T; length: number; }): T[]; + isIe6: boolean; + isIe7: boolean; + ieVersion: number; + getFormFields(form: Element, fieldName: string): Element[]; + parseJson(jsonString: string): any; + stringifyJson(data: KnockoutObservable, replacer?: (key: string, value: any) => any, space?: any): string; + stringifyJson(data: KnockoutObservable, replacer?: any[], space?: any): string; + stringifyJson(data: any, replacer?: (key: string, value: any) => any, space?: any): string; + stringifyJson(data: any, replacer?: any[], space?: any): string; + postJson(urlOrForm: string, data: any, options?: any): void; + postJson(urlOrForm: Element, data: any, options?: any): void; +} + +interface KnockoutVirtualElements { + allowedBindings: any; + childNodes: (node: Element) => Element[]; + emptyNode: (node: Element) => void; + setDomNodeChildren: (node: Element, childNodes: Element[]) => void; + prepend: (containerNode: Element, nodeToPrepend: Element) => void; + insertAfter: (containerNode: Element, nodeToInsert: Element, insertAfterNod: Element) => void; + firstChild: (node: Element) => Element; + nextSibling: (node: Element) => Element; + virtualNodeBindingValue: (node: Element) => string; + normaliseVirtualElementDomStructure: (elementVerified: Element) => void; +} + +interface KnockoutTemplateRewriting { + ensureTemplateIsRewritten(template: string, templateEngine: knockout.templateEngine, templateDocument?: Document): void; + ensureTemplateIsRewritten(template: Element, templateEngine: knockout.templateEngine, templateDocument?: Document): void; + memoizeBindingAttributeSyntax(htmlString: string, templateEngine: knockout.templateEngine): string; + applyMemoizedBindingsToNextSibling(bindings: any): string; +} + +interface KnockoutExpressionRewriting { + bindingRewriteValidators: any; + parseObjectLiteral(objectLiteralString: string): any; + preProcessBindings(objectLiteralStringOrKeyValueArray: string): string; + preProcessBindings(objectLiteralStringOrKeyValueArray: any): string; +} + +interface KnockoutSubscribableStatic { + fn: KnockoutSubscribable; + + (): KnockoutSubscribable; +} + +interface KnockoutTemplateSource { + text(): string; + text(value: string): void; + data(key: string): string; + data(key: string, value: string): void; + nodes? (): Element; + nodes? (value: Element): void; +} + +interface KnockoutAnonymousTemplateSource extends KnockoutTemplateSource { +} + +declare module knockout { + export var bindingHandlers: KnockoutBindingHandlers; + export var memoization: KnockoutMemoization; + export var extenders: KnockoutExtenders; + export var utils: KnockoutUtils; + export var virtualElements: KnockoutVirtualElements; + export var version: string; + + export function applyBindings(viewModel: any, rootNode?: any): void; + export function applyBindingsToDescendants(viewModel: any, rootNode: any): void; + export function applyBindingsToNode(node: Element, bindings: any, viewModel: any): void; + + export function observable(data?: T): KnockoutObservable; + export function observable(data?: any): KnockoutObservableStatic; + + export function computed(data?: () => T, instance?: any, options?: KnockoutComputedOptions): KnockoutComputed; + export function computed(options: KnockoutComputedOptions): KnockoutComputed; + export function computed(): KnockoutComputedStatic; + + // export function observableArray(data?: T[]): KnockoutObservableArray; + // export function observableArray(data?: any): KnockoutObservableArrayStatic; + export var observableArray: KnockoutObservableArrayStatic; + + export function subscribable(): KnockoutSubscribable; + export function subscribable(): KnockoutSubscribableStatic; + + export function contextFor(node: any): any; + export function dataFor(node: any): any; + export function isSubscribable(instance: any): boolean; + export function toJS(rootObject: any): any; + export function toJSON(rootObject: any, replacer?: (key: string, value: any) => any, space?: any): string; + export function toJSON(rootObject: any, replacer?: any[], space?: any): string; + export function isObservable(instance: any): boolean; + export function isComputed(instance: any): boolean; + export function cleanNode(node: Element): void; + export function removeNode(node: Element): void; + + export var templateSources: { + domElement: new (element: Element) => KnockoutTemplateSource; + anonymousTemplate: new (element: Element) => KnockoutAnonymousTemplateSource; + }; + + export var templateRewriting: KnockoutTemplateRewriting; + + export function setTemplateEngine(templateEngine: templateEngine): void; + export function renderTemplate(template: string, dataOrBindingContext: any, options?: any, targetNodeOrNodeArray?: Element, renderMode?: string): any; + export function renderTemplate(template: string, dataOrBindingContext: any, options?: any, targetNodeOrNodeArray?: Element[], renderMode?: string): any; + export function renderTemplate(template: (data: any, bindingContext: KnockoutBindingContext) => string, dataOrBindingContext: any, options?: any, targetNodeOrNodeArray?: Element, renderMode?: string): any; + export function renderTemplate(template: (data: any, bindingContext: KnockoutBindingContext) => string, dataOrBindingContext: any, options?: any, targetNodeOrNodeArray?: Element[], renderMode?: string): any; + export function renderTemplateForEach(template: string, arrayOrObservableArray: any[], options: any, targetNode: Element, parentBindingContext: KnockoutBindingContext): any; + export function renderTemplateForEach(template: (value: any[], itemContext: any[]) => string, arrayOrObservableArray: any[], options: any, targetNode: Element, parentBindingContext: KnockoutBindingContext): any; + + export var expressionRewriting: KnockoutExpressionRewriting; + + export class bindingProvider { + public nodeHasBindings(node: Element): boolean; + public getBindings(node: Element, bindingContext: KnockoutBindingContext): any; + private getBindingsString(node: Element, bindingContext: KnockoutBindingContext): string; + private parseBindingsString(bindingsString: string, bindingContext: KnockoutBindingContext, node: Element): void; + + public static instance: bindingProvider; + } + + export class templateEngine { + public allowTemplateRewriting: boolean; + public renderTemplateSource(templateSource: KnockoutTemplateSource, bindingContext: KnockoutBindingContext, options?: any): Element[]; + public createJavaScriptEvaluatorBlock(script: string): string; + public makeTemplateSource(template: string, templateDocument?: Document): KnockoutTemplateSource; + public makeTemplateSource(template: Element, templateDocument?: Document): KnockoutTemplateSource; + public renderTemplate(template: string, bindingContext: KnockoutBindingContext, options?: any, templateDocument?: Document): Element[]; + public renderTemplate(template: Element, bindingContext: KnockoutBindingContext, options?: any, templateDocument?: Document): Element[]; + public isTemplateRewritten(template: string, templateDocument?: Document): boolean; + public isTemplateRewritten(template: Element, templateDocument?: Document): boolean; + public rewriteTemplate(template: string, rewriterCallback: (text: string) => string, templateDocument?: Document): void; + public rewriteTemplate(template: Element, rewriterCallback: (text: string) => string, templateDocument?: Document): void; + } + + // "extends templateEngine" isn't working... "type name 'templateEngine' in extends clause does not reference constructor function for 'templateEngine'" + export class nativeTemplateEngine { + public static instance: nativeTemplateEngine; + + public allowTemplateRewriting: boolean; + public renderTemplateSource(templateSource: KnockoutTemplateSource, bindingContext: KnockoutBindingContext, options?: any): Element[]; + public createJavaScriptEvaluatorBlock(script: string): string; + public makeTemplateSource(template: string, templateDocument?: Document): KnockoutTemplateSource; + public makeTemplateSource(template: Element, templateDocument?: Document): KnockoutTemplateSource; + public renderTemplate(template: string, bindingContext: KnockoutBindingContext, options?: any, templateDocument?: Document): Element[]; + public renderTemplate(template: Element, bindingContext: KnockoutBindingContext, options?: any, templateDocument?: Document): Element[]; + public isTemplateRewritten(template: string, templateDocument?: Document): boolean; + public isTemplateRewritten(template: Element, templateDocument?: Document): boolean; + public rewriteTemplate(template: string, rewriterCallback: (text: string) => string, templateDocument?: Document): void; + public rewriteTemplate(template: Element, rewriterCallback: (text: string) => string, templateDocument?: Document): void; + } + + export class jqueryTmplTemplateEngine { + public addTemplate(templateName: string, templateMarkup: string): void; + + public allowTemplateRewriting: boolean; + public renderTemplateSource(templateSource: KnockoutTemplateSource, bindingContext: KnockoutBindingContext, options?: any): Element[]; + public createJavaScriptEvaluatorBlock(script: string): string; + public makeTemplateSource(template: string, templateDocument?: Document): KnockoutTemplateSource; + public makeTemplateSource(template: Element, templateDocument?: Document): KnockoutTemplateSource; + public renderTemplate(template: string, bindingContext: KnockoutBindingContext, options?: any, templateDocument?: Document): Element[]; + public renderTemplate(template: Element, bindingContext: KnockoutBindingContext, options?: any, templateDocument?: Document): Element[]; + public isTemplateRewritten(template: string, templateDocument?: Document): boolean; + public isTemplateRewritten(template: Element, templateDocument?: Document): boolean; + public rewriteTemplate(template: string, rewriterCallback: (text: string) => string, templateDocument?: Document): void; + public rewriteTemplate(template: Element, rewriterCallback: (text: string) => string, templateDocument?: Document): void; + } + +} + +declare module 'knockout' { + export = knockout; +} \ No newline at end of file diff --git a/typings/q.d.ts b/typings/q.d.ts new file mode 100644 index 0000000..b368abd --- /dev/null +++ b/typings/q.d.ts @@ -0,0 +1,390 @@ +// Type definitions for Q +// Project: https://github.com/kriskowal/q +// Definitions by: Barrie Nemetchek , Andrew Gaspar , John Reilly +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/** + * If value is a Q promise, returns the promise. + * If value is a promise from another library it is coerced into a Q promise (where possible). + */ +declare function Q(promise: Q.IPromise): Q.Promise; +/** + * If value is a Q promise, returns the promise. + * If value is a promise from another library it is coerced into a Q promise (where possible). + */ +declare function Q(promise: JQueryPromise): Q.Promise; +/** + * If value is not a promise, returns a promise that is fulfilled with value. + */ +declare function Q(value: T): Q.Promise; + +declare module Q { + interface IPromise { + then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => IPromise): IPromise; + then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => U): IPromise; + then(onFulfill: (value: T) => U, onReject?: (reason: any) => IPromise): IPromise; + then(onFulfill: (value: T) => U, onReject?: (reason: any) => U): IPromise; + } + + interface Deferred { + promise: Promise; + resolve(value: T): void; + reject(reason: any): void; + notify(value: any): void; + makeNodeResolver(): (reason: any, value: T) => void; + } + + interface Promise { + /** + * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. + + * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise returned from callback is finished. + */ + fin(finallyCallback: () => any): Promise; + /** + * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. + + * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise returned from callback is finished. + */ + finally(finallyCallback: () => any): Promise; + + /** + * The then method from the Promises/A+ specification, with an additional progress handler. + */ + then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => IPromise, onProgress?: Function): Promise; + /** + * The then method from the Promises/A+ specification, with an additional progress handler. + */ + then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => U, onProgress?: Function): Promise; + /** + * The then method from the Promises/A+ specification, with an additional progress handler. + */ + then(onFulfill: (value: T) => U, onReject?: (reason: any) => IPromise, onProgress?: Function): Promise; + /** + * The then method from the Promises/A+ specification, with an additional progress handler. + */ + then(onFulfill: (value: T) => U, onReject?: (reason: any) => U, onProgress?: Function): Promise; + + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * + * This is especially useful in conjunction with all + */ + spread(onFulfilled: Function, onRejected?: Function): Promise; + + fail(onRejected: (reason: any) => U): Promise; + fail(onRejected: (reason: any) => IPromise): Promise; + /** + * A sugar method, equivalent to promise.then(undefined, onRejected). + */ + catch(onRejected: (reason: any) => U): Promise; + /** + * A sugar method, equivalent to promise.then(undefined, onRejected). + */ + catch(onRejected: (reason: any) => IPromise): Promise; + + /** + * A sugar method, equivalent to promise.then(undefined, undefined, onProgress). + */ + progress(onProgress: (progress: any) => any): Promise; + + /** + * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, either because promise is rejected and no onRejected callback was provided, or because onFulfilled or onRejected threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a future turn of the event loop. + * + * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions thrown in then callbacks are consumed and transformed into rejections, exceptions at the end of the chain are easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the event loop, so that it won't be caught, it causes an onerror event on the browser window, or an uncaughtException event on Node.js's process object. + * + * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, exceptions will be delivered there instead of thrown in a future turn. + * + * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends with you, call done to terminate it. + */ + done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void; + + /** + * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. If callback is not a function, simply returns promise. + */ + nodeify(callback: (reason: any, value: any) => void): Promise; + + /** + * Returns a promise to get the named property of an object. Essentially equivalent to + * + * promise.then(function (o) { + * return o[propertyName]; + * }); + */ + get(propertyName: String): Promise; + set(propertyName: String, value: any): Promise; + delete(propertyName: String): Promise; + /** + * Returns a promise for the result of calling the named method of an object with the given array of arguments. The object itself is this in the function, just like a synchronous method call. Essentially equivalent to + * + * promise.then(function (o) { + * return o[methodName].apply(o, args); + * }); + */ + post(methodName: String, args: any[]): Promise; + /** + * Returns a promise for the result of calling the named method of an object with the given variadic arguments. The object itself is this in the function, just like a synchronous method call. + */ + invoke(methodName: String, ...args: any[]): Promise; + fapply(args: any[]): Promise; + fcall(...args: any[]): Promise; + + /** + * Returns a promise for an array of the property names of an object. Essentially equivalent to + * + * promise.then(function (o) { + * return Object.keys(o); + * }); + */ + keys(): Promise; + + /** + * A sugar method, equivalent to promise.then(function () { return value; }). + */ + thenResolve(value: U): Promise; + /** + * A sugar method, equivalent to promise.then(function () { throw reason; }). + */ + thenReject(reason: any): Promise; + timeout(ms: number, message?: string): Promise; + /** + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + */ + delay(ms: number): Promise; + + /** + * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. + */ + isFulfilled(): boolean; + /** + * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. + */ + isRejected(): boolean; + /** + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + */ + isPending(): boolean; + + valueOf(): any; + + /** + * Returns a "state snapshot" object, which will be in one of three forms: + * + * - { state: "pending" } + * - { state: "fulfilled", value: } + * - { state: "rejected", reason: } + */ + inspect(): PromiseState; + } + + interface PromiseState { + /** + * "fulfilled", "rejected", "pending" + */ + state: string; + value?: T; + reason?: any; + } + + // if no fulfill, reject, or progress provided, returned promise will be of same type + export function when(value: IPromise): Promise; + export function when(value: T): Promise; + + // If a non-promise value is provided, it will not reject or progress + export function when(value: T, onFulfilled: (val: T) => IPromise): Promise; + export function when(value: T, onFulfilled: (val: T) => U): Promise; + + export function when(value: IPromise, onFulfilled: (val: T) => IPromise, onRejected?: (reason: any) => IPromise, onProgress?: (progress: any) => any): Promise; + export function when(value: IPromise, onFulfilled: (val: T) => IPromise, onRejected?: (reason: any) => U, onProgress?: (progress: any) => any): Promise; + export function when(value: IPromise, onFulfilled: (val: T) => U, onRejected?: (reason: any) => IPromise, onProgress?: (progress: any) => any): Promise; + export function when(value: IPromise, onFulfilled: (val: T) => U, onRejected?: (reason: any) => U, onProgress?: (progress: any) => any): Promise; + + //export function try(method: Function, ...args: any[]): Promise; // <- This is broken currently - not sure how to fix. + + export function fbind(method: (...args: any[]) => IPromise, ...args: any[]): (...args: any[]) => Promise; + export function fbind(method: (...args: any[]) => T, ...args: any[]): (...args: any[]) => Promise; + + export function fcall(method: (...args: any[]) => T, ...args: any[]): Promise; + + export function send(obj: any, functionName: string, ...args: any[]): Promise; + export function invoke(obj: any, functionName: string, ...args: any[]): Promise; + export function mcall(obj: any, functionName: string, ...args: any[]): Promise; + + export function denodeify(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; + export function nbind(nodeFunction: Function, thisArg: any, ...args: any[]): (...args: any[]) => Promise; + export function nfbind(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; + export function nfcall(nodeFunction: Function, ...args: any[]): Promise; + export function nfapply(nodeFunction: Function, args: any[]): Promise; + + export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; + export function npost(nodeModule: any, functionName: string, args: any[]): Promise; + export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; + export function nmcall(nodeModule: any, functionName: string, ...args: any[]): Promise; + + /** + * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. + */ + export function all(promises: IPromise[]): Promise; + /** + * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. + */ + export function all(promises: any[]): Promise; + + /** + * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. + */ + export function allSettled(promises: IPromise[]): Promise[]>; + /** + * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. + */ + export function allSettled(promises: any[]): Promise[]>; + + export function allResolved(promises: IPromise[]): Promise[]>; + export function allResolved(promises: any[]): Promise[]>; + + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected: (reason: any) => IPromise): Promise; + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected: (reason: any) => U): Promise; + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason: any) => IPromise): Promise; + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason: any) => U): Promise; + + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected: (reason: any) => IPromise): Promise; + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected: (reason: any) => U): Promise; + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected: (reason: any) => IPromise): Promise; + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected: (reason: any) => U): Promise; + + /** + * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message is not supplied, the message will be "Timed out after " + ms + " ms". + */ + export function timeout(promise: Promise, ms: number, message?: string): Promise; + + /** + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + */ + export function delay(promise: Promise, ms: number): Promise; + /** + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + */ + export function delay(value: T, ms: number): Promise; + /** + * Returns a promise that will be fulfilled with undefined after at least ms milliseconds have passed. + */ + export function delay(ms: number): Promise ; + /** + * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. + */ + export function isFulfilled(promise: Promise): boolean; + /** + * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. + */ + export function isRejected(promise: Promise): boolean; + /** + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + */ + export function isPending(promise: Promise): boolean; + + /** + * Returns a "deferred" object with a: + * promise property + * resolve(value) method + * reject(reason) method + * notify(value) method + * makeNodeResolver() method + */ + export function defer(): Deferred; + + /** + * Returns a promise that is rejected with reason. + */ + export function reject(reason?: any): Promise; + + export function Promise(resolver: (resolve: (val: IPromise) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; + export function Promise(resolver: (resolve: (val: T) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; + + /** + * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their fulfillment values before calling the original func. The returned version also always returns a promise: if func does a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. + * + * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that the function always returns a promise even in the face of unintentional thrown exceptions. + */ + export function promised(callback: (...args: any[]) => T): (...args: any[]) => Promise; + + /** + * Returns whether the given value is a Q promise. + */ + export function isPromise(object: any): boolean; + /** + * Returns whether the given value is a promise (i.e. it's an object with a then function). + */ + export function isPromiseAlike(object: any): boolean; + /** + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + */ + export function isPending(object: any): boolean; + + /** + * This is an experimental tool for converting a generator function into a deferred function. This has the potential of reducing nested callbacks in engines that support yield. + */ + export function async(generatorFunction: any): (...args: any[]) => Promise; + export function nextTick(callback: Function): void; + + /** + * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the event loop, usually as a result of done. Can be useful for getting the full stack trace of an error in browsers, which is not usually possible with window.onerror. + */ + export var onerror: (reason: any) => void; + /** + * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked across asynchronous promise operations, so that if an uncaught error is thrown by done or a rejection reason's stack property is inspected in a rejection callback, a long stack trace is produced. + */ + export var longStackSupport: boolean; + + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ + export function resolve(object: IPromise): Promise; + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ + export function resolve(object: T): Promise; +} + +declare module "q" { + export = Q; +} \ No newline at end of file diff --git a/typings/vss.d.ts b/typings/vss.d.ts new file mode 100644 index 0000000..4bea9ed --- /dev/null +++ b/typings/vss.d.ts @@ -0,0 +1,41586 @@ +// Type definitions for Microsoft Visual Studio Services v90.20151022.1109 +// Project: http://www.visualstudio.com/integrate/extensions/overview +// Definitions by: Microsoft + +/// +/// +/// +//---------------------------------------------------------- +// Common interfaces specific to WebPlatform area +//---------------------------------------------------------- + +/** +* VSS-specific options for VSS ajax requests +*/ +interface IVssAjaxOptions { + + /* + * Auth token manager that can be used to get and attach auth tokens to requests + */ + authTokenManager?: IAuthTokenManager; + + /** + * If true, textStatus and jqXHR are added to the success callback. In this case, spread (instead of then) needs to be used (default false). + */ + useAjaxResult?: boolean; +} + +/** +* Event listener for VSS ajax events. Gets notified before and after each request +*/ +interface IVssAjaxEventListener { + + /** + * Method invoked before a request is sent + * + * @param requestId A unique id that can be used to track this particular request (id is unique among all clients) + * @param requestUrl Url of the request that is about to be issued + * @param ajaxOptions Ajax settings/options for the request + * @param vssRequestOptions Additional VSS-specific options supplied in the request + */ + beforeRequest?: (requestId: number, requestUrl: string, ajaxOptions: JQueryAjaxSettings, vssRequestOptions: IVssAjaxOptions) => void; + + /** + * Method invoked when a response has been received + * + * @param requestId A unique id that can be used to track this particular request (id is unique among all clients) + * @param data The response data + * @param textStatus A string indicating status of the request + * @param jqXHR: The jQuery XHR object for the request + * @param vssRequestOptions Additional VSS-specific options supplied in the request + */ + responseReceived?: (requestId: number, data: any, textStatus: string, jqXHR: JQueryXHR, vssRequestOptions: IVssAjaxOptions) => void; + + /** + * Method invoked after a response has been received and its callback/promise has been invoked + * + * @param requestId A unique id that can be used to track this particular request (id is unique among all clients) + * @param data The response data + * @param textStatus A string indicating status of the request + * @param jqXHR: The jQuery XHR object for the request + * @param vssRequestOptions Additional VSS-specific options supplied in the request + */ + postResponseCallback?: (requestId: number, data: any, textStatus: string, jqXHR: JQueryXHR, vssRequestOptions: IVssAjaxOptions) => void; +} + +/** +* Interface for a class that can fetch auth tokens to be used in AJAX requests. +*/ +interface IAuthTokenManager { + + /** + * Get the auth token to use for this request. + * + * @param refresh If true refresh the token (i.e. request a new one - don't use a cached token) + */ + getAuthToken(refresh?: boolean): IPromise; + + /** + * Gets the authorization header to use in a request from the given token + * + * @param sessionToken Used for token key. + * @return the value to use for the Authorization header in a request. + */ + getAuthorizationHeader(sessionToken: TToken): string; +} + +/** +* A promise represents the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its then method, +* which registers callbacks to receive either a promise’s eventual value or the reason why the promise cannot be fulfilled. +*/ +interface IPromise { + /** + * Then method which accepts a fulfill delegate which returns a promise or nothing and a reject delegate which returns a promise or nothing. Then returns a new promise. + */ + then(onFulfill: (value: T) => IPromise | void, onReject?: (reason: any) => IPromise | void): IPromise; + + /** + * Then method which accepts a fulfill delegate which returns a promise or nothing and a reject delegate which returns a reason value or nothing. Then returns a new promise. + */ + then(onFulfill: (value: T) => IPromise | void, onReject?: (reason: any) => U | void): IPromise; + + /** + * Then method which accepts a fulfill delegate which returns a value or nothing and a reject delegate which returns a promise or nothing. Then returns a new promise. + */ + then(onFulfill: (value: T) => U | void, onReject?: (reason: any) => IPromise | void): IPromise; + + /** + * Then method which accepts a fulfill delegate which returns a value or nothing and a reject delegate which returns a reason value or nothing. Then returns a new promise. + */ + then(onFulfill: (value: T) => U | void, onReject?: (reason: any) => U | void): IPromise; +} +declare var Sys; + +interface EventTarget { + checked: boolean; + nodeType: number; +} + +interface Date { + toGMTString(): string; +} + +interface IErrorCallback { + (error: any): void; +} + +interface IResultCallback extends Function { +} + +interface IArgsFunctionR { + (...args: any[]): TResult; +} + +interface IFunctionPR { + (param: TParam): TResult; +} + +interface IFunctionPPR { + (param1: TParam1, param2: TParam2): TResult; +} + +interface IFunctionPPPR { + (param1: TParam1, param2: TParam2, param3: TParam3): TResult; +} + +interface IComparer extends IFunctionPPR { +} + +interface IDictionaryStringTo { + [key: string]: T; +} + +interface IDictionaryNumberTo { + [key: number]: T; +} + +interface IEventHandler extends Function { +} + +interface IWebApiArrayResult { + count: number; + value: any[]; +} + +interface Window { + ActiveXObject: any; + DOMParser: any; + XSLTProcessor: any; + vsSdkOnLoad:() => void; +} + +interface MSAjaxError extends Error { + popStackFrame: () => void; +} + +interface TfsError extends Error { + status?: string; + stack?: string; +} + +//These variables defined by server. +declare var exports: any; + +declare var _disabledPlugins: string[]; + +interface IWebAccessPlugin { + namespace: string; + loadAfter: string; +} + +declare var _plugins: IWebAccessPlugin[]; +declare var _builtinPlugins: IWebAccessPlugin[]; + +interface IWebAccessPluginBase { + namespace: string; + base: string; +} + +declare var _builtInBases: IWebAccessPluginBase[]; +declare var _bases: IWebAccessPluginBase[]; + +interface IRequire { + (moduleName: string): any; + (moduleNames: string[], moduleFunc: Function): any; + config: (config: any, shouldOverwrite?: boolean) => void; +} + +interface IDefine { + (moduleNames: string[], moduleFunc: Function): any; + (id: string, moduleNames: string[], moduleFunc: Function): any; +} + +interface IDisposable { + dispose(): void; +} + +interface IKeyValuePair { + key: TKey; + value: TValue; +} + +declare var require: IRequire; +declare var define: IDefine; +//---------------------------------------------------------- +// Common interfaces specific to WebPlatform area +//---------------------------------------------------------- + +/** +* Interface for a single XDM channel +*/ +interface IXDMChannel { + + /** + * Invoke a method via RPC. Lookup the registered object on the remote end of the channel and invoke the specified method. + * + * @param method Name of the method to invoke + * @param instanceId unique id of the registered object + * @param params Arguments to the method to invoke + * @param instanceContextData Optional context data to pass to a registered object's factory method + */ + invokeRemoteMethod(methodName: string, instanceId: string, params?: any[], instanceContextData?: Object): IPromise; + + /** + * Get a proxied object that represents the object registered with the given instance id on the remote side of this channel. + * + * @param instanceId unique id of the registered object + * @param contextData Optional context data to pass to a registered object's factory method + */ + getRemoteObjectProxy(instanceId: string, contextData?: Object): IPromise; + + /** + * Get the object registry to handle messages from this specific channel. + * Upon receiving a message, this channel registry will be used first, then + * the global registry will be used if no handler is found here. + */ + getObjectRegistry(): IXDMObjectRegistry; +} + +/** +* Registry of XDM channels kept per target frame/window +*/ +interface IXDMChannelManager { + + /** + * Add an XDM channel for the given target window/iframe + * + * @param window Target iframe window to communicate with + * @param targetOrigin Url of the target iframe (if known) + */ + addChannel(window: Window, targetOrigin?: string): IXDMChannel; +} + +/** +* Registry of XDM objects that can be invoked by an XDM channel +*/ +interface IXDMObjectRegistry { + + /** + * Register an object (instance or factory method) exposed by this frame to callers in a remote frame + * + * @param instanceId unique id of the registered object + * @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. + */ + register(instanceId: string, instance: Object | { (contextData?: any): Object; }): void; + + /** + * Get an instance of an object registered with the given id + * + * @param instanceId unique id of the registered object + * @param contextData Optional context data to pass to the contructor of an object factory method + */ + getInstance(instanceId: string, contextData?: Object): T; +} + +/** +* Options for the extension's initialization method +*/ +interface IExtensionInitializationOptions { + + /** + * Set to true if the extension will explicitly call notifyLoadSucceeded or notifyLoadFailed + * itself to indicate that the extension is done loading (stops UI loading indicator in the host). + * If false (the default) the extension is considered ready as soon as init is called. + */ + explicitNotifyLoaded?: boolean; + + /** + * Set to true if the extension is going to consume any VSS script libraries. + * For example, controls, REST clients, services, etc. + * This pulls in the script loader and configuration data from the host frame so that + * 'require' statements can be used to load VSO modules. A call to VSS.require will + * effectively turn this option on, even if not specified in the VSS.init handshake. + */ + usePlatformScripts?: boolean; + + /** + * Set to true if the extension desires to use VSS platform CSS styles. If not explicitly set, + * the default value is the value of 'usePlatformScripts'. + */ + usePlatformStyles?: boolean; + + /** + * Extension-specific AMD module loader configuration. This configuration + * will be merged with the VSO-specific configuration. + */ + moduleLoaderConfig?: ModuleLoaderConfiguration; + + /** + * Optional callback method that gets invoked when this extension frame is reused by another contribution + * which shares the same URI of the contribution that originally caused this extension frame to be loaded. + */ + extensionReusedCallback?: (contribution: Contribution) => void; +} + +/** +* Data passed from the host to an extension frame via the initial handshake +*/ +interface IHostHandshakeData { + + /** + * Static context information about the current page + */ + pageContext: PageContext; + + /** + * Initial configuration for the extension frame + */ + initialConfig?: any; + + /** + * Context information about the extension + */ + extensionContext: IExtensionContext; + + /** + * The contribution that caused the extension frame to be loaded. + */ + contribution: Contribution; +} + +/** +* Data passed to the host from an extension frame via the initial handshake +*/ +interface IExtensionHandshakeData { + + /** + * If true, consider the extension loaded upon completion of the initial handshake. + */ + notifyLoadSucceeded: boolean; + + /** + * Optional callback method that gets invoked when this extension frame is reused by another contribution + * which shares the same URI of the contribution that originally caused this extension frame to be loaded. + */ + extensionReusedCallback?: (contribution: Contribution) => void; +} + +/** +* Information about a control interface that is exposed across iframe boundaries +*/ +interface IExternalControlInterfaceInfo { + methodNames: string[]; +} + +/** +* Context about the app that owns the content that is being hosted +*/ +interface IExtensionContext { + /** + * Friendly unique id of the publisher + */ + publisherId: string; + + /** + * Friendly id of the extension (unique within the publisher) + */ + extensionId: string; + + /** + * Version of the extension + */ + version: string; + + /** + * The base uri to be used with relative urls in contribution properties + */ + baseUri: string; +} + +interface IDefaultGetServiceContext { + + webContext: WebContext; + + extensionContext: IExtensionContext; +} + +/** +* Session token whose value can be added to the Authorization header in requests to VSO endpoints +*/ +interface ISessionToken { + + /** + * The registered VSS auth application id + */ + appId: string; + + /** + * Name describing the token + */ + name: string; + + /** + * Token value + */ + token: string; +} + +/** +* A Contribution with its containing extension +*/ +interface IExtensionContribution extends Contribution { + + /** + * The extension that owns this contribution + */ + extension: Extension; +} + +/** +* Information about an individual contribution that contributes one or more services registered by id. +*/ +interface IServiceContribution extends IExtensionContribution { + + /** + * Get the instance of an object registered by this contribution + * + * @param objectId Id of the registered object (defaults to the id property of the contribution) + * @param context Optional context to use when getting the object. + */ + getInstance(objectId?: string, context?: any): IPromise; +} + +interface IHostDialogOptions { + + height?: number; + width?: number; + draggable?: boolean; + resizable?: boolean; + title?: string; + modal?: boolean; + buttons?: IDictionaryStringTo; + open?: Function; + close?: Function; + getDialogResult?: () => any; + okCallback?: (result: any) => void; + cancelCallback?: Function; + okText?: string; + cancelText?: string; +} + +interface IExternalDialog { + + /** + * Gets an object registered in the dialog's contribution control. + * + * @param instanceId Id of the instance to get + * @param contextData Optional data to pass to the extension for it to use when creating the instance + * @return Promise that is resolved to the instance (a proxy object that talks to the instance) + */ + getContributionInstance(instanceId: string, contextData?: any): IPromise; + + /** + * Close the dialog + */ + close(); + + /** + * Update the title of the dialog + * + * @param title New dialog title + */ + setTitle(title: string); + + /** + * Update the enablement of the OK button + */ + updateOkButton(enabled: boolean); +} + +/** +* Service which manages showing dialogs in the parent frame +*/ +interface IHostDialogService { + + /** + * Open a modal dialog in the host frame which will get its content from a contributed control. + * + * @param contributionId The id of the control contribution to host in the dialog + * @param dialogOptions options.title - title of dialog + * @param contributionConfig Initial configuration to pass to the contribution control. + * @param postContent Optional data to post to the contribution endpoint. If not specified, a GET request will be performed. + */ + openDialog(contributionId: string, dialogOptions: IHostDialogOptions, contributionConfig?: Object, postContent?: Object): IPromise; +} + +/** +* Service which allows interaction with the browser location and navigation of the host frame +*/ +interface IHostNavigationService { + + /** + * Reloads the parent frame + */ + reload(); + + /** + * Add a callback to be invoked each time the hash navigation has changed + * + * @param callback Method invoked on each navigation hash change + */ + onHashChanged(callback: (hash: string) => void); + + /** + * Gets the current hash. + * + * @return Hash part of the host page's url (url following #) + */ + getHash(): IPromise; + + /** + * Sets the provided hash from the hosted content. + * + * @param hash The new hash string to + */ + setHash(hash: string); +} + +/** +* Service which allows for getting and setting of extension data +*/ +interface IExtensionDataService { + + /** + * Returns a promise for retrieving a setting at the provided key and scope + * + * @param key The key to retrieve a value for + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + getValue(key: string, documentOptions?: IDocumentOptions): IPromise; + + /** + * Returns a promise for saving a setting at the provided key and scope + * + * @param key The key to save a value for + * @param value The value to save + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + setValue(key: string, value: T, documentOptions?: IDocumentOptions): IPromise; + + /** + * Returns a promise for getting a document with the provided id in the provided collection + * + * @param collectionName The name of the collection where the document lives + * @param id The id of the document in the collection + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + getDocument(collectionName: string, id: string, documentOptions?: IDocumentOptions): IPromise; + + /** + * Returns a promise for getting all of the documents in the provided collection + * + * @param collectionName The name of the collection where the document lives + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + getDocuments(collectionName: string, documentOptions?: IDocumentOptions): IPromise; + + /** + * Returns a promise for creating a document in the provided collection + * + * @param collectionName The name of the collection where the document lives + * @param doc The document to store + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + createDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise; + + /** + * Returns a promise for setting a document in the provided collection + * Creates the document if it does not exist, otherwise updates the existing document with the id provided + * + * @param collectionName The name of the collection where the document lives + * @param doc The document to store + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + setDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise; + + /** + * Returns a promise for updating a document in the provided collection + * A document with the id provided must exist + * + * @param collectionName The name of the collection where the document lives + * @param doc The document to store + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + updateDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise; + + /** + * Returns a promise for deleting the document at the provided scope, collection and id + * + * @param collectionName The name of the collection where the document lives + * @param id The id of the document in the collection + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + deleteDocument(collectionName: string, id: string, documentOptions?: IDocumentOptions): IPromise; +} + +/** +* Interface for options that can be supplied with document actions +*/ +interface IDocumentOptions { + /** + * The scope of where the document is stored. Can be Account or User. + */ + scopeType: string; + + /** + * The value of the scope where the document is stored. Can be Current or Me. + */ + scopeValue?: string; + + /** + * The default value to return when using getValue(). If the document has no value, + * this value will be used instead. + */ + defaultValue?: any; +} + +/** +* Interface for a registered object that contributes menu item(s) +*/ +interface IContributedMenuSource { + + /** + * Get an array of menu items for the given context + * + * @param context Menu-specific context information + * @return Array of menu items or a promise for the array + */ + getMenuItems(context: any): IContributedMenuItem[] | IPromise; + + /** + * Handle a menu item from this menu source being clicked. This is only invoked when the + * contributed menu item does not have an "action" method. + * + * @param actionContext Menu-specific context information + */ + execute(actionContext: any); +} + +/** +* An individual contributed menu item +*/ +interface IContributedMenuItem { + + /** + * Menu-item specific identifier + */ + id?: string; + + /** + * Text to display in the menu item + */ + text?: string; + + /** + * Tooltip to display for the menu item + */ + title?: string; + + /** + * Set to true if this menu item is just a separator + */ + separator?: boolean; + + /** + * Set to true if this menu item should be disabled + */ + disabled?: boolean; + + /** + * Url to an icon image or css class for the image cell + */ + icon?: string; + + /** + * If true, do not render an icon or space for an icon. + */ + noIcon?: boolean; + + /** + * If this menu item has a sub menu, these are the contributed child items + */ + childItems?: IContributedMenuItem[]; + + /** + * Id of the menu group that this item should be placed in. + */ + groupId?: string; + + /** + * Method invoked when the menu item is clicked. + * + * @param actionContext Menu-specific context information + */ + action?: (actionContext: any) => void; +} +interface IContributedTab { + /** + * Determines if this tab should be displayed + * @param context Context information + * @return boolean Return true not to show this tab. + */ + isInvisible?: (context?: any) => boolean | IPromise; + + /** + * Page title, which will be displayed above the list of Tabs + * @param context Context information + * @return string The unescaped page title + */ + pageTitle: string | IPromise | ((context?: any) => string | IPromise); + + /** + * Name of the tab + * @param context Context information + * @return string The unescaped text that appears as the name of the tab + */ + name: string | IPromise | ((context?: any) => string | IPromise); + + /** + * Title text for the tab, i.e., the tooltip + * @param context Context information + * @return string The tooltip text + */ + title?: string | IPromise | ((context?: any) => string | IPromise); + + /** + * URI to the page that this tab will display (i.e. in a frame) + */ + uri: string; + + /** + * Function that is invoked when there is a new context available for the extension. + */ + updateContext: (context: any) => void | IPromise; +} +//---------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//---------------------------------------------------------- + +//---------------------------------------------------------- +// Generated file, DO NOT EDIT. +// To regenerate this file, run "GenerateConstants.cmd" . + +// Generated data for the following assemblies: +// Microsoft.TeamFoundation.Server.WebAccess.Platform +// Microsoft.VisualStudio.Services.WebApi +//---------------------------------------------------------- + + +/** +* Model to represent a public access uri +*/ +interface AccessPointModel { + /** + * Host name and port number of the url + */ + authority: string; + /** + * Url scheme (http, https, ...) + */ + scheme: string; + /** + * Full url + */ + uri: string; +} + +/** +* Model used to configure how TFS reports usage data to Application Insights +*/ +interface AppInsightsConfiguration { + /** + * If true, automatically call "trackPage" when the page is loaded + */ + autoTrackPage: boolean; + /** + * Optional data used to override the default values sent to trackPage + */ + customTrackPageData: AppInsightsCustomTrackPageData; + /** + * Set to false if app insights reporting is not enabled/configured + */ + enabled: boolean; + /** + * The url from which to retrieve app insights scripts + */ + insightsScriptUrl: string; + /** + * The instrumentation key used to track this deployment's usage + */ + instrumentationKey: string; + /** + * If true, include collection, project, and team info in the track-page urls + */ + trackProjectInfo: boolean; +} + +/** +* Model that can be used to customize the values sent to AppInsights via "trackPage" +*/ +interface AppInsightsCustomTrackPageData { + alias: string; + metrics: { [key: string]: number; }; + pageName: string; + properties: { [key: string]: string; }; +} + +/** +* Web Access configuration data. This information is used to process requests on the server. This data is also placed in a json island on each page in order for JavaScript to know key configuration data required to things like construct proper urls +*/ +interface ConfigurationContext { + /** + * MVC api configuration + */ + api: ConfigurationContextApis; + /** + * Optional name of the client (e.g. TEE) hosting the page + */ + clientHost: string; + isHosted: boolean; + /** + * Current mail settings for TFS + */ + mailSettings: TfsMailSettings; + /** + * Server resource paths + */ + paths: ConfigurationContextPaths; +} + +/** +* MVC api configuration +*/ +interface ConfigurationContextApis { + /** + * Specifies the path prefix for the area + */ + areaPrefix: string; + /** + * Specifies the path prefix for the controller + */ + controllerPrefix: string; + /** + * Api-version for legacy rpc-style web access api controllers See WebApiVersionClient for the version coming from the client/browser. The return value is a positive whole number >= 1. + */ + webApiVersion: string; +} + +/** +* Paths to server resources +*/ +interface ConfigurationContextPaths { + /** + * Relative path to the _content path of the web application + */ + resourcesPath: string; + /** + * Relative path to the root of the web application + */ + rootPath: string; + /** + * Relative path to unversioned 3rd party static content + */ + staticRoot3rdParty: string; + /** + * Relative path to versioned static content + */ + staticRootTfs: string; +} + +declare enum ContextHostType { + Unknown = 0, + /** + * The Deployment Host + */ + Deployment = 1, + /** + * The Application Host + */ + Application = 2, + /** + * The Project Collection + */ + ProjectCollection = 4, +} + +interface ContextIdentifier { + id: string; + name: string; +} + +/** +* Page context configuration that can be contributed by remote services (different VSO services delivering content to the page) +*/ +interface ContributedServiceContext { + /** + * Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list. + */ + cssModulePrefixes: string[]; + /** + * Feature flag states to include by default in page data (avoids AJAX lookup) + */ + featureAvailability: FeatureAvailabilityContext; + /** + * Module loader configuration which may be merged-in with the parent host (if injected into the DOM) Because the config may be merged with the host config, each root area path must be explicitly defined here rather than relying on basePath as a catch-all. + */ + moduleLoaderConfig: ModuleLoaderConfiguration; + /** + * Paths to resources on this service + */ + paths: ConfigurationContextPaths; + /** + * Lookup of urls for different services (at different host levels) + */ + serviceLocations: ServiceLocations; + /** + * The root url of the service that can be used to resolve relative links when this content is hosted in another site. + */ + serviceRootUrl: string; + /** + * Instance id of the service + */ + serviceTypeId: string; +} + +/** +* An individual contribution made by an extension +*/ +interface Contribution { + /** + * List of constraints (filters) that should be applied to the availability of this contribution + */ + constraints: ContributionConstraint[]; + description: string; + id: string; + /** + * Properties/attributes of this contribution + */ + properties: any; + /** + * The ids of the contribution(s) that this contribution targets. (parent contributions) + */ + targets: string[]; + /** + * Id of the Contribution Type + */ + type: string; +} + +/** +* Base class shared by contributions and contribution types +*/ +interface ContributionBase { + /** + * Description of the contribution/type + */ + description: string; + /** + * Extension-relative identifier of the contribution/type + */ + id: string; +} + +/** +* Specifies a constraint that can be used to dynamically include/exclude a given contribution +*/ +interface ContributionConstraint { + /** + * An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included). + */ + group: number; + /** + * If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true) + */ + inverse: boolean; + /** + * Name of the IContributionFilter class + */ + name: string; + /** + * Properties that are fed to the contribution filter class + */ + properties: any; +} + +/** +* Model for a contribution context object which is used for contributed content provided by this service (e.g. Hubs). The content may be included in the parent DOM or iframed. This context provides information about how to popluate the content. +*/ +interface ContributionContext { + /** + * CSS class for the container element which will host this content. Typical usage is to just supply a unique CSS class on the element, register an enhancement for that class in a TypeScript module, and reference that TypeScript module in this ContributionContent object. + */ + containerCssClass: string; + /** + * Generic property bag which individual contributions can use to pass data to the client + */ + contributionData: any; + /** + * Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list. + */ + cssModulePrefixes: string[]; + /** + * List of CSS scripts to include as links with the content. Relative paths are resolved to Themed CSS urls. + */ + cssReferences: string[]; + /** + * The root url for CSS files for the given theme + */ + cssThemedRoot: string; + /** + * Module loader configuration which may be merged-in with the parent host (if injected into the DOM) Because the config may be merged with the host config, each root area path must be explicitly defined here rather than relying on basePath as a catch-all. + */ + moduleLoaderConfig: ModuleLoaderConfiguration; + /** + * List of script modules to reference. e.g. "VSS/Controls/Grids". A require statement is issued for these modules + */ + scriptModules: string[]; + /** + * Lookup of urls for different services (at different host levels) + */ + serviceLocations: ServiceLocations; + /** + * The root url of the service that can be used to resolve relative links when this content is hosted in another site. + */ + serviceUrl: string; + /** + * The static root url for this service + */ + staticRootUrl: string; +} + +/** +* Identifier for contributions and contribution types +*/ +interface ContributionIdentifier { + /** + * The extension id + */ + extensionId: string; + /** + * The full/unique identifier of the contribution/contributionType + */ + id: string; + /** + * The publisher id + */ + publisherId: string; + /** + * The extension-relative contribution id + */ + relativeId: string; +} + +/** +* Item representing a contribution path. Can be of type default, resource or bundle +*/ +interface ContributionPath { + /** + * Type if this contribution path + */ + pathType: ContributionPathType; + /** + * Replace value for this contribution path + */ + value: string; +} + +/** +* Type of the contribution path +*/ +declare enum ContributionPathType { + Default = 0, + Resource = 1, +} + +/** +* Description about a property of a contribution type +*/ +interface ContributionPropertyDescription { + /** + * Description of the property + */ + description: string; + /** + * Name of the property + */ + name: string; + /** + * True if this property is required + */ + required: boolean; + /** + * The type of value used for this property + */ + type: ContributionPropertyType; +} + +/** +* The type of value used for a property +*/ +declare enum ContributionPropertyType { + /** + * Contribution type is unknown (value may be anything) + */ + Unknown = 0, + /** + * Value is a string + */ + String = 1, + /** + * Value is a Uri + */ + Uri = 2, + /** + * Value is a GUID + */ + Guid = 4, + /** + * Value is True or False + */ + Boolean = 8, + /** + * Value is an integer + */ + Integer = 16, + /** + * Value is a double + */ + Double = 32, + /** + * Value is a DateTime object + */ + DateTime = 64, + /** + * Value is a generic Dictionary/JObject/property bag + */ + Dictionary = 128, + /** + * Value is an array + */ + Array = 256, + /** + * Value is an arbitrary/custom object + */ + Object = 512, +} + +/** +* A contribution type, given by a json schema +*/ +interface ContributionType { + description: string; + id: string; + /** + * Controls whether or not contributions of this type have the type indexed for queries. This allows clients to find all extensions that have a contribution of this type. NOTE: Only TrustedPartners are allowed to specify indexed contribution types. + */ + indexed: boolean; + /** + * Friendly name of the contribution/type + */ + name: string; + /** + * Describes the allowed properties for this contribution type + */ + properties: { [key: string]: ContributionPropertyDescription; }; +} + +/** +* Contains lists of script and css references that need to be included on the page in order for the controls used by the page to work. +*/ +interface CoreReferencesContext { + /** + * Core javascript files referenced on a page + */ + scripts: JavascriptFileReference[]; + /** + * Core CSS files referenced on a page + */ + stylesheets: StylesheetReference[]; +} + +interface DaylightSavingsAdjustmentEntry { + /** + * Millisecond adjustment from UTC + */ + offset: number; + /** + * Date that the offset adjustment starts + */ + start: Date; +} + +interface DiagnosticsContext { + /** + * Id of the current activity + */ + activityId: string; + allowStatsCollection: boolean; + debugMode: boolean; + sessionId: string; + tracePointCollectionEnabled: boolean; + tracePointProfileEnd: string; + tracePointProfileStart: string; +} + +interface ExtendedHostContext { + authority: string; + hostType: ContextHostType; + id: string; + isAADAccount: boolean; + name: string; + relativeUri: string; + scheme: string; + uri: string; +} + +/** +* Represents a VSO "extension" which is a container for contributions and contribution types +*/ +interface Extension { + baseUri: string; + contributions: Contribution[]; + contributionTypes: ContributionType[]; + eventCallbacks: ExtensionEventCallbackCollection; + /** + * The friendly extension id for this extension - unique for a given publisher. + */ + extensionId: string; + /** + * The display name of the extension. + */ + extensionName: string; + /** + * Extension flags relevant to contribution consumers + */ + flags: ExtensionFlags; + /** + * Globally unique id for this extension (the same id is used for all versions of a single extension) + */ + id: string; + language: string; + manifestVersion: any; + /** + * Unique id of the publisher of this extension + */ + publisherId: string; + /** + * The display name of the publisher + */ + publisherName: string; + /** + * Unique id for this extension (the same id is used for all versions of a single extension) + */ + registrationId: string; + scopes: string[]; + /** + * Version of this extension + */ + version: string; +} + +/** +* Base class for an event callback for an extension +*/ +interface ExtensionEventCallback { + /** + * The uri of the endpoint that is hit when an event occurs + */ + uri: string; +} + +/** +* Collection of event callbacks - endpoints called when particular extension events occur. +*/ +interface ExtensionEventCallbackCollection { + /** + * For multi-version extensions, defines an endpoint that gets called via an OPTIONS request to determine the particular version of the extension to be used + */ + versionCheck: ExtensionEventCallback; +} + +/** +* Set of flags applied to extensions that are relevant to contribution consumers +*/ +declare enum ExtensionFlags { + /** + * A built-in extension is installed for all VSO accounts by default + */ + BuiltIn = 1, + /** + * The extension comes from a fully-trusted publisher + */ + Trusted = 2, +} + +/** +* Base class for extension properties which are shared by the extension manifest and the extension model +*/ +interface ExtensionManifest { + /** + * Uri used as base for other relative uri's defined in extension + */ + baseUri: string; + /** + * List of contributions made by this extension + */ + contributions: Contribution[]; + /** + * List of contribution types defined by this extension + */ + contributionTypes: ContributionType[]; + /** + * Collection of endpoints that get called when particular extension events occur + */ + eventCallbacks: ExtensionEventCallbackCollection; + /** + * Language Culture Name set by the Gallery + */ + language: string; + /** + * Version of the extension manifest format/content + */ + manifestVersion: any; + /** + * List of all oauth scopes required by this extension + */ + scopes: string[]; +} + +/** +* The state of an extension +*/ +interface ExtensionState { + extensionId: string; + extensionName: string; + flags: any; + lastUpdated: Date; + /** + * The time at which the version was last checked + */ + lastVersionCheck: Date; + publisherName: string; + /** + * Version of this extension + */ + version: string; +} + +interface FeatureAvailabilityContext { + featureStates: { [key: string]: boolean; }; +} + +interface GlobalizationContext { + culture: string; + theme: string; + timeZoneId: string; + timezoneOffset: number; +} + +interface HostContext { + id: string; + name: string; + relativeUri: string; + uri: string; +} + +/** +* Model representing a hub in VSO pages' navigation menu +*/ +interface Hub { + groupId: string; + id: string; + isSelected: boolean; + name: string; + order: any; + uri: string; +} + +/** +* Model representing a hub group in VSO pages' navigation menu +*/ +interface HubGroup { + hasHubs: boolean; + id: string; + name: string; + order: any; + uri: string; +} + +/** +* Context information containing the relevant hubs and hub groups for a given context +*/ +interface HubsContext { + hubGroups: HubGroup[]; + hubGroupsCollectionContributionId: string; + hubs: Hub[]; + selectedHubGroupId: string; + selectedHubId: string; +} + +/** +* Model to represent a TeamFoundationIdentity +*/ +interface IdentityModel { + /** + * Custom display name + */ + customDisplayName: string; + /** + * Display name + */ + displayName: string; + /** + * Email address + */ + email: string; + /** + * Unique team foundation id + */ + id: string; + /** + * Is the identity active + */ + isActive: boolean; + /** + * Is the identity a group/team + */ + isContainer: boolean; + /** + * The provider's display name for this identity + */ + providerDisplayName: string; + /** + * Unique name for this identity + */ + uniqueName: string; +} + +/** +* Reference to a javascript file to include on a page +*/ +interface JavascriptFileReference { + /** + * Condition to check in the case that Url lives on a CDN. The fallback script will be included if this check fails. + */ + fallbackCondition: string; + /** + * Fallback url to use in case Url lives on a CDN + */ + fallbackUrl: string; + /** + * Id of the reference (JQuery, JQueryUI, MicrosoftAjax, etc.) + */ + identifier: string; + /** + * Is this a core javascript file that needs to be included on every page + */ + isCoreModule: boolean; + /** + * Url of the javascript reference + */ + url: string; +} + +/** +* Class used to wrap arrays in an object. +*/ +interface JsonArrayWrapper { + __wrappedArray: string; +} + +interface MicrosoftAjaxConfig { + cultureInfo: any; +} + +/** +* AMD javascript module loader configuration +*/ +interface ModuleLoaderConfiguration { + baseUrl: string; + contributionPaths: { [key: string]: ContributionPath; }; + paths: { [key: string]: string; }; + shim: { [key: string]: ModuleLoaderShimConfiguration; }; +} + +/** +* AMD javascript module loader shim configuration +*/ +interface ModuleLoaderShimConfiguration { + deps: string[]; + exports: string; +} + +/** +* Structure to specify current navigation context of the executing request. The navigation context content's are generally obtained from the request URL. Some context specifiers such as "Account" can be implicit and might come from current IVssServiceHost. +*/ +interface NavigationContext { + /** + * A token to show which area the request has been targeted to. By default there are two areas "Admin" and "Api". They can be specified in the URL as _admin and _api respectively. + */ + area: string; + /** + * Current action route value + */ + currentAction: string; + /** + * Current controller route value + */ + currentController: string; + /** + * Current parameters route value (the path after the controller and action in the url) + */ + currentParameters: string; + /** + * Flag to show top most navigation context. For example the URL http://server:port/collection/project/_controller/action sets the Project bit while the URL http://server:port/collection/project/_admin/_controller/action sets also sets the area property to Admin. + */ + topMostLevel: NavigationContextLevels; +} + +/** +* Flags to show which tokens of the navigation context are present in the current request URL. The request url's context part are formed like http://server:port[/{collection}[/{project}[/{team}]]][/_admin]/_{controller}/{action} The tokens {collection}, {project} and {team} are navigation level tokens whereas _admin segment is a switch to show admin areas of the site. +*/ +declare enum NavigationContextLevels { + None = 0, + /** + * Root level in Azure. + */ + Deployment = 1, + /** + * Root level in on premises. Neither of {collection}, {project} and {team} tokens have information + */ + Application = 2, + /** + * Flag to show {collection} token has information. + */ + Collection = 4, + /** + * Flag to show {project} token has information. + */ + Project = 8, + /** + * Flag to show {team} token has information. + */ + Team = 16, + /** + * Sugar for all application levels. + */ + ApplicationAll = 30, + /** + * Sugar for all levels + */ + All = 31, +} + +/** +* Global context placed on each VSSF web page (through json island data) which gives enough information for core TypeScript modules/controls on the page to operate +*/ +interface PageContext { + /** + * Configuration for reporting telemetry/usage data to App Insights + */ + appInsightsConfiguration: AppInsightsConfiguration; + /** + * Core javascript and css references + */ + coreReferences: CoreReferencesContext; + /** + * Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list. + */ + cssModulePrefixes: string[]; + /** + * Diagnostic related information for the current page + */ + diagnostics: DiagnosticsContext; + /** + * Feature flag states to include by default in page data (avoids AJAX lookup) + */ + featureAvailability: FeatureAvailabilityContext; + /** + * Globalization data for the current page based on the current user's settings + */ + globalization: GlobalizationContext; + /** + * Configuration needed for Microsoft.Ajax library + */ + microsoftAjaxConfig: MicrosoftAjaxConfig; + /** + * The (AMD) module configuration + */ + moduleLoaderConfig: ModuleLoaderConfiguration; + /** + * Current navigation context. + */ + navigation: NavigationContext; + /** + * The service instance type id for the VSO service serving this page + */ + serviceInstanceId: string; + serviceLocations: ServiceLocations; + /** + * Contains global time zone configuration information (e.g. which dates DST changes) + */ + timeZonesConfiguration: TimeZonesConfiguration; + /** + * Web Access configuration + */ + webAccessConfiguration: ConfigurationContext; + /** + * The web context information for the given page request + */ + webContext: WebContext; +} + +interface Scope { + description: string; + title: string; + value: string; +} + +/** +* Holds a lookup of urls for different services (at different host levels) +*/ +interface ServiceLocations { + locations: { [key: string]: { [key: number]: string; }; }; +} + +/** +* Reference to a CSS file to include on a page +*/ +interface StylesheetReference { + /** + * Url of the high-contrast version of the CSS file + */ + highContrastUrl: string; + /** + * Is this a core stylesheet that needs to be included in child frames + */ + isCoreStylesheet: boolean; + /** + * Url of the CSS file + */ + url: string; +} + +/** +* Information about the extension +*/ +interface SupportedExtension { + /** + * Unique Identifier for this extension + */ + extension: string; + /** + * Unique Identifier for this publisher + */ + publisher: string; + /** + * Supported version for this extension + */ + version: string; +} + +interface TeamContext { + id: string; + name: string; + userIsAdmin: boolean; + userIsMember: boolean; +} + +/** +* Data contract to represent a given team foundation service host (account, collection, deployment) +*/ +interface TeamFoundationServiceHostModel { + /** + * Type of host (deployment, account, collection) + */ + hostType: any; + /** + * Unique id of the host (collection id, account id, etc.) + */ + instanceId: string; + /** + * Name of the host (collection name, account name, etc.) + */ + name: string; + /** + * Path of the service host, relative to the root virtual directory (e.g. DefaultCollection) + */ + relVDir: string; + /** + * Path of the service host relative to the web application root (e.g. /tfs/DefaultCollection) + */ + vDir: string; +} + +interface TfsMailSettings { + enabled: boolean; + from: string; +} + +/** +* Internal structure to describe IVssServiceHost +*/ +interface TfsServiceHostDescriptor { + hostType: any; + id: string; + name: string; + relVdir: string; + vdir: string; +} + +interface TimeZonesConfiguration { + daylightSavingsAdjustments: DaylightSavingsAdjustmentEntry[]; +} + +interface UserContext { + email: string; + id: string; + limitedAccess: boolean; + name: string; + uniqueName: string; +} + +/** +* Web Access configuration data. This information is used to process requests on the server. This data is also placed in a json island on each page in order for JavaScript to know key configuration data required to things like construct proper urls +*/ +interface WebAccessConfiguration { + /** + * Optional name of the client (e.g. TEE) hosting the page + */ + clientHost: string; + /** + * Current mail settings for TFS + */ + mailSettings: TfsMailSettings; + /** + * Relative path to the _content path of the web application + */ + resourcesPath: string; + /** + * Relative path to the root of the web application + */ + rootPath: string; + /** + * Relative path to unversioned 3rd party static content + */ + staticRoot3rdParty: string; + /** + * Relative path to versioned static content + */ + staticRootTfs: string; + /** + * Api-version for legacy rpc-style web access api controllers See WebApiVersionClient for the version coming from the client/browser. The return value is a positive whole number >= 1. + */ + webApiVersion: string; +} + +/** +* Context information for all web access requests +*/ +interface WebContext { + account: HostContext; + /** + * Information about the Collection used in the current request (may be null) + */ + collection: HostContext; + /** + * Information about the current request context's host + */ + host: ExtendedHostContext; + /** + * Information about the project used in the current request (may be null) + */ + project: ContextIdentifier; + /** + * Information about the team used in the current request (may be null) + */ + team: TeamContext; + /** + * Information about the current user + */ + user: UserContext; +} + +declare module XDM { + interface IDeferred { + resolve: (result: T) => void; + reject: (reason: any) => void; + promise: IPromise; + } + /** + * Create a new deferred object + */ + function createDeferred(): IDeferred; + /** + * Settings related to the serialization of data across iframe boundaries. + */ + interface ISerializationSettings { + /** + * By default, properties that begin with an underscore are not serialized across + * the iframe boundary. Set this option to true to serialize such properties. + */ + includeUnderscoreProperties: boolean; + } + /** + * Catalog of objects exposed for XDM + */ + class XDMObjectRegistry implements IXDMObjectRegistry { + private _registeredObjects; + /** + * Register an object (instance or factory method) exposed by this frame to callers in a remote frame + * + * @param instanceId unique id of the registered object + * @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. + */ + register(instanceId: string, instance: Object | { + (contextData?: any): Object; + }): void; + /** + * Get an instance of an object registered with the given id + * + * @param instanceId unique id of the registered object + * @param contextData Optional context data to pass to a registered object's factory method + */ + getInstance(instanceId: string, contextData?: Object): T; + } + /** + * The registry of global XDM handlers + */ + var globalObjectRegistry: XDMObjectRegistry; + /** + * Represents a channel of communication between frames\document + * Stays "alive" across multiple funtion\method calls + */ + class XDMChannel implements IXDMChannel { + private static _nextChannelId; + private static MAX_XDM_DEPTH; + private static WINDOW_TYPES_TO_SKIP_SERIALIZATION; + private static JQUERY_TYPES_TO_SKIP_SERIALIZATION; + private _nextMessageId; + private _deferreds; + private _postToWindow; + private _targetOrigin; + private _handshakeToken; + private _channelObjectRegistry; + private _channelId; + private _nextProxyFunctionId; + private _proxyFunctions; + constructor(postToWindow: Window, targetOrigin?: string); + /** + * Get the object registry to handle messages from this specific channel. + * Upon receiving a message, this channel registry will be used first, then + * the global registry will be used if no handler is found here. + */ + getObjectRegistry(): IXDMObjectRegistry; + /** + * Invoke a method via RPC. Lookup the registered object on the remote end of the channel and invoke the specified method. + * + * @param method Name of the method to invoke + * @param instanceId unique id of the registered object + * @param params Arguments to the method to invoke + * @param instanceContextData Optional context data to pass to a registered object's factory method + * @param serializationSettings Optional serialization settings + */ + invokeRemoteMethod(methodName: string, instanceId: string, params?: any[], instanceContextData?: Object, serializationSettings?: ISerializationSettings): IPromise; + /** + * Get a proxied object that represents the object registered with the given instance id on the remote side of this channel. + * + * @param instanceId unique id of the registered object + * @param contextData Optional context data to pass to a registered object's factory method + */ + getRemoteObjectProxy(instanceId: string, contextData?: Object): IPromise; + private invokeMethod(registeredInstance, rpcMessage); + private getRegisteredObject(instanceId, instanceContext?); + /** + * Handle a received message on this channel. Dispatch to the appropriate object found via object registry + * + * @param data Message data + * @param origin Origin of the frame that sent the message + * @return True if the message was handled by this channel. Otherwise false. + */ + onMessage(data: any, origin: string): boolean; + owns(source: Window, origin: string, data: any): boolean; + private _error(messageObj, errorObj, handshakeToken); + private _success(messageObj, result, handshakeToken); + private _sendRpcMessage(message); + private _shouldSkipSerialization(obj); + private _customSerializeObject(obj, settings, parentObjects?, nextCircularRefId?, depth?); + private _registerProxyFunction(func, context); + private _customDeserializeObject(obj, circularRefs?); + } + /** + * Registry of XDM channels kept per target frame/window + */ + class XDMChannelManager implements IXDMChannelManager { + private static _default; + private _channels; + constructor(); + static get(): XDMChannelManager; + /** + * Add an XDM channel for the given target window/iframe + * + * @param window Target iframe window to communicate with + * @param targetOrigin Url of the target iframe (if known) + */ + addChannel(window: Window, targetOrigin?: string): IXDMChannel; + private _handleMessageReceived(event); + private _subscribe(windowObj); + } +} +declare module VSS { + var VssSDKVersion: number; + var VssSDKRestVersion: string; + /** + * Service Ids for core services (to be used in VSS.getService) + */ + module ServiceIds { + /** + * Service for showing dialogs in the host frame + * Use: + */ + var Dialog: string; + /** + * Service for interacting with the host frame's navigation (getting/updating the address/hash, reloading the page, etc.) + * Use: + */ + var Navigation: string; + /** + * Service for interacting with extension data (setting/setting documents and collections) + * Use: + */ + var ExtensionData: string; + } + /** + * Initiates the handshake with the host window. + * + * @param options Initialization options for the extension. + */ + function init(options: IExtensionInitializationOptions): void; + /** + * Ensures that the AMD loader from the host is configured and fetches a script (AMD) module + * (and its dependencies). If no callback is supplied, this will still perform an asynchronous + * fetch of the module (unlike AMD require which returns synchronously). This method has no return value. + * + * Usage: + * + * VSS.require(["VSS/Controls", "VSS/Controls/Grids", function(Controls, Grids) { + * ... + * }); + * + * @param modules A single module path (string) or array of paths (string[]) + * @param callback Method called once the modules have been loaded. + */ + function require(modules: string[] | string, callback?: Function): void; + /** + * Register a callback that gets called once the initial setup/handshake has completed. + * If the initial setup is already completed, the callback is invoked at the end of the current call stack. + */ + function ready(callback: () => void): void; + /** + * Notifies the host that the extension successfully loaded (stop showing the loading indicator) + */ + function notifyLoadSucceeded(): void; + /** + * Notifies the host that the extension failed to load + */ + function notifyLoadFailed(e: any): void; + /** + * Get the web context from the parent host + */ + function getWebContext(): WebContext; + /** + * Get the configuration data passed in the initial handshake from the parent frame + */ + function getConfiguration(): any; + /** + * Get the context about the extension that owns the content that is being hosted + */ + function getExtensionContext(): IExtensionContext; + /** + * Gets the information about the contribution that first caused this extension to load. + */ + function getContribution(): Contribution; + /** + * Get a contributed service from the parent host. + * + * @param contributionId Full Id of the service contribution to get the instance of + * @param context Optional context information to use when obtaining the service instance + */ + function getService(contributionId: string, context?: Object): IPromise; + /** + * Get the contribution with the given contribution id. The returned contribution has a method to get a registered object within that contribution. + * + * @param contributionId Id of the contribution to get + */ + function getServiceContribution(contributionId: string): IPromise; + /** + * Get contributions that target a given contribution id. The returned contributions have a method to get a registered object within that contribution. + * + * @param targetContributionId Contributions that target the contribution with this id will be returned + */ + function getServiceContributions(targetContributionId: string): IPromise; + /** + * Register an object (instance or factory method) that this extension exposes to the host frame. + * + * @param instanceId unique id of the registered object + * @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. + */ + function register(instanceId: string, instance: Object | { + (contextData?: any): Object; + }): void; + /** + * Get an instance of an object registered with the given id + * + * @param instanceId unique id of the registered object + * @param contextData Optional context data to pass to the contructor of an object factory method + */ + function getRegisteredObject(instanceId: string, contextData?: Object): Object; + /** + * Fetch an access token which will allow calls to be made to other VSO services + */ + function getAccessToken(): IPromise; + /** + * Fetch an token which can be used to identify the current user + */ + function getAppToken(): IPromise; + /** + * Requests the parent window to resize the container for this extension based on the current extension size. + */ + function resize(): void; +} +declare module "VSS/Accounts/Contracts" { +export interface Account { + /** + * Identifier for an Account + */ + accountId: string; + /** + * Name for an account + */ + accountName: string; + /** + * Owner of account + */ + accountOwner: string; + /** + * Current account status + */ + accountStatus: AccountStatus; + /** + * Type of account: Personal, Organization + */ + accountType: AccountType; + /** + * Uri for an account + */ + accountUri: string; + /** + * Who created the account + */ + createdBy: string; + /** + * Date account was created + */ + createdDate: Date; + /** + * Identity of last person to update the account + */ + lastUpdatedBy: string; + /** + * Date account was last updated + */ + lastUpdatedDate: Date; + /** + * Namespace for an account + */ + namespaceId: string; + /** + * Organization that created the account + */ + organizationName: string; + /** + * Extended properties + */ + properties: any; + /** + * Reason for current status + */ + statusReason: string; +} +export interface AccountCreateInfoInternal { + accountName: string; + creator: string; + organization: string; + preferences: AccountPreferencesInternal; + properties: any; + serviceDefinitions: { + key: string; + value: string; + }[]; +} +export interface AccountLicenseInfo { + consumedCount: number; + inUseCount: number; + licenseName: string; +} +export enum AccountLicenseSource { + /** + * The following correspond to various license sources + */ + None = 2, + VsExpress = 10, + VsPro = 12, + VsTestPro = 14, + VsPremium = 16, + VsUltimate = 18, + MSDN = 38, + MsdnPro = 40, + MsdnTestPro = 42, + MsdnPremium = 44, + MsdnUltimate = 46, + MsdnPlatforms = 48, + VSOStandard = 50, + VSOAdvanced = 52, + VSOProStandard = 54, + Win8 = 56, + Desktop = 58, + Phone = 60, + /** + * Early adopters may get a special license + */ + VsEarlyAdopter = 70, +} +export interface AccountPreferencesInternal { + culture: any; + language: any; + timeZone: any; +} +export enum AccountServiceRights { + StandardLicense = 0, + AdvancedLicense = 1, + ProfessionalLicense = 2, + None = 3, +} +export enum AccountStatus { + None = 0, + /** + * This hosting account is active and assigned to a customer. + */ + Enabled = 1, + /** + * This hosting account is disabled. + */ + Disabled = 2, + /** + * This account is part of deletion batch and scheduled for deletion. + */ + Deleted = 3, +} +export enum AccountType { + Personal = 0, + Organization = 1, +} +export interface AccountUser { + /** + * Identifier for an Account + */ + accountId: string; + /** + * Date account was created + */ + creationDate: Date; + /** + * Date account was last updated + */ + lastUpdated: Date; + /** + * What is the license for this user MSDN, VSPro, etc. + */ + licenseSource: AccountLicenseSource; + /** + * What are the users service rights + */ + serviceRights: AccountServiceRights; + /** + * The user identity to be associated with the account + */ + userId: string; + /** + * Current account status + */ + userStatus: AccountUserStatus; +} +export enum AccountUserStatus { + None = 0, + /** + * User has signed in at least once to the VSO account + */ + Active = 1, + /** + * User cannot sign in; primarily used by admin to temporarily remove a user due to absence or license reallocation + */ + Disabled = 2, + /** + * User is removed from the VSO account by the VSO account admin + */ + Deleted = 3, + /** + * User is invited to join the VSO account by the VSO account admin, but has not signed up/signed in yet + */ + Pending = 4, + /** + * User can sign in; primarily used when license is in expired state and we give a grace period + */ + Expired = 5, + /** + * User is disabled; if reenabled, they will still be in the Pending state + */ + PendingDisabled = 6, +} +export var TypeInfo: { + Account: { + fields: any; + }; + AccountCreateInfoInternal: { + fields: any; + }; + AccountLicenseInfo: { + fields: any; + }; + AccountLicenseSource: { + enumValues: { + "none": number; + "vsExpress": number; + "vsPro": number; + "vsTestPro": number; + "vsPremium": number; + "vsUltimate": number; + "mSDN": number; + "msdnPro": number; + "msdnTestPro": number; + "msdnPremium": number; + "msdnUltimate": number; + "msdnPlatforms": number; + "vSOStandard": number; + "vSOAdvanced": number; + "vSOProStandard": number; + "win8": number; + "desktop": number; + "phone": number; + "vsEarlyAdopter": number; + }; + }; + AccountPreferencesInternal: { + fields: any; + }; + AccountServiceRights: { + enumValues: { + "standardLicense": number; + "advancedLicense": number; + "professionalLicense": number; + "none": number; + }; + }; + AccountStatus: { + enumValues: { + "none": number; + "enabled": number; + "disabled": number; + "deleted": number; + }; + }; + AccountType: { + enumValues: { + "personal": number; + "organization": number; + }; + }; + AccountUser: { + fields: any; + }; + AccountUserStatus: { + enumValues: { + "none": number; + "active": number; + "disabled": number; + "deleted": number; + "pending": number; + "expired": number; + "pendingDisabled": number; + }; + }; +}; +} +declare module "VSS/Accounts/RestClient" { +import Contracts = require("VSS/Accounts/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class AccountsHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} accountId + * @param {string} properties + * @return IPromise + */ + getAccount(accountId: string, properties?: string): IPromise; + /** + * [Preview API] + * + * @param {string} creatorId + * @param {string} ownerId + * @param {string} memberId + * @param {boolean} includeOwner + * @param {string} properties + * @param {boolean} includeDisabledAccounts + * @return IPromise + */ + getAccounts(creatorId?: string, ownerId?: string, memberId?: string, includeOwner?: boolean, properties?: string, includeDisabledAccounts?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Account} account + * @param {string} accountId + * @return IPromise + */ + updateAccount(account: Contracts.Account, accountId: string): IPromise; +} +export class AccountsHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * @param {string} accountId + * @param {string} properties + * @return IPromise + */ + getAccount(accountId: string, properties?: string): IPromise; + /** + * @param {string} creatorId + * @param {string} ownerId + * @param {string} memberId + * @param {boolean} includeOwner + * @param {string} properties + * @param {boolean} includeDisabledAccounts + * @return IPromise + */ + getAccounts(creatorId?: string, ownerId?: string, memberId?: string, includeOwner?: boolean, properties?: string, includeDisabledAccounts?: boolean): IPromise; + /** + * @param {Contracts.Account} account + * @param {string} accountId + * @return IPromise + */ + updateAccount(account: Contracts.Account, accountId: string): IPromise; +} +export class AccountsHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * @param {string} accountId + * @param {string} properties + * @return IPromise + */ + getAccount(accountId: string, properties?: string): IPromise; + /** + * @param {string} creatorId + * @param {string} ownerId + * @param {string} memberId + * @param {boolean} includeOwner + * @param {string} properties + * @param {boolean} includeDisabledAccounts + * @return IPromise + */ + getAccounts(creatorId?: string, ownerId?: string, memberId?: string, includeOwner?: boolean, properties?: string, includeDisabledAccounts?: boolean): IPromise; + /** + * @param {Contracts.Account} account + * @param {string} accountId + * @return IPromise + */ + updateAccount(account: Contracts.Account, accountId: string): IPromise; +} +export class AccountsHttpClient extends AccountsHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return AccountsHttpClient2_1 + */ +export function getClient(): AccountsHttpClient2_1; +} +declare module "VSS/Adapters/Knockout" { +import Controls = require("VSS/Controls"); +export interface ITemplateViewModel extends IDisposable { + dispose(): void; +} +export class TemplateViewModel implements ITemplateViewModel, Controls.EnhancementOptions { + /** + * Manager for disposables. + */ + private _disposalManager; + constructor(); + /** + * Disposes all disposables. + */ + dispose(): void; + /** + * Proxy for a knockout subscription to keep track of it to ensure that when the control is disposed, subscription is also disposed. + */ + subscribe(subscribable: KnockoutSubscribable, callback: (newValue: any) => void): KnockoutSubscription; + /** + * Proxy for a knockout computed to keep track of it to ensure that when the control is disposed, computed is also disposed. + */ + computed(func: () => any): KnockoutComputed; + /** + * Adds a disposable object to the list + */ + _addDisposable(disposable: IDisposable): IDisposable; +} +export interface TemplateControlRegistration { + /** + * Type of the control to be registered. + */ + controlType: any; + /** + * Delegate used to generate the view model for the registered control. + */ + viewModelGenerator: (context?: any) => ITemplateViewModel; +} +export interface TemplateControlOptions { + /** + * Html template is going to be set as the html content for the element. + */ + templateHtml?: string; + /** + * If templateId is used there needs to be a script element (with type="text/html") + * in the DOM with the id equal to templateId. + * This templateId will be used to get the template from the DOM. + */ + templateId?: string; +} +export interface ITemplateControl { + /** + * Applies the template binding on the specified element. + * + * @param element Element owning the template and viewmodel to be bound. + */ + applyBinding(element: JQuery): void; + /** + * Perform verious disposals for the control. + */ + dispose(): void; +} +export class TemplateControl extends Controls.BaseControl implements ITemplateControl { + /** + * Registers a template control to be invoked later. + * + * @param templateId Id of the template. + * @param controlType Type of the registered control. + * @param viewModelGenerator Delegate to generate the viewmodel. + */ + static registerBinding(templateId: string, controlType: any, viewModelGenerator: (context?: any) => ITemplateViewModel): void; + /** + * Creates a new template control using registered control specified by template id. + * + * @param templateId Id of the template. + * @param element Element owning the template and viewmodel to be bound. + * @param viewModelContext Context used to generate view model. + * @return New instance of the control. + */ + static applyRegisteredBinding(templateId: string, element: JQuery, viewModelContext: any): TControl; + /** + * Creates a new template control using the specified type, element and options. + * + * @param controlType Type of the control. + * @param element Element owning the template and viewmodel to be bound. + * @param viewModel View model used for binding. + * @param options Template options like templateHtml and templateId. + * @return New instance of the control. + */ + static applyBinding(controlType: any, element: JQuery, viewModel: TViewModel, options: TemplateControlOptions): TControl; + /** + * View model used for binding. + */ + private _viewModel; + /** + * Manager for disposables. + */ + private _disposalManager; + /** + * Do not use this! Instead, use TemplateControl.applyBinding. + */ + constructor(viewModel: TViewModel, options?: TemplateControlOptions); + /** + * Gets the viewmodel bound to this control. + */ + getViewModel(): TViewModel; + /** + * See interface. + */ + applyBinding(element: JQuery): void; + /** + * Proxy for a knockout subscription to keep track of it to ensure that when the control is disposed, subscription is also disposed. + */ + subscribe(subscribable: KnockoutSubscribable, callback: (newValue: any) => void): KnockoutSubscription; + /** + * Proxy for a knockout computed to keep track of it to ensure that when the control is disposed, computed is also disposed. + */ + computed(func: () => any): KnockoutComputed; + /** + * See base. + */ + _cleanup(): void; + /** + * Default template binding which is knockout. + * By overriding this method, a different binding pattern can be used. + */ + _performBinding(element: JQuery, options: TemplateControlOptions): void; +} +} +declare module "VSS/Ajax" { +export interface JQueryAjaxResult { + jqXHR: JQueryXHR; + textStatus: string; +} +export interface JQueryAjaxSuccessResult extends JQueryAjaxResult { + data: any; +} +export interface JQueryAjaxErrorResult extends JQueryAjaxResult { + errorThrown: any; +} +/** +* Custom DataTypes that can be used in addition to jQuery's default text, json, xml, etc. types. +* This module provides custom ajaxTransports for these types +*/ +export module CustomTransportDataTypes { + /** + * Raw binary data returned as an ArrayBuffer + */ + var Binary: string; +} +/** +* Issue an AJAX request. This is a wrapper around jquery's ajax method that handles VSS authentication +* and triggers events that can be listened to by other modules. +* +* @param requestUrl Url to send the request to +* @param ajaxOptions jQuery.ajax options +* @param vssRequestOptions VSS specific request options +* @param useAjaxResult If true, textStatus and jqXHR are added to the success callback. In this case, spread (instead of then) needs to be used +*/ +export function issueRequest(requestUrl: string, ajaxOptions: JQueryAjaxSettings, vssRequestOptions?: IVssAjaxOptions): IPromise; +/** +* Add a listener that gets notified whenever requests from this client begin/end/etc. +* +* @param listener HttpClient listener to add +*/ +export function addGlobalListener(listener: IVssAjaxEventListener): void; +/** +* Remove a listener that gets notified whenever requests from this client begin/end/etc. +* +* @param listener HttpClient listener to remove +*/ +export function removeGlobalListener(listener: IVssAjaxEventListener): void; +} +declare module "VSS/Artifacts/Constants" { +export module ArtifactTypeNames { + var TcmResult: string; + var TcmResultAttachment: string; + var Build: string; + var VersionedItem: string; + var LatestItemVersion: string; + var Changeset: string; + var Shelveset: string; + var WorkItem: string; + var Storyboard: string; + var Commit: string; + var CodeReviewId: string; + var CodeReviewSdkId: string; + var PullRequestId: string; + var ProjectDownloadProject: string; + /** + * A Git Ref + */ + var Ref: string; +} +export module ToolNames { + var VersionControl: string; + var WorkItemTracking: string; + var TeamBuild: string; + var TestManagement: string; + var Requirements: string; + var Legacy: string; + var CodeSense: string; + var Git: string; + var CodeReview: string; + var ProjectDownload: string; +} +} +declare module "VSS/Artifacts/Services" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +import Service = require("VSS/Service"); +export interface IArtifactData { + uri?: string; + tool: string; + type: string; + id: string; +} +export class Artifact { + static _execute(artifact: Artifact, webContext: Contracts_Platform.WebContext): void; + static ACTION_ARTIFACT_EXECUTE: string; + _data: any; + _error: any; + constructor(data: IArtifactData); + getUri(): string; + getTool(): string; + getType(): string; + getId(): string; + /** + * @return + */ + getTitle(): string; + setError(error: any): void; + getError(): any; + execute(webContext: Contracts_Platform.WebContext): any; + /** + * @return + */ + getUrl(webContext: Contracts_Platform.WebContext): string; +} +export class LinkingUtilities { + static VSTFS: string; + static URI_SEPARATOR: string; + /** + * Creates an artifact URI using specified artifact. + * + * @param artifact Artifact should have the following properties: + * - tool: Artifact tool name + * - type: Artifact type + * - id: Artifact tool specific id + * @return + */ + static encodeUri(artifact: any): string; + /** + * Decodes the specified artifact URI and creates artifact object which has tool, type and id properties. + * + * @param artifactUri URI to decode + * @return + */ + static decodeUri(artifactUri: string): IArtifactData; + /** + * Decodes a uri component, maintaining backwards compatibility with how URIs were encoded + * from the rich client and in VS2010 and earlier versions. + * + * @param encodedURIComponent URI component to decode + * @return + */ + static legacyDecodeURIComponent(encodedURIComponent: string): string; +} +export class ClientLinking extends Service.VssService { + static MODE_TRANSLATEURL: string; + static registerArtifactResolver(toolName: string, resolver: any): void; + static getArtifactResolver(toolName: string): any; + constructor(); + beginResolveArtifacts(artifactUris: string[], options?: any, callback?: IResultCallback, errorCallback?: IErrorCallback): void; +} +} +declare module "VSS/Authentication/Contracts" { +export interface CustomerIntelligenceEvent { + area: string; + feature: string; + properties: { + [key: string]: any; + }; +} +export enum DelegatedAppTokenType { + Session = 0, + App = 1, +} +export interface WebSessionToken { + appId: string; + force: boolean; + name: string; + namedTokenId: string; + token: string; + tokenType: DelegatedAppTokenType; + validTo: Date; +} +export var TypeInfo: { + CustomerIntelligenceEvent: { + fields: any; + }; + DelegatedAppTokenType: { + enumValues: { + "session": number; + "app": number; + }; + }; + WebSessionToken: { + fields: any; + }; +}; +} +declare module "VSS/Authentication/RestClient" { +import Contracts = require("VSS/Authentication/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class AuthenticationHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.WebSessionToken} sessionToken + * @return IPromise + */ + createSessionToken(sessionToken: Contracts.WebSessionToken): IPromise; +} +export class AuthenticationHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.WebSessionToken} sessionToken + * @return IPromise + */ + createSessionToken(sessionToken: Contracts.WebSessionToken): IPromise; +} +export class AuthenticationHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.WebSessionToken} sessionToken + * @return IPromise + */ + createSessionToken(sessionToken: Contracts.WebSessionToken): IPromise; +} +export class AuthenticationHttpClient extends AuthenticationHttpClient2_2 { + constructor(rootRequestPath: string); +} +} +declare module "VSS/Authentication/Services" { +import Authentication_Contracts = require("VSS/Authentication/Contracts"); +export module CoreNamedWebSessionTokenIds { + var Profile: string; +} +/** +* Helper methods for dealing with basic auth +*/ +export module BasicAuthHelpers { + /** + * Create the Authorization header value given the basic auth credentials + * + * @param user The username portion of the credentials + * @param password The password portion of the credentials + */ + function getBasicAuthHeader(user: string, password: string): string; + /** + * Create base-64 encoded user:password value used for basic auth. + * + * @param user The username portion of the credentials + * @param password The password portion of the credentials + */ + function getBasicAuthValue(user: string, password: string): string; +} +/** +* IAuthTokenManager for a named web session token. +*/ +export class NamedWebSessionTokenManager implements IAuthTokenManager { + private _namedTokenId; + private _tokenPromise; + private _tokenExpirationTime; + private _authClient; + constructor(namedTokenId: string); + /** + * Get the auth token to use for this request. + */ + getAuthToken(refresh?: boolean): IPromise; + /** + * Gets the authorization header to use in a request from the given token + * + * @param sessionToken Used for token key. + * @return the value to use for the Authorization header in a request. + */ + getAuthorizationHeader(sessionToken: Authentication_Contracts.WebSessionToken): string; +} +/** +* IAuthTokenManager for an explicit basic auth token. +*/ +export class BasicAuthTokenManager implements IAuthTokenManager { + private _user; + private _password; + constructor(user: string, password: string); + /** + * Get the auth token to use for this request. + */ + getAuthToken(refresh?: boolean): IPromise; + /** + * Gets the authorization header to use in a request from the given token + * + * @param sessionToken Used for token key. + * @return the value to use for the Authorization header in a request. + */ + getAuthorizationHeader(sessionToken: string): string; +} +/** +* Exposes the default auth token manager for account-level tokens +*/ +export var authTokenManager: IAuthTokenManager; +/** +* Fetch a session token to use for the current user for the given application (or null/empty for an unscoped token). +* +* @param appId Id of the application. +* @param name Metadata info to identify the token. +* @param force Enables skipping cache and issue a brand new token. +* @return Session token. +*/ +export function getToken(appId?: string, name?: string, force?: boolean, scoped?: boolean): IPromise; +/** +* Fetch an app token to use for the current user for the given application. This can be used to authenticate +* with an external application. +* +* @param appId Id of the application. +* @param name Metadata info to identify the token. +* @param force Enables skipping cache and issue a brand new token. +* @return Session token. +*/ +export function getAppToken(appId: string, name?: string, force?: boolean): IPromise; +/** +* Get an auth token manager - either the default manager or the manager for a registered/named token +* +* @param namedToken Id Optional value to use when getting a named web session token. +*/ +export function getAuthTokenManager(namedTokenId?: string): IAuthTokenManager; +} +declare module "VSS/Commerce/Contracts" { +export enum AccountProviderNamespace { + VisualStudioOnline = 0, + AppInsights = 1, + Marketplace = 2, +} +/** + * Represents an azure region, used by ibiza for linking accounts + */ +export interface AzureRegion { + /** + * Display Name of the azure region. Ex: North Central US. + */ + displayName: string; + /** + * Unique Identifier + */ + id: string; + /** + * Region code of the azure region. Ex: NCUS. + */ + regionCode: string; +} +/** + * Information about a resource associated with a subscription. + */ +export interface IOfferSubscription { + /** + * The azure subscription id + */ + azureSubscriptionId: string; + /** + * The azure subscription name + */ + azureSubscriptionName: string; + /** + * The azure subscription state + */ + azureSubscriptionState: SubscriptionStatus; + /** + * Quantity commited by the user, when resources is commitment based. + */ + committedQuantity: number; + /** + * A enumeration value indicating why the resource was disabled. + */ + disabledReason: ResourceStatusReason; + /** + * Uri pointing to user action on a disabled resource. It is based on value. + */ + disabledResourceActionLink: string; + /** + * Quantity included for free. + */ + includedQuantity: number; + /** + * Returns true if paid billing is enabled on the resource. Returns false for non-azure subscriptions, disabled azure subscriptions or explicitly disabled by user + */ + isPaidBillingEnabled: boolean; + /** + * Returns true if resource is can be used otherwise returns false. can be used to identify why resource is disabled. + */ + isUseable: boolean; + /** + * Returns an integer representing the maximum quantity that can be billed for this resource. Any usage submitted over this number is automatically excluded from being sent to azure. + */ + maximumQuantity: number; + /** + * Gets the name of this resource. + */ + offerMeter: OfferMeter; + /** + * Gets the renewal group. + */ + renewalGroup: ResourceRenewalGroup; + /** + * Returns a Date of UTC kind indicating when the next reset of quantities is going to happen. On this day at UTC 2:00 AM is when the reset will occur. + */ + resetDate: Date; +} +/** + * The subscription account. Add Sub Type and Owner email later. + */ +export interface ISubscriptionAccount { + /** + * Gets or sets the account identifier. Usually a guid. + */ + accountId: string; + /** + * Gets or sets the name of the account. + */ + accountName: string; + /** + * Gets or sets the account tenantId. + */ + accountTenantId: string; + /** + * Gets or sets the geo location. + */ + geoLocation: string; + /** + * Gets or sets a value indicating whether the calling user identity owns the account. + */ + isAccountOwner: boolean; + /** + * Gets or set the flag to enable purchase via subscription. + */ + isEligibleForPurchase: boolean; + /** + * get or set IsPrepaidFundSubscription + */ + isPrepaidFundSubscription: boolean; + /** + * get or set IsPricingPricingAvailable + */ + isPricingAvailable: boolean; + /** + * Gets or sets the resource group. + */ + resourceGroupName: string; + /** + * Gets or sets the azure resource name. + */ + resourceName: string; + /** + * A dictionary of service urls, mapping the service owner to the service owner url + */ + serviceUrls: { + [key: number]: string; + }; + /** + * Gets or sets the subscription identifier. + */ + subscriptionId: string; + /** + * Gets or sets the azure subscription name + */ + subscriptionName: string; + /** + * Gets or sets the subscription status. + */ + subscriptionStatus: SubscriptionStatus; +} +/** + * Information about a resource associated with a subscription. + */ +export interface ISubscriptionResource { + /** + * Quantity commited by the user, when resources is commitment based. + */ + committedQuantity: number; + /** + * A enumeration value indicating why the resource was disabled. + */ + disabledReason: ResourceStatusReason; + /** + * Uri pointing to user action on a disabled resource. It is based on value. + */ + disabledResourceActionLink: string; + /** + * Quantity included for free. + */ + includedQuantity: number; + /** + * Returns true if paid billing is enabled on the resource. Returns false for non-azure subscriptions, disabled azure subscriptions or explicitly disabled by user + */ + isPaidBillingEnabled: boolean; + /** + * Returns true if resource is can be used otherwise returns false. can be used to identify why resource is disabled. + */ + isUseable: boolean; + /** + * Returns an integer representing the maximum quantity that can be billed for this resource. Any usage submitted over this number is automatically excluded from being sent to azure. + */ + maximumQuantity: number; + /** + * Gets the name of this resource. + */ + name: ResourceName; + /** + * Returns a Date of UTC kind indicating when the next reset of quantities is going to happen. On this day at UTC 2:00 AM is when the reset will occur. + */ + resetDate: Date; +} +/** + * Represents the aggregated usage of a resource over a time span + */ +export interface IUsageEventAggregate { + /** + * Gets or sets end time of the aggregated value, exclusive + */ + endTime: Date; + /** + * Gets or sets resource that the aggregated value represents + */ + resource: ResourceName; + /** + * Gets or sets start time of the aggregated value, inclusive + */ + startTime: Date; + /** + * Gets or sets quantity of the resource used from start time to end time + */ + value: number; +} +export enum MeterBillingState { + Free = 0, + Paid = 1, + Trial = 2, + PaidWithTrial = 3, +} +export enum MeterCategory { + Legacy = 0, + Bundle = 1, + Extension = 2, +} +export enum MeterGroupType { + License = 0, + Build = 1, + LoadTest = 2, +} +export enum MeterRenewalFrequecy { + None = 0, + Monthly = 1, + Annually = 2, +} +export enum MeterState { + Registered = 0, + Active = 1, + Retired = 2, + Deleted = 3, +} +export interface OfferMeter { + /** + * Gets or sets the value of absolute maximum quantity for the resource + */ + absoluteMaximumQuantity: number; + /** + * Gets or sets the billing mode of the resource + */ + billingMode: ResourceBillingMode; + /** + * Gets or sets the state of the billing. + */ + billingState: MeterBillingState; + /** + * Category. + */ + category: MeterCategory; + /** + * Quantity commited by the user, when resources is commitment based. + */ + committedQuantity: number; + /** + * Quantity used by the user, when resources is pay as you go or commitment based. + */ + currentQuantity: number; + /** + * Gets or sets Gallery Id. + */ + galleryId: string; + /** + * Quantity included for free. + */ + includedQuantity: number; + /** + * Gets or sets the value of maximum quantity for the resource + */ + maximumQuantity: number; + /** + * Meter Id. + */ + meterId: number; + /** + * Name of the resource + */ + name: string; + /** + * Gets or sets the offer scope. + */ + offerScope: OfferScope; + /** + * Gets or sets the identifier representing this meter in commerce platform + */ + platformMeterId: string; + /** + * Gets or sets the Renewak Frequency. + */ + renewalFrequency: MeterRenewalFrequecy; + /** + * Gets or sets the status. + */ + status: MeterState; + /** + * Gets or sets the trial cycles. + */ + trialCycles: number; + /** + * Measuring unit for this meter. + */ + unit: string; +} +export enum OfferScope { + Account = 0, + User = 1, + UserAccount = 2, +} +/** + * Information about a resource associated with a subscription. + */ +export interface OfferSubscription { + /** + * The azure subscription id + */ + azureSubscriptionId: string; + /** + * The azure subscription name + */ + azureSubscriptionName: string; + /** + * The azure subscription state + */ + azureSubscriptionState: SubscriptionStatus; + /** + * Quantity commited by the user, when resources is commitment based. + */ + committedQuantity: number; + /** + * A enumeration value indicating why the resource was disabled. + */ + disabledReason: ResourceStatusReason; + /** + * Uri pointing to user action on a disabled resource. It is based on value. + */ + disabledResourceActionLink: string; + /** + * Quantity included for free. + */ + includedQuantity: number; + /** + * Returns true if paid billing is enabled on the resource. Returns false for non-azure subscriptions, disabled azure subscriptions or explicitly disabled by user + */ + isPaidBillingEnabled: boolean; + /** + * Returns true if resource is can be used otherwise returns false. can be used to identify why resource is disabled. + */ + isUseable: boolean; + /** + * Returns an integer representing the maximum quantity that can be billed for this resource. Any usage submitted over this number is automatically excluded from being sent to azure. + */ + maximumQuantity: number; + /** + * Gets or sets the name of this resource. + */ + offerMeter: OfferMeter; + /** + * The unique identifier of this offer subscription + */ + offerSubscriptionId: string; + /** + * Gets the renewal group. + */ + renewalGroup: ResourceRenewalGroup; + /** + * Returns a Date of UTC kind indicating when the next reset of quantities is going to happen. On this day at UTC 2:00 AM is when the reset will occur. + */ + resetDate: Date; +} +/** + * The Purchasable offer meter. + */ +export interface PurchasableOfferMeter { + /** + * Gets or sets the estimated renewal date. + */ + estimatedRenewalDate: Date; + /** + * Gets or sets the meter pricing (GraduatedPrice) + */ + meterPricing: { + key: number; + value: number; + }[]; + /** + * Gets or sets the offer meter definition. + */ + offerMeterDefinition: OfferMeter; +} +export enum ResourceBillingMode { + Committment = 0, + PayAsYouGo = 1, +} +export enum ResourceName { + StandardLicense = 0, + AdvancedLicense = 1, + ProfessionalLicense = 2, + Build = 3, + LoadTest = 4, + PremiumBuildAgent = 5, + PrivateOtherBuildAgent = 6, + PrivateAzureBuildAgent = 7, +} +export enum ResourceRenewalGroup { + Monthly = 0, + Jan = 1, + Feb = 2, + Mar = 3, + Apr = 4, + May = 5, + Jun = 6, + Jul = 7, + Aug = 8, + Sep = 9, + Oct = 10, + Nov = 11, + Dec = 12, +} +export enum ResourceStatusReason { + None = 0, + NoAzureSubscription = 1, + NoIncludedQuantityLeft = 2, + SubscriptionDisabled = 4, + PaidBillingDisabled = 8, + MaximumQuantityReached = 16, +} +/** + * Information about a resource associated with a subscription. + */ +export interface SubscriptionResource { + /** + * Quantity commited by the user, when resources is commitment based. + */ + committedQuantity: number; + /** + * A enumeration value indicating why the resource was disabled. + */ + disabledReason: ResourceStatusReason; + /** + * Uri pointing to user action on a disabled resource. It is based on value. + */ + disabledResourceActionLink: string; + /** + * Quantity included for free. + */ + includedQuantity: number; + /** + * Returns true if paid billing is enabled on the resource. Returns false for non-azure subscriptions, disabled azure subscriptions or explicitly disabled by user + */ + isPaidBillingEnabled: boolean; + /** + * Returns true if resource is can be used otherwise returns false. can be used to identify why resource is disabled. + */ + isUseable: boolean; + /** + * Returns an integer representing the maximum quantity that can be billed for this resource. Any usage submitted over this number is automatically excluded from being sent to azure. + */ + maximumQuantity: number; + /** + * Gets or sets the name of this resource. + */ + name: ResourceName; + /** + * Returns a Date of UTC kind indicating when the next reset of quantities is going to happen. On this day at UTC 2:00 AM is when the reset will occur. + */ + resetDate: Date; +} +export enum SubscriptionSource { + Normal = 0, + EnterpriseAgreement = 1, + Internal = 2, + Unknown = 3, + FreeTier = 4, +} +export enum SubscriptionStatus { + Unknown = 0, + Active = 1, + Disabled = 2, + Deleted = 3, + Unregistered = 4, +} +/** + * Class that represents common set of properties for a raw usage event reported by TFS services. + */ +export interface UsageEvent { + /** + * Gets or sets account id of the event. Note: This is for backward compat with BI. + */ + accountId: string; + /** + * Account name associated with the usage event + */ + accountName: string; + /** + * User GUID associated with the usage event + */ + associatedUser: string; + /** + * Timestamp when this billing event is billable + */ + billableDate: Date; + /** + * Unique event identifier + */ + eventId: string; + /** + * Recieving Timestamp of the billing event by metering service + */ + eventTimestamp: Date; + /** + * Meter Id. + */ + meterName: string; + /** + * Partition id of the account + */ + partitionId: number; + /** + * Quantity of the usage event + */ + quantity: number; + /** + * Gets or sets the billing mode for the resource involved in the usage + */ + resourceBillingMode: ResourceBillingMode; + /** + * Service context GUID associated with the usage event + */ + serviceIdentity: string; + /** + * Gets or sets subscription anniversary day of the subscription + */ + subscriptionAnniversaryDay: number; + /** + * Gets or sets subscription guid of the associated account of the event + */ + subscriptionId: string; +} +export var TypeInfo: { + AccountProviderNamespace: { + enumValues: { + "visualStudioOnline": number; + "appInsights": number; + "marketplace": number; + }; + }; + AzureRegion: { + fields: any; + }; + IOfferSubscription: { + fields: any; + }; + ISubscriptionAccount: { + fields: any; + }; + ISubscriptionResource: { + fields: any; + }; + IUsageEventAggregate: { + fields: any; + }; + MeterBillingState: { + enumValues: { + "free": number; + "paid": number; + "trial": number; + "paidWithTrial": number; + }; + }; + MeterCategory: { + enumValues: { + "legacy": number; + "bundle": number; + "extension": number; + }; + }; + MeterGroupType: { + enumValues: { + "license": number; + "build": number; + "loadTest": number; + }; + }; + MeterRenewalFrequecy: { + enumValues: { + "none": number; + "monthly": number; + "annually": number; + }; + }; + MeterState: { + enumValues: { + "registered": number; + "active": number; + "retired": number; + "deleted": number; + }; + }; + OfferMeter: { + fields: any; + }; + OfferScope: { + enumValues: { + "account": number; + "user": number; + "userAccount": number; + }; + }; + OfferSubscription: { + fields: any; + }; + PurchasableOfferMeter: { + fields: any; + }; + ResourceBillingMode: { + enumValues: { + "committment": number; + "payAsYouGo": number; + }; + }; + ResourceName: { + enumValues: { + "standardLicense": number; + "advancedLicense": number; + "professionalLicense": number; + "build": number; + "loadTest": number; + "premiumBuildAgent": number; + "privateOtherBuildAgent": number; + "privateAzureBuildAgent": number; + }; + }; + ResourceRenewalGroup: { + enumValues: { + "monthly": number; + "jan": number; + "feb": number; + "mar": number; + "apr": number; + "may": number; + "jun": number; + "jul": number; + "aug": number; + "sep": number; + "oct": number; + "nov": number; + "dec": number; + }; + }; + ResourceStatusReason: { + enumValues: { + "none": number; + "noAzureSubscription": number; + "noIncludedQuantityLeft": number; + "subscriptionDisabled": number; + "paidBillingDisabled": number; + "maximumQuantityReached": number; + }; + }; + SubscriptionResource: { + fields: any; + }; + SubscriptionSource: { + enumValues: { + "normal": number; + "enterpriseAgreement": number; + "internal": number; + "unknown": number; + "freeTier": number; + }; + }; + SubscriptionStatus: { + enumValues: { + "unknown": number; + "active": number; + "disabled": number; + "deleted": number; + "unregistered": number; + }; + }; + UsageEvent: { + fields: any; + }; +}; +} +declare module "VSS/Commerce/RestClient" { +import Contracts = require("VSS/Commerce/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class CommerceHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getResourceStatus(nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {Contracts.ResourceName} resourceName - Name of the resource + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getResourceStatusByResourceName(resourceName: Contracts.ResourceName, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Sets the maximum and included quantities for a resource + * + * @param {Contracts.SubscriptionResource} meter + * @return IPromise + */ + updateMeter(meter: Contracts.SubscriptionResource): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} resourceName + * @param {string} resourceNameResolveMethod + * @return IPromise + */ + getOfferMeter(resourceName: string, resourceNameResolveMethod: string): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} resourceName + * @param {string} resourceNameResolveMethod + * @param {string} subscriptionId + * @param {boolean} includeMeterPricing + * @return IPromise + */ + getPurchasableOfferMeter(resourceName: string, resourceNameResolveMethod: string, subscriptionId: string, includeMeterPricing: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.OfferSubscription} offerSubscription + * @return IPromise + */ + createOfferSubscription(offerSubscription: Contracts.OfferSubscription): IPromise; + /** + * [Preview API] Get all offer subscriptions for user for valid azure subscriptions. This may be span across multiple accounts + * + * @param {boolean} validateAzuresubscription + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getAllOfferSubscriptionsForUser(validateAzuresubscription: boolean, nextBillingPeriod: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} galleryId - Name of the resource + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscription(galleryId: string, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscriptions(nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Get all offer subscriptions for user for valid azure subscriptions. This may be span across multiple accounts + * + * @param {string} galleryItemId + * @param {string} azureSubscriptionId + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscriptionsForGalleryItem(galleryItemId: string, azureSubscriptionId: string, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Sets the maximum and included quantities for a resource + * + * @param {Contracts.OfferSubscription} offerSubscription + * @return IPromise + */ + updateOfferSubscription(offerSubscription: Contracts.OfferSubscription): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getAccountRegions(): IPromise; + /** + * [Preview API] Gets the accounts by subscription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @return IPromise + */ + getAccounts(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace): IPromise; + /** + * [Preview API] Gets the accounts owned by identity. + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} memberId - The owner identifier. + * @param {boolean} queryOnlyOwnerAccounts - if set to true [query only owner accounts]. + * @param {boolean} inlcudeDisabledAccounts - if set to true [inlcude disabled accounts]. + * @param {boolean} includeMSAAccounts + * @param {string[]} serviceOwners + * @return IPromise + */ + getAccountsByIdentity(providerNamespaceId: Contracts.AccountProviderNamespace, memberId: string, queryOnlyOwnerAccounts: boolean, inlcudeDisabledAccounts: boolean, includeMSAAccounts: boolean, serviceOwners: string[]): IPromise; + /** + * [Preview API] Get accounts and associated subscriptions by identity and offer id + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - account provider namespace id + * @param {string} memberId - owner identifier + * @param {boolean} queryOnlyOwnerAccounts - if set to true [query only owner accounts]. + * @param {boolean} inlcudeDisabledAccounts - if set to true [inlcude disabled accounts]. + * @param {boolean} includeMSAAccounts - if set to true [inlcude MSA accounts]. + * @param {string[]} serviceOwners + * @param {string} galleryId - gallery id of resource + * @param {boolean} addUnlinkedSubscription - if set to true [inlcude azure subscriptions own by user]. + * @return IPromise + */ + getAccountsByIdentityForOfferId(providerNamespaceId: Contracts.AccountProviderNamespace, memberId: string, queryOnlyOwnerAccounts: boolean, inlcudeDisabledAccounts: boolean, includeMSAAccounts: boolean, serviceOwners: string[], galleryId: string, addUnlinkedSubscription?: boolean): IPromise; + /** + * [Preview API] Retrieves the subscription id associated to an account or null if no subscription is associated. + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId + * @param {string} accountId + * @return IPromise + */ + getSubscriptionAccount(providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string): IPromise; + /** + * [Preview API] Links the account to a subscription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} accountId - The account identifier. + * @param {string} ownerId - The account owner identifier. + * @return IPromise + */ + linkAccount(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string, ownerId: string): IPromise; + /** + * [Preview API] Unlinks an account from the subsription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} accountId - The account identifier. + * @param {string} ownerId - The account owner identifier. + * @return IPromise + */ + unlinkAccount(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string, ownerId: string): IPromise; + /** + * [Preview API] Returns the aggregate resource usage over the specified time range WARNING: The return value of this method is significantly different than the post method on this controller. This is an aggregation of usage events over time rather than individual usage event(s). + * + * @param {Date} startTime - Start of the the time range to retrieve, inclusive + * @param {Date} endTime - End of the time range to retrieve, exclusive + * @param {any} timeSpan - Interval of the time to retrieve, should be in a multiple of hour or day + * @return IPromise + */ + getUsage(startTime: Date, endTime: Date, timeSpan: any): IPromise; + /** + * [Preview API] Saves usage entry of a resource. + * + * @param {Contracts.UsageEvent} usageEvent - Detailed usage event + * @return IPromise + */ + reportUsage(usageEvent: Contracts.UsageEvent): IPromise; +} +export class CommerceHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getResourceStatus(nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {Contracts.ResourceName} resourceName - Name of the resource + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getResourceStatusByResourceName(resourceName: Contracts.ResourceName, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Sets the maximum and included quantities for a resource + * + * @param {Contracts.SubscriptionResource} meter + * @return IPromise + */ + updateMeter(meter: Contracts.SubscriptionResource): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} resourceName + * @param {string} resourceNameResolveMethod + * @return IPromise + */ + getOfferMeter(resourceName: string, resourceNameResolveMethod: string): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} resourceName + * @param {string} resourceNameResolveMethod + * @param {string} subscriptionId + * @param {boolean} includeMeterPricing + * @return IPromise + */ + getPurchasableOfferMeter(resourceName: string, resourceNameResolveMethod: string, subscriptionId: string, includeMeterPricing: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.OfferSubscription} offerSubscription + * @return IPromise + */ + createOfferSubscription(offerSubscription: Contracts.OfferSubscription): IPromise; + /** + * [Preview API] Get all offer subscriptions for user for valid azure subscriptions. This may be span across multiple accounts + * + * @param {boolean} validateAzuresubscription + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getAllOfferSubscriptionsForUser(validateAzuresubscription: boolean, nextBillingPeriod: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} galleryId - Name of the resource + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscription(galleryId: string, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscriptions(nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Get all offer subscriptions for user for valid azure subscriptions. This may be span across multiple accounts + * + * @param {string} galleryItemId + * @param {string} azureSubscriptionId + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscriptionsForGalleryItem(galleryItemId: string, azureSubscriptionId: string, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Sets the maximum and included quantities for a resource + * + * @param {Contracts.OfferSubscription} offerSubscription + * @return IPromise + */ + updateOfferSubscription(offerSubscription: Contracts.OfferSubscription): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getAccountRegions(): IPromise; + /** + * [Preview API] Gets the accounts by subscription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @return IPromise + */ + getAccounts(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace): IPromise; + /** + * [Preview API] Gets the accounts owned by identity. + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} memberId - The owner identifier. + * @param {boolean} queryOnlyOwnerAccounts - if set to true [query only owner accounts]. + * @param {boolean} inlcudeDisabledAccounts - if set to true [inlcude disabled accounts]. + * @param {boolean} includeMSAAccounts + * @param {string[]} serviceOwners + * @return IPromise + */ + getAccountsByIdentity(providerNamespaceId: Contracts.AccountProviderNamespace, memberId: string, queryOnlyOwnerAccounts: boolean, inlcudeDisabledAccounts: boolean, includeMSAAccounts: boolean, serviceOwners: string[]): IPromise; + /** + * [Preview API] Get accounts and associated subscriptions by identity and offer id + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - account provider namespace id + * @param {string} memberId - owner identifier + * @param {boolean} queryOnlyOwnerAccounts - if set to true [query only owner accounts]. + * @param {boolean} inlcudeDisabledAccounts - if set to true [inlcude disabled accounts]. + * @param {boolean} includeMSAAccounts - if set to true [inlcude MSA accounts]. + * @param {string[]} serviceOwners + * @param {string} galleryId - gallery id of resource + * @param {boolean} addUnlinkedSubscription - if set to true [inlcude azure subscriptions own by user]. + * @return IPromise + */ + getAccountsByIdentityForOfferId(providerNamespaceId: Contracts.AccountProviderNamespace, memberId: string, queryOnlyOwnerAccounts: boolean, inlcudeDisabledAccounts: boolean, includeMSAAccounts: boolean, serviceOwners: string[], galleryId: string, addUnlinkedSubscription?: boolean): IPromise; + /** + * [Preview API] Retrieves the subscription id associated to an account or null if no subscription is associated. + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId + * @param {string} accountId + * @return IPromise + */ + getSubscriptionAccount(providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string): IPromise; + /** + * [Preview API] Links the account to a subscription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} accountId - The account identifier. + * @param {string} ownerId - The account owner identifier. + * @return IPromise + */ + linkAccount(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string, ownerId: string): IPromise; + /** + * [Preview API] Unlinks an account from the subsription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} accountId - The account identifier. + * @param {string} ownerId - The account owner identifier. + * @return IPromise + */ + unlinkAccount(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string, ownerId: string): IPromise; + /** + * [Preview API] Returns the aggregate resource usage over the specified time range WARNING: The return value of this method is significantly different than the post method on this controller. This is an aggregation of usage events over time rather than individual usage event(s). + * + * @param {Date} startTime - Start of the the time range to retrieve, inclusive + * @param {Date} endTime - End of the time range to retrieve, exclusive + * @param {any} timeSpan - Interval of the time to retrieve, should be in a multiple of hour or day + * @return IPromise + */ + getUsage(startTime: Date, endTime: Date, timeSpan: any): IPromise; + /** + * [Preview API] Saves usage entry of a resource. + * + * @param {Contracts.UsageEvent} usageEvent - Detailed usage event + * @return IPromise + */ + reportUsage(usageEvent: Contracts.UsageEvent): IPromise; +} +export class CommerceHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getResourceStatus(nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {Contracts.ResourceName} resourceName - Name of the resource + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getResourceStatusByResourceName(resourceName: Contracts.ResourceName, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Sets the maximum and included quantities for a resource + * + * @param {Contracts.SubscriptionResource} meter + * @return IPromise + */ + updateMeter(meter: Contracts.SubscriptionResource): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} resourceName + * @param {string} resourceNameResolveMethod + * @return IPromise + */ + getOfferMeter(resourceName: string, resourceNameResolveMethod: string): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} resourceName + * @param {string} resourceNameResolveMethod + * @param {string} subscriptionId + * @param {boolean} includeMeterPricing + * @return IPromise + */ + getPurchasableOfferMeter(resourceName: string, resourceNameResolveMethod: string, subscriptionId: string, includeMeterPricing: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.OfferSubscription} offerSubscription + * @return IPromise + */ + createOfferSubscription(offerSubscription: Contracts.OfferSubscription): IPromise; + /** + * [Preview API] Get all offer subscriptions for user for valid azure subscriptions. This may be span across multiple accounts + * + * @param {boolean} validateAzuresubscription + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getAllOfferSubscriptionsForUser(validateAzuresubscription: boolean, nextBillingPeriod: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {string} galleryId - Name of the resource + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscription(galleryId: string, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Returns resource information like status, committed quantity, included quantity, reset date, etc. + * + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscriptions(nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Get all offer subscriptions for user for valid azure subscriptions. This may be span across multiple accounts + * + * @param {string} galleryItemId + * @param {string} azureSubscriptionId + * @param {boolean} nextBillingPeriod - True to return next billing cycle committed quantity + * @return IPromise + */ + getOfferSubscriptionsForGalleryItem(galleryItemId: string, azureSubscriptionId: string, nextBillingPeriod?: boolean): IPromise; + /** + * [Preview API] Sets the maximum and included quantities for a resource + * + * @param {Contracts.OfferSubscription} offerSubscription + * @return IPromise + */ + updateOfferSubscription(offerSubscription: Contracts.OfferSubscription): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getAccountRegions(): IPromise; + /** + * [Preview API] Gets the accounts by subscription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @return IPromise + */ + getAccounts(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace): IPromise; + /** + * [Preview API] Gets the accounts owned by identity. + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} memberId - The owner identifier. + * @param {boolean} queryOnlyOwnerAccounts - if set to true [query only owner accounts]. + * @param {boolean} inlcudeDisabledAccounts - if set to true [inlcude disabled accounts]. + * @param {boolean} includeMSAAccounts + * @param {string[]} serviceOwners + * @return IPromise + */ + getAccountsByIdentity(providerNamespaceId: Contracts.AccountProviderNamespace, memberId: string, queryOnlyOwnerAccounts: boolean, inlcudeDisabledAccounts: boolean, includeMSAAccounts: boolean, serviceOwners: string[]): IPromise; + /** + * [Preview API] Get accounts and associated subscriptions by identity and offer id + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - account provider namespace id + * @param {string} memberId - owner identifier + * @param {boolean} queryOnlyOwnerAccounts - if set to true [query only owner accounts]. + * @param {boolean} inlcudeDisabledAccounts - if set to true [inlcude disabled accounts]. + * @param {boolean} includeMSAAccounts - if set to true [inlcude MSA accounts]. + * @param {string[]} serviceOwners + * @param {string} galleryId - gallery id of resource + * @param {boolean} addUnlinkedSubscription - if set to true [inlcude azure subscriptions own by user]. + * @return IPromise + */ + getAccountsByIdentityForOfferId(providerNamespaceId: Contracts.AccountProviderNamespace, memberId: string, queryOnlyOwnerAccounts: boolean, inlcudeDisabledAccounts: boolean, includeMSAAccounts: boolean, serviceOwners: string[], galleryId: string, addUnlinkedSubscription?: boolean): IPromise; + /** + * [Preview API] Retrieves the subscription id associated to an account or null if no subscription is associated. + * + * @param {Contracts.AccountProviderNamespace} providerNamespaceId + * @param {string} accountId + * @return IPromise + */ + getSubscriptionAccount(providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string): IPromise; + /** + * [Preview API] Links the account to a subscription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} accountId - The account identifier. + * @param {string} ownerId - The account owner identifier. + * @return IPromise + */ + linkAccount(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string, ownerId: string): IPromise; + /** + * [Preview API] Unlinks an account from the subsription. + * + * @param {string} subscriptionId - The subscription identifier. + * @param {Contracts.AccountProviderNamespace} providerNamespaceId - The provider namespace identifier. + * @param {string} accountId - The account identifier. + * @param {string} ownerId - The account owner identifier. + * @return IPromise + */ + unlinkAccount(subscriptionId: string, providerNamespaceId: Contracts.AccountProviderNamespace, accountId: string, ownerId: string): IPromise; + /** + * [Preview API] Returns the aggregate resource usage over the specified time range WARNING: The return value of this method is significantly different than the post method on this controller. This is an aggregation of usage events over time rather than individual usage event(s). + * + * @param {Date} startTime - Start of the the time range to retrieve, inclusive + * @param {Date} endTime - End of the time range to retrieve, exclusive + * @param {any} timeSpan - Interval of the time to retrieve, should be in a multiple of hour or day + * @return IPromise + */ + getUsage(startTime: Date, endTime: Date, timeSpan: any): IPromise; + /** + * [Preview API] Saves usage entry of a resource. + * + * @param {Contracts.UsageEvent} usageEvent - Detailed usage event + * @return IPromise + */ + reportUsage(usageEvent: Contracts.UsageEvent): IPromise; +} +export class CommerceHttpClient extends CommerceHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return CommerceHttpClient2_1 + */ +export function getClient(): CommerceHttpClient2_1; +} +declare module "VSS/Common/Constants/Platform" { +/** +* Constants related to the ActiveExtensionDataProvider +*/ +export module ActiveExtensionDataConstants { + /** + * Data provider key for the active extension data provider + */ + var ActiveExtensionsKey: string; +} +export module ContributedServiceContextData { + /** + * The data provider key for contributed service contexts + */ + var ContributedServiceContextDataKey: string; +} +export module DataProviderConstants { + /** + * The full contribution type id for data providers + */ + var DataProviderContributionTypeId: string; + /** + * The contribution property name for the registered name of the data provider + */ + var ContributionNameProperty: string; + /** + * The contribution property name for the service instance type id + */ + var ContributionInstanceTypeProperty: string; +} +/** +* Constants used to report customer intelligence area data +*/ +export module WebAccessCustomerIntelligenceConstants { + var Area: string; + var WebSettingsStoreSettingFeature: string; + var FullScreenModeFeature: string; + var InvalidLicenseExceptionFeature: string; +} +/** +* Constants used for VSSF\WebPlatform Feature Availability flags Note: This should only be flags consumed in platform-level typescript code or controllers. +*/ +export module WebPlatformFeatureFlags { + var VisualStudioServicesContribution: string; + var VisualStudioServicesContributionFramework: string; + var ClientSideErrorLogging: string; +} +} +declare module "VSS/Common/Contracts/FormInput" { +export enum InputDataType { + /** + * No data type is specified. + */ + None = 0, + /** + * Represents a textual value. + */ + String = 10, + /** + * Represents a numberic value. + */ + Number = 20, + /** + * Represents a value of true or false. + */ + Boolean = 30, + /** + * Represents a Guid. + */ + Guid = 40, + /** + * Represents a URI. + */ + Uri = 50, +} +/** + * Describes an input for subscriptions. + */ +export interface InputDescriptor { + /** + * The ids of all inputs that the value of this input is dependent on. + */ + dependencyInputIds: string[]; + /** + * Description of what this input is used for + */ + description: string; + /** + * The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group. + */ + groupName: string; + /** + * If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change. + */ + hasDynamicValueInformation: boolean; + /** + * Identifier for the subscription input + */ + id: string; + /** + * Mode in which the value of this input should be entered + */ + inputMode: InputMode; + /** + * Gets whether this input is confidential, such as for a password or application key + */ + isConfidential: boolean; + /** + * Localized name which can be shown as a label for the subscription input + */ + name: string; + /** + * Gets whether this input is included in the default generated action description. + */ + useInDefaultDescription: boolean; + /** + * Information to use to validate this input's value + */ + validation: InputValidation; + /** + * A hint for input value. It can be used in the UI as the input placeholder. + */ + valueHint: string; + /** + * Information about possible values for this input + */ + values: InputValues; +} +/** + * Defines a filter for subscription inputs. The filter matches a set of inputs if any (one or more) of the groups evaluates to true. + */ +export interface InputFilter { + /** + * Groups of input filter expressions. This filter matches a set of inputs if any (one or more) of the groups evaluates to true. + */ + conditions: InputFilterCondition[]; +} +/** + * An expression which can be applied to filter a list of subscription inputs + */ +export interface InputFilterCondition { + /** + * Whether or not to do a case sensitive match + */ + caseSensitive: boolean; + /** + * The Id of the input to filter on + */ + inputId: string; + /** + * The "expected" input value to compare with the actual input value + */ + inputValue: string; + /** + * The operator applied between the expected and actual input value + */ + operator: InputFilterOperator; +} +export enum InputFilterOperator { + Equals = 0, + NotEquals = 1, +} +export enum InputMode { + /** + * This input should not be shown in the UI + */ + None = 0, + /** + * An input text box should be shown + */ + TextBox = 10, + /** + * An password input box should be shown + */ + PasswordBox = 20, + /** + * A select/combo control should be shown + */ + Combo = 30, + /** + * Radio buttons should be shown + */ + RadioButtons = 40, + /** + * Checkbox should be shown(for true/false values) + */ + CheckBox = 50, + /** + * A multi-line text area should be shown + */ + TextArea = 60, +} +/** + * Describes what values are valid for a subscription input + */ +export interface InputValidation { + dataType: InputDataType; + isRequired: boolean; + maxLength: number; + maxValue: number; + minLength: number; + minValue: number; + pattern: string; + patternMismatchErrorMessage: string; +} +/** + * Information about a single value for an input + */ +export interface InputValue { + /** + * Any other data about this input + */ + data: { + [key: string]: any; + }; + /** + * The text to show for the display of this value + */ + displayValue: string; + /** + * The value to store for this input + */ + value: string; +} +/** + * Information about the possible/allowed values for a given subscription input + */ +export interface InputValues { + /** + * The default value to use for this input + */ + defaultValue: string; + /** + * Errors encountered while computing dynamic values. + */ + error: InputValuesError; + /** + * The id of the input + */ + inputId: string; + /** + * Should this input be disabled + */ + isDisabled: boolean; + /** + * Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) + */ + isLimitedToPossibleValues: boolean; + /** + * Should this input be made read-only + */ + isReadOnly: boolean; + /** + * Possible values that this input can take + */ + possibleValues: InputValue[]; +} +/** + * Error information related to a subscription input value. + */ +export interface InputValuesError { + /** + * The error message. + */ + message: string; +} +export interface InputValuesQuery { + currentValues: { + [key: string]: string; + }; + /** + * The input values to return on input, and the result from the consumer on output. + */ + inputValues: InputValues[]; + /** + * Subscription containing information about the publisher/consumer and the current input values + */ + resource: any; +} +export var TypeInfo: { + InputDataType: { + enumValues: { + "none": number; + "string": number; + "number": number; + "boolean": number; + "guid": number; + "uri": number; + }; + }; + InputDescriptor: { + fields: any; + }; + InputFilter: { + fields: any; + }; + InputFilterCondition: { + fields: any; + }; + InputFilterOperator: { + enumValues: { + "equals": number; + "notEquals": number; + }; + }; + InputMode: { + enumValues: { + "none": number; + "textBox": number; + "passwordBox": number; + "combo": number; + "radioButtons": number; + "checkBox": number; + "textArea": number; + }; + }; + InputValidation: { + fields: any; + }; + InputValue: { + fields: any; + }; + InputValues: { + fields: any; + }; + InputValuesError: { + fields: any; + }; + InputValuesQuery: { + fields: any; + }; +}; +} +declare module "VSS/Common/Contracts/Platform" { +/** +* Model to represent a public access uri +*/ +export interface AccessPointModel { + /** + * Host name and port number of the url + */ + authority: string; + /** + * Url scheme (http, https, ...) + */ + scheme: string; + /** + * Full url + */ + uri: string; +} +/** +* Data related to Active Extensions +*/ +export interface ActiveExtensionsData { + /** + * Dictionary mapping extension ids to their active status + */ + extensions: { + [key: string]: boolean; + }; +} +/** +* Model used to configure how TFS reports usage data to Application Insights +*/ +export interface AppInsightsConfiguration { + /** + * If true, automatically call "trackPage" when the page is loaded + */ + autoTrackPage: boolean; + /** + * Optional data used to override the default values sent to trackPage + */ + customTrackPageData: AppInsightsCustomTrackPageData; + /** + * Set to false if app insights reporting is not enabled/configured + */ + enabled: boolean; + /** + * The url from which to retrieve app insights scripts + */ + insightsScriptUrl: string; + /** + * The instrumentation key used to track this deployment's usage + */ + instrumentationKey: string; + /** + * If true, include collection, project, and team info in the track-page urls + */ + trackProjectInfo: boolean; +} +/** +* Model that can be used to customize the values sent to AppInsights via "trackPage" +*/ +export interface AppInsightsCustomTrackPageData { + alias: string; + metrics: { + [key: string]: number; + }; + pageName: string; + properties: { + [key: string]: string; + }; +} +/** +* Web Access configuration data. This information is used to process requests on the server. This data is also placed in a json island on each page in order for JavaScript to know key configuration data required to things like construct proper urls +*/ +export interface ConfigurationContext { + /** + * MVC api configuration + */ + api: ConfigurationContextApis; + /** + * Optional name of the client (e.g. TEE) hosting the page + */ + clientHost: string; + isHosted: boolean; + /** + * Current mail settings for TFS + */ + mailSettings: TfsMailSettings; + /** + * Server resource paths + */ + paths: ConfigurationContextPaths; +} +/** +* MVC api configuration +*/ +export interface ConfigurationContextApis { + /** + * Specifies the path prefix for the area + */ + areaPrefix: string; + /** + * Specifies the path prefix for the controller + */ + controllerPrefix: string; + /** + * Api-version for legacy rpc-style web access api controllers See WebApiVersionClient for the version coming from the client/browser. The return value is a positive whole number >= 1. + */ + webApiVersion: string; +} +/** +* Paths to server resources +*/ +export interface ConfigurationContextPaths { + /** + * Relative path to the _content path of the web application + */ + resourcesPath: string; + /** + * Relative path to the root of the web application + */ + rootPath: string; + /** + * Relative path to unversioned 3rd party static content + */ + staticRoot3rdParty: string; + /** + * Relative path to versioned static content + */ + staticRootTfs: string; +} +export enum ContextHostType { + Unknown = 0, + /** + * The Deployment Host + */ + Deployment = 1, + /** + * The Application Host + */ + Application = 2, + /** + * The Project Collection + */ + ProjectCollection = 4, +} +export interface ContextIdentifier { + id: string; + name: string; +} +/** +* Page context configuration that can be contributed by remote services (different VSO services delivering content to the page) +*/ +export interface ContributedServiceContext { + /** + * Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list. + */ + cssModulePrefixes: string[]; + /** + * Feature flag states to include by default in page data (avoids AJAX lookup) + */ + featureAvailability: FeatureAvailabilityContext; + /** + * Module loader configuration which may be merged-in with the parent host (if injected into the DOM) Because the config may be merged with the host config, each root area path must be explicitly defined here rather than relying on basePath as a catch-all. + */ + moduleLoaderConfig: ModuleLoaderConfiguration; + /** + * Paths to resources on this service + */ + paths: ConfigurationContextPaths; + /** + * Lookup of urls for different services (at different host levels) + */ + serviceLocations: ServiceLocations; + /** + * The root url of the service that can be used to resolve relative links when this content is hosted in another site. + */ + serviceRootUrl: string; + /** + * Instance id of the service + */ + serviceTypeId: string; +} +/** +* Model for a contribution context object which is used for contributed content provided by this service (e.g. Hubs). The content may be included in the parent DOM or iframed. This context provides information about how to popluate the content. +*/ +export interface ContributionContext { + /** + * CSS class for the container element which will host this content. Typical usage is to just supply a unique CSS class on the element, register an enhancement for that class in a TypeScript module, and reference that TypeScript module in this ContributionContent object. + */ + containerCssClass: string; + /** + * Generic property bag which individual contributions can use to pass data to the client + */ + contributionData: any; + /** + * Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list. + */ + cssModulePrefixes: string[]; + /** + * List of CSS scripts to include as links with the content. Relative paths are resolved to Themed CSS urls. + */ + cssReferences: string[]; + /** + * The root url for CSS files for the given theme + */ + cssThemedRoot: string; + /** + * Module loader configuration which may be merged-in with the parent host (if injected into the DOM) Because the config may be merged with the host config, each root area path must be explicitly defined here rather than relying on basePath as a catch-all. + */ + moduleLoaderConfig: ModuleLoaderConfiguration; + /** + * List of script modules to reference. e.g. "VSS/Controls/Grids". A require statement is issued for these modules + */ + scriptModules: string[]; + /** + * Lookup of urls for different services (at different host levels) + */ + serviceLocations: ServiceLocations; + /** + * The root url of the service that can be used to resolve relative links when this content is hosted in another site. + */ + serviceUrl: string; + /** + * The static root url for this service + */ + staticRootUrl: string; +} +/** +* Item representing a contribution path. Can be of type default, resource or bundle +*/ +export interface ContributionPath { + /** + * Type if this contribution path + */ + pathType: ContributionPathType; + /** + * Replace value for this contribution path + */ + value: string; +} +/** +* Type of the contribution path +*/ +export enum ContributionPathType { + Default = 0, + Resource = 1, +} +/** +* Contains lists of script and css references that need to be included on the page in order for the controls used by the page to work. +*/ +export interface CoreReferencesContext { + /** + * Core javascript files referenced on a page + */ + scripts: JavascriptFileReference[]; + /** + * Core CSS files referenced on a page + */ + stylesheets: StylesheetReference[]; +} +/** +* Result structure from calls to GetDataProviderData +*/ +export interface DataProviderResult { + /** + * Property bag of data keyed off of the data provider contribution id + */ + data: { + [key: string]: number; + }; + /** + * List of data providers resolved in the data-provider query + */ + resolvedProviders: ResolvedDataProvider[]; +} +export interface DaylightSavingsAdjustmentEntry { + /** + * Millisecond adjustment from UTC + */ + offset: number; + /** + * Date that the offset adjustment starts + */ + start: Date; +} +export interface DiagnosticsContext { + /** + * Id of the current activity + */ + activityId: string; + allowStatsCollection: boolean; + debugMode: boolean; + sessionId: string; + tracePointCollectionEnabled: boolean; + tracePointProfileEnd: string; + tracePointProfileStart: string; +} +export interface ExtendedHostContext { + authority: string; + hostType: ContextHostType; + id: string; + isAADAccount: boolean; + name: string; + relativeUri: string; + scheme: string; + uri: string; +} +export interface FeatureAvailabilityContext { + featureStates: { + [key: string]: boolean; + }; +} +export interface GlobalizationContext { + culture: string; + theme: string; + timeZoneId: string; + timezoneOffset: number; +} +export interface HostContext { + id: string; + name: string; + relativeUri: string; + uri: string; +} +/** +* Model representing a hub in VSO pages' navigation menu +*/ +export interface Hub { + groupId: string; + id: string; + isSelected: boolean; + name: string; + order: any; + uri: string; +} +/** +* Model representing a hub group in VSO pages' navigation menu +*/ +export interface HubGroup { + hasHubs: boolean; + id: string; + name: string; + order: any; + uri: string; +} +/** +* Context information containing the relevant hubs and hub groups for a given context +*/ +export interface HubsContext { + hubGroups: HubGroup[]; + hubGroupsCollectionContributionId: string; + hubs: Hub[]; + selectedHubGroupId: string; + selectedHubId: string; +} +/** +* Model to represent a TeamFoundationIdentity +*/ +export interface IdentityModel { + /** + * Custom display name + */ + customDisplayName: string; + /** + * Display name + */ + displayName: string; + /** + * Email address + */ + email: string; + /** + * Unique team foundation id + */ + id: string; + /** + * Is the identity active + */ + isActive: boolean; + /** + * Is the identity a group/team + */ + isContainer: boolean; + /** + * The provider's display name for this identity + */ + providerDisplayName: string; + /** + * Unique name for this identity + */ + uniqueName: string; +} +/** +* Reference to a javascript file to include on a page +*/ +export interface JavascriptFileReference { + /** + * Condition to check in the case that Url lives on a CDN. The fallback script will be included if this check fails. + */ + fallbackCondition: string; + /** + * Fallback url to use in case Url lives on a CDN + */ + fallbackUrl: string; + /** + * Id of the reference (JQuery, JQueryUI, MicrosoftAjax, etc.) + */ + identifier: string; + /** + * Is this a core javascript file that needs to be included on every page + */ + isCoreModule: boolean; + /** + * Url of the javascript reference + */ + url: string; +} +/** +* Class used to wrap arrays in an object. +*/ +export interface JsonArrayWrapper { + __wrappedArray: string; +} +export interface MicrosoftAjaxConfig { + cultureInfo: any; +} +/** +* AMD javascript module loader configuration +*/ +export interface ModuleLoaderConfiguration { + baseUrl: string; + contributionPaths: { + [key: string]: ContributionPath; + }; + paths: { + [key: string]: string; + }; + shim: { + [key: string]: ModuleLoaderShimConfiguration; + }; +} +/** +* AMD javascript module loader shim configuration +*/ +export interface ModuleLoaderShimConfiguration { + deps: string[]; + exports: string; +} +/** +* Structure to specify current navigation context of the executing request. The navigation context content's are generally obtained from the request URL. Some context specifiers such as "Account" can be implicit and might come from current IVssServiceHost. +*/ +export interface NavigationContext { + /** + * A token to show which area the request has been targeted to. By default there are two areas "Admin" and "Api". They can be specified in the URL as _admin and _api respectively. + */ + area: string; + /** + * Current action route value + */ + currentAction: string; + /** + * Current controller route value + */ + currentController: string; + /** + * Current parameters route value (the path after the controller and action in the url) + */ + currentParameters: string; + /** + * Flag to show top most navigation context. For example the URL http://server:port/collection/project/_controller/action sets the Project bit while the URL http://server:port/collection/project/_admin/_controller/action sets also sets the area property to Admin. + */ + topMostLevel: NavigationContextLevels; +} +/** +* Flags to show which tokens of the navigation context are present in the current request URL. The request url's context part are formed like http://server:port[/{collection}[/{project}[/{team}]]][/_admin]/_{controller}/{action} The tokens {collection}, {project} and {team} are navigation level tokens whereas _admin segment is a switch to show admin areas of the site. +*/ +export enum NavigationContextLevels { + None = 0, + /** + * Root level in Azure. + */ + Deployment = 1, + /** + * Root level in on premises. Neither of {collection}, {project} and {team} tokens have information + */ + Application = 2, + /** + * Flag to show {collection} token has information. + */ + Collection = 4, + /** + * Flag to show {project} token has information. + */ + Project = 8, + /** + * Flag to show {team} token has information. + */ + Team = 16, + /** + * Sugar for all application levels. + */ + ApplicationAll = 30, + /** + * Sugar for all levels + */ + All = 31, +} +/** +* Global context placed on each VSSF web page (through json island data) which gives enough information for core TypeScript modules/controls on the page to operate +*/ +export interface PageContext { + /** + * Configuration for reporting telemetry/usage data to App Insights + */ + appInsightsConfiguration: AppInsightsConfiguration; + /** + * Core javascript and css references + */ + coreReferences: CoreReferencesContext; + /** + * Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list. + */ + cssModulePrefixes: string[]; + /** + * Diagnostic related information for the current page + */ + diagnostics: DiagnosticsContext; + /** + * Feature flag states to include by default in page data (avoids AJAX lookup) + */ + featureAvailability: FeatureAvailabilityContext; + /** + * Globalization data for the current page based on the current user's settings + */ + globalization: GlobalizationContext; + /** + * Configuration needed for Microsoft.Ajax library + */ + microsoftAjaxConfig: MicrosoftAjaxConfig; + /** + * The (AMD) module configuration + */ + moduleLoaderConfig: ModuleLoaderConfiguration; + /** + * Current navigation context. + */ + navigation: NavigationContext; + /** + * The service instance type id for the VSO service serving this page + */ + serviceInstanceId: string; + serviceLocations: ServiceLocations; + /** + * Contains global time zone configuration information (e.g. which dates DST changes) + */ + timeZonesConfiguration: TimeZonesConfiguration; + /** + * Web Access configuration + */ + webAccessConfiguration: ConfigurationContext; + /** + * The web context information for the given page request + */ + webContext: WebContext; +} +/** +* Entry for a specific data provider's resulting data +*/ +export interface ResolvedDataProvider { + error: string; + id: string; +} +/** +* Holds a lookup of urls for different services (at different host levels) +*/ +export interface ServiceLocations { + locations: { + [key: string]: { + [key: number]: string; + }; + }; +} +/** +* Reference to a CSS file to include on a page +*/ +export interface StylesheetReference { + /** + * Url of the high-contrast version of the CSS file + */ + highContrastUrl: string; + /** + * Is this a core stylesheet that needs to be included in child frames + */ + isCoreStylesheet: boolean; + /** + * Url of the CSS file + */ + url: string; +} +export interface TeamContext { + id: string; + name: string; + userIsAdmin: boolean; + userIsMember: boolean; +} +/** +* Data contract to represent a given team foundation service host (account, collection, deployment) +*/ +export interface TeamFoundationServiceHostModel { + /** + * Type of host (deployment, account, collection) + */ + hostType: any; + /** + * Unique id of the host (collection id, account id, etc.) + */ + instanceId: string; + /** + * Name of the host (collection name, account name, etc.) + */ + name: string; + /** + * Path of the service host, relative to the root virtual directory (e.g. DefaultCollection) + */ + relVDir: string; + /** + * Path of the service host relative to the web application root (e.g. /tfs/DefaultCollection) + */ + vDir: string; +} +export interface TfsMailSettings { + enabled: boolean; + from: string; +} +/** +* Internal structure to describe IVssServiceHost +*/ +export interface TfsServiceHostDescriptor { + hostType: any; + id: string; + name: string; + relVdir: string; + vdir: string; +} +export interface TimeZonesConfiguration { + daylightSavingsAdjustments: DaylightSavingsAdjustmentEntry[]; +} +export interface UserContext { + email: string; + id: string; + limitedAccess: boolean; + name: string; + uniqueName: string; +} +/** +* Web Access configuration data. This information is used to process requests on the server. This data is also placed in a json island on each page in order for JavaScript to know key configuration data required to things like construct proper urls +*/ +export interface WebAccessConfiguration { + /** + * Optional name of the client (e.g. TEE) hosting the page + */ + clientHost: string; + /** + * Current mail settings for TFS + */ + mailSettings: TfsMailSettings; + /** + * Relative path to the _content path of the web application + */ + resourcesPath: string; + /** + * Relative path to the root of the web application + */ + rootPath: string; + /** + * Relative path to unversioned 3rd party static content + */ + staticRoot3rdParty: string; + /** + * Relative path to versioned static content + */ + staticRootTfs: string; + /** + * Api-version for legacy rpc-style web access api controllers See WebApiVersionClient for the version coming from the client/browser. The return value is a positive whole number >= 1. + */ + webApiVersion: string; +} +/** +* Context information for all web access requests +*/ +export interface WebContext { + account: HostContext; + /** + * Information about the Collection used in the current request (may be null) + */ + collection: HostContext; + /** + * Information about the current request context's host + */ + host: ExtendedHostContext; + /** + * Information about the project used in the current request (may be null) + */ + project: ContextIdentifier; + /** + * Information about the team used in the current request (may be null) + */ + team: TeamContext; + /** + * Information about the current user + */ + user: UserContext; +} +export var TypeInfo: { + AccessPointModel: { + fields: any; + }; + ActiveExtensionsData: { + fields: any; + }; + AppInsightsConfiguration: { + fields: any; + }; + AppInsightsCustomTrackPageData: { + fields: any; + }; + ConfigurationContext: { + fields: any; + }; + ConfigurationContextApis: { + fields: any; + }; + ConfigurationContextPaths: { + fields: any; + }; + ContextHostType: { + enumValues: { + "unknown": number; + "deployment": number; + "application": number; + "projectCollection": number; + }; + }; + ContextIdentifier: { + fields: any; + }; + ContributedServiceContext: { + fields: any; + }; + ContributionContext: { + fields: any; + }; + ContributionPath: { + fields: any; + }; + ContributionPathType: { + enumValues: { + "default": number; + "resource": number; + }; + }; + CoreReferencesContext: { + fields: any; + }; + DataProviderResult: { + fields: any; + }; + DaylightSavingsAdjustmentEntry: { + fields: any; + }; + DiagnosticsContext: { + fields: any; + }; + ExtendedHostContext: { + fields: any; + }; + FeatureAvailabilityContext: { + fields: any; + }; + GlobalizationContext: { + fields: any; + }; + HostContext: { + fields: any; + }; + Hub: { + fields: any; + }; + HubGroup: { + fields: any; + }; + HubsContext: { + fields: any; + }; + IdentityModel: { + fields: any; + }; + JavascriptFileReference: { + fields: any; + }; + JsonArrayWrapper: { + fields: any; + }; + MicrosoftAjaxConfig: { + fields: any; + }; + ModuleLoaderConfiguration: { + fields: any; + }; + ModuleLoaderShimConfiguration: { + fields: any; + }; + NavigationContext: { + fields: any; + }; + NavigationContextLevels: { + enumValues: { + "none": number; + "deployment": number; + "application": number; + "collection": number; + "project": number; + "team": number; + "applicationAll": number; + "all": number; + }; + }; + PageContext: { + fields: any; + }; + ResolvedDataProvider: { + fields: any; + }; + ServiceLocations: { + fields: any; + }; + StylesheetReference: { + fields: any; + }; + TeamContext: { + fields: any; + }; + TeamFoundationServiceHostModel: { + fields: any; + }; + TfsMailSettings: { + fields: any; + }; + TfsServiceHostDescriptor: { + fields: any; + }; + TimeZonesConfiguration: { + fields: any; + }; + UserContext: { + fields: any; + }; + WebAccessConfiguration: { + fields: any; + }; + WebContext: { + fields: any; + }; +}; +} +declare module "VSS/Common/Contracts/System" { +export enum DayOfWeek { + /** + * Indicates Sunday. + */ + Sunday = 0, + /** + * Indicates Monday. + */ + Monday = 1, + /** + * Indicates Tuesday. + */ + Tuesday = 2, + /** + * Indicates Wednesday. + */ + Wednesday = 3, + /** + * Indicates Thursday. + */ + Thursday = 4, + /** + * Indicates Friday. + */ + Friday = 5, + /** + * Indicates Saturday. + */ + Saturday = 6, +} +export var TypeInfo: { + DayOfWeek: { + enumValues: { + "sunday": number; + "monday": number; + "tuesday": number; + "wednesday": number; + "thursday": number; + "friday": number; + "saturday": number; + }; + }; +}; +} +declare module "VSS/Common/Contracts/System.Data" { +/** + * Specifies SQL Server-specific data type of a field, property, for use in a System.Data.SqlClient.SqlParameter. + */ +export enum SqlDbType { + /** + * A 64-bit signed integer. + */ + BigInt = 0, + /** + * Array of type Byte. A fixed-length stream of binary data ranging between 1 and 8,000 bytes. + */ + Binary = 1, + /** + * Boolean. An unsigned numeric value that can be 0, 1, or null. + */ + Bit = 2, + /** + * String. A fixed-length stream of non-Unicode characters ranging between 1 and 8,000 characters. + */ + Char = 3, + /** + * DateTime. Date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds. + */ + DateTime = 4, + /** + * Decimal. A fixed precision and scale numeric value between -10 38 -1 and 10 38 -1. + */ + Decimal = 5, + /** + * Double. A floating point number within the range of -1.79E +308 through 1.79E +308. + */ + Float = 6, + /** + * Array of type Byte. A variable-length stream of binary data ranging from 0 to 2 31 -1 (or 2,147,483,647) bytes. + */ + Image = 7, + /** + * Int32. A 32-bit signed integer. + */ + Int = 8, + /** + * Decimal. A currency value ranging from -2 63 (or -9,223,372,036,854,775,808) to 2 63 -1 (or +9,223,372,036,854,775,807) with an accuracy to a ten-thousandth of a currency unit. + */ + Money = 9, + /** + * String. A fixed-length stream of Unicode characters ranging between 1 and 4,000 characters. + */ + NChar = 10, + /** + * String. A variable-length stream of Unicode data with a maximum length of 2 30 - 1 (or 1,073,741,823) characters. + */ + NText = 11, + /** + * String. A variable-length stream of Unicode characters ranging between 1 and 4,000 characters. Implicit conversion fails if the string is greater than 4,000 characters. Explicitly set the object when working with strings longer than 4,000 characters. Use System.Data.SqlDbType.NVarChar when the database column is nvarchar(max). + */ + NVarChar = 12, + /** + * Single. A floating point number within the range of -3.40E +38 through 3.40E +38. + */ + Real = 13, + /** + * Guid. A globally unique identifier (or GUID). + */ + UniqueIdentifier = 14, + /** + * DateTime. Date and time data ranging in value from January 1, 1900 to June 6, 2079 to an accuracy of one minute. + */ + SmallDateTime = 15, + /** + * Int16. A 16-bit signed integer. + */ + SmallInt = 16, + /** + * Decimal. A currency value ranging from -214,748.3648 to +214,748.3647 with an accuracy to a ten-thousandth of a currency unit. + */ + SmallMoney = 17, + /** + * String. A variable-length stream of non-Unicode data with a maximum length of 2 31 -1 (or 2,147,483,647) characters. + */ + Text = 18, + /** + * Array of type System.Byte. Automatically generated binary numbers, which are guaranteed to be unique within a database. timestamp is used typically as a mechanism for version-stamping table rows. The storage size is 8 bytes. + */ + Timestamp = 19, + /** + * Byte. An 8-bit unsigned integer. + */ + TinyInt = 20, + /** + * Array of type Byte. A variable-length stream of binary data ranging between 1 and 8,000 bytes. Implicit conversion fails if the byte array is greater than 8,000 bytes. Explicitly set the object when working with byte arrays larger than 8,000 bytes. + */ + VarBinary = 21, + /** + * String. A variable-length stream of non-Unicode characters ranging between 1 and 8,000 characters. Use System.Data.SqlDbType.VarChar when the database column is varchar(max). + */ + VarChar = 22, + /** + * Object. A special data type that can contain numeric, string, binary, or date data as well as the SQL Server values Empty and Null, which is assumed if no other type is declared. + */ + Variant = 23, + /** + * An XML value. Obtain the XML as a string using the System.Data.SqlClient.SqlDataReader.GetValue(System.Int32) method or System.Data.SqlTypes.SqlXml.Value property, or as an System.Xml.XmlReader by calling the System.Data.SqlTypes.SqlXml.CreateReader method. + */ + Xml = 25, + /** + * A SQL Server user-defined type (UDT). + */ + Udt = 29, + /** + * A special data type for specifying structured data contained in table-valued parameters. + */ + Structured = 30, + /** + * Date data ranging in value from January 1,1 AD through December 31, 9999 AD. + */ + Date = 31, + /** + * Time data based on a 24-hour clock. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. Corresponds to a SQL Server time value. + */ + Time = 32, + /** + * Date and time data. Date value range is from January 1,1 AD through December 31, 9999 AD. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. + */ + DateTime2 = 33, + /** + * Date and time data with time zone awareness. Date value range is from January 1,1 AD through December 31, 9999 AD. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. Time zone value range is -14:00 through +14:00. + */ + DateTimeOffset = 34, +} +export var TypeInfo: { + SqlDbType: { + enumValues: { + "BigInt": number; + "Binary": number; + "Bit": number; + "Char": number; + "DateTime": number; + "Decimal": number; + "Float": number; + "Image": number; + "Int": number; + "Money": number; + "NChar": number; + "NText": number; + "NVarChar": number; + "Real": number; + "UniqueIdentifier": number; + "SmallDateTime": number; + "SmallInt": number; + "SmallMoney": number; + "Text": number; + "Timestamp": number; + "TinyInt": number; + "VarBinary": number; + "VarChar": number; + "Variant": number; + "Xml": number; + "Udt": number; + "Structured": number; + "Date": number; + "Time": number; + "DateTime2": number; + "DateTimeOffset": number; + }; + }; +}; +} +declare module "VSS/Compatibility" { +export function moved(name: string, fromPath: string, toPath: string, description?: any): void; +export function removed(name: string, internalUsage?: boolean): void; +export function deprecated(name: string, version: string): void; +} +declare module "VSS/Context" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +/** + * Parse out the web context information found in JSON island data in the given element. + */ +export function parseWebContext($element: JQuery): Contracts_Platform.WebContext; +/** + * Get the raw JSON of the global context of the current page. + */ +export function _getDefaultRawPageContext(): Contracts_Platform.PageContext; +/** + * Get the default web context for the current page. + */ +export function getDefaultWebContext(): Contracts_Platform.WebContext; +/** + * Get the global page context for the current page. + */ +export function getPageContext(): Contracts_Platform.PageContext; +/** +* Get web access paths for the given service +* +* @param serviceInstanceTypeId The id of the service instance type +*/ +export function getPathsForService(serviceInstanceTypeId: string): Contracts_Platform.ConfigurationContextPaths; +/** +* Add CSS module mappings to be used by the CSS loader. +* +* @param modulePrefix CSS module prefix to map +* @param url The base static root url used for CSS files for the service that owns that prefix +*/ +export function addCssModulePrefixMapping(modulePrefix: string, url: string): void; +/** +* Get the url for the given CSS module (e.g. VSS/LoaderPlugins/Css!Prefix:ModulePath) +* +* @param modulePrefix CSS module prefix +* @param cssModulePath CSS module name +* @returns The url to the themed css file +*/ +export function getCssModuleUrl(modulePrefix: string, cssModulePath: string): string; +/** +* Process the contributed configuration from a particular service +* +* @param context The contributed service context to evaluate +*/ +export function processContributedServiceContext(context: Contracts_Platform.ContributedServiceContext): void; +} +declare module "VSS/Contributions/Contracts" { +import VSS_Identities_Contracts = require("VSS/Identities/Contracts"); +/** + * An individual contribution made by an extension + */ +export interface Contribution extends ContributionBase { + /** + * List of constraints (filters) that should be applied to the availability of this contribution + */ + constraints: ContributionConstraint[]; + /** + * Properties/attributes of this contribution + */ + properties: any; + /** + * The ids of the contribution(s) that this contribution targets. (parent contributions) + */ + targets: string[]; + /** + * Id of the Contribution Type + */ + type: string; +} +/** + * Base class shared by contributions and contribution types + */ +export interface ContributionBase { + /** + * Description of the contribution/type + */ + description: string; + /** + * Extension-relative identifier of the contribution/type + */ + id: string; +} +/** + * Specifies a constraint that can be used to dynamically include/exclude a given contribution + */ +export interface ContributionConstraint { + /** + * An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included). + */ + group: number; + /** + * If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true) + */ + inverse: boolean; + /** + * Name of the IContributionFilter class + */ + name: string; + /** + * Properties that are fed to the contribution filter class + */ + properties: any; +} +/** + * Identifier for contributions and contribution types + */ +export interface ContributionIdentifier { + /** + * The extension id + */ + extensionId: string; + /** + * The full/unique identifier of the contribution/contributionType + */ + id: string; + /** + * The publisher id + */ + publisherId: string; + /** + * The extension-relative contribution id + */ + relativeId: string; +} +/** + * Description about a property of a contribution type + */ +export interface ContributionPropertyDescription { + /** + * Description of the property + */ + description: string; + /** + * Name of the property + */ + name: string; + /** + * True if this property is required + */ + required: boolean; + /** + * The type of value used for this property + */ + type: ContributionPropertyType; +} +export enum ContributionPropertyType { + /** + * Contribution type is unknown (value may be anything) + */ + Unknown = 0, + /** + * Value is a string + */ + String = 1, + /** + * Value is a Uri + */ + Uri = 2, + /** + * Value is a GUID + */ + Guid = 4, + /** + * Value is True or False + */ + Boolean = 8, + /** + * Value is an integer + */ + Integer = 16, + /** + * Value is a double + */ + Double = 32, + /** + * Value is a DateTime object + */ + DateTime = 64, + /** + * Value is a generic Dictionary/JObject/property bag + */ + Dictionary = 128, + /** + * Value is an array + */ + Array = 256, + /** + * Value is an arbitrary/custom object + */ + Object = 512, +} +/** + * A contribution type, given by a json schema + */ +export interface ContributionType extends ContributionBase { + /** + * Controls whether or not contributions of this type have the type indexed for queries. This allows clients to find all extensions that have a contribution of this type. NOTE: Only TrustedPartners are allowed to specify indexed contribution types. + */ + indexed: boolean; + /** + * Friendly name of the contribution/type + */ + name: string; + /** + * Describes the allowed properties for this contribution type + */ + properties: { + [key: string]: ContributionPropertyDescription; + }; +} +/** + * Represents a VSO "extension" which is a container for contributions and contribution types + */ +export interface Extension extends ExtensionManifest { + /** + * The friendly extension id for this extension - unique for a given publisher. + */ + extensionId: string; + /** + * The display name of the extension. + */ + extensionName: string; + /** + * Extension flags relevant to contribution consumers + */ + flags: ExtensionFlags; + /** + * Globally unique id for this extension (the same id is used for all versions of a single extension) + */ + id: string; + /** + * Unique id of the publisher of this extension + */ + publisherId: string; + /** + * The display name of the publisher + */ + publisherName: string; + /** + * Unique id for this extension (the same id is used for all versions of a single extension) + */ + registrationId: string; + /** + * Version of this extension + */ + version: string; +} +/** + * Represents a single collection for extension data documents + */ +export interface ExtensionDataCollection { + /** + * The name of the collection + */ + collectionName: string; + /** + * A list of documents belonging to the collection + */ + documents: any[]; + /** + * The type of the collection's scope, such as Default or User + */ + scopeType: string; + /** + * The value of the collection's scope, such as Current or Me + */ + scopeValue: string; +} +/** + * Represents a query to receive a set of extension data collections + */ +export interface ExtensionDataCollectionQuery { + /** + * A list of collections to query + */ + collections: ExtensionDataCollection[]; +} +/** + * Base class for an event callback for an extension + */ +export interface ExtensionEventCallback { + /** + * The uri of the endpoint that is hit when an event occurs + */ + uri: string; +} +/** + * Collection of event callbacks - endpoints called when particular extension events occur. + */ +export interface ExtensionEventCallbackCollection { + /** + * For multi-version extensions, defines an endpoint that gets called via an OPTIONS request to determine the particular version of the extension to be used + */ + versionCheck: ExtensionEventCallback; +} +export enum ExtensionFlags { + /** + * A built-in extension is installed for all VSO accounts by default + */ + BuiltIn = 1, + /** + * The extension comes from a fully-trusted publisher + */ + Trusted = 2, +} +/** + * Base class for extension properties which are shared by the extension manifest and the extension model + */ +export interface ExtensionManifest { + /** + * Uri used as base for other relative uri's defined in extension + */ + baseUri: string; + /** + * List of contributions made by this extension + */ + contributions: Contribution[]; + /** + * List of contribution types defined by this extension + */ + contributionTypes: ContributionType[]; + /** + * Collection of endpoints that get called when particular extension events occur + */ + eventCallbacks: ExtensionEventCallbackCollection; + /** + * Language Culture Name set by the Gallery + */ + language: string; + /** + * Version of the extension manifest format/content + */ + manifestVersion: number; + /** + * List of all oauth scopes required by this extension + */ + scopes: string[]; +} +/** + * Policy with a set of permissions on extension operations + */ +export interface ExtensionPolicy { + /** + * Permissions on 'Install' operation + */ + install: ExtensionPolicyFlags; + /** + * Permission on 'Request' operation + */ + request: ExtensionPolicyFlags; +} +export enum ExtensionPolicyFlags { + /** + * No permission + */ + None = 0, + /** + * Permission on private extensions + */ + Private = 1, + /** + * Permission on public extensions + */ + Public = 2, + /** + * Premission in extensions that are in preview + */ + Preview = 4, + /** + * Premission in relased extensions + */ + Released = 8, + /** + * Permission in 1st party extensions + */ + FirstParty = 16, + /** + * Mask that defines all permissions + */ + All = 31, +} +/** + * A request for an extension (to be installed or have a license assigned) + */ +export interface ExtensionRequest { + /** + * Required message supplied if the request is rejected + */ + rejectMessage: string; + /** + * Date at which the request was made + */ + requestDate: Date; + /** + * Represents the user who made the request + */ + requestedBy: VSS_Identities_Contracts.Identity; + /** + * Optional message supplied by the requester justifying the request + */ + requestMessage: string; + /** + * Represents the state of the request + */ + requestState: ExtensionRequestState; + /** + * Date at which the request was resolved + */ + resolveDate: Date; + /** + * Represents the user who resolved the request + */ + resolvedBy: VSS_Identities_Contracts.Identity; +} +export enum ExtensionRequestState { + /** + * The request has been opened, but not yet responded to + */ + Open = 0, + /** + * The request was accepted (extension installed or license assigned) + */ + Accepted = 1, + /** + * The request was rejected (extension not installed or license not assigned) + */ + Rejected = 2, +} +/** + * The state of an extension + */ +export interface ExtensionState extends InstalledExtensionState { + extensionId: string; + extensionName: string; + /** + * The time at which the version was last checked + */ + lastVersionCheck: Date; + publisherName: string; + /** + * Version of this extension + */ + version: string; +} +export enum ExtensionStateFlags { + /** + * No flags set + */ + None = 0, + /** + * Extension is disabled + */ + Disabled = 1, + /** + * Extension is a built in + */ + BuiltIn = 2, + /** + * Extension has multiple versions + */ + MultiVersion = 4, + /** + * Extension is not installed. This is for builtin extensions only and can not otherwise be set. + */ + UnInstalled = 8, + /** + * Error performing version check + */ + VersionCheckError = 16, + /** + * Trusted extensions are ones that are given special capabilities. These tend to come from Microsoft and can't be published by the general public. Note: BuiltIn extensions are always trusted. + */ + Trusted = 32, +} +/** + * Represents a VSO extension along with its installation state + */ +export interface InstalledExtension extends Extension { + /** + * Information about this particular installation of the extension + */ + installState: InstalledExtensionState; +} +/** + * The state of an installed extension + */ +export interface InstalledExtensionState { + /** + * States of an installed extension + */ + flags: ExtensionStateFlags; + /** + * The time at which this installation was last updated + */ + lastUpdated: Date; +} +/** + * Represents a the Publisher of an extension in ExtensionManagement + */ +export interface Publisher { + /** + * The display name for a publisher + */ + displayName: string; + /** + * The unique name for a Publisher + */ + publisherName: string; +} +/** + * A request for an extension (to be installed or have a license assigned) + */ +export interface RequestedExtension { + /** + * THe unique name of the extensions + */ + extensionName: string; + /** + * A list of each request for the extension + */ + extensionRequests: ExtensionRequest[]; + /** + * Represents the Publisher of the requested extension + */ + publisher: Publisher; + /** + * The total number of requests for an extension + */ + requestCount: number; +} +export interface Scope { + description: string; + title: string; + value: string; +} +/** + * Information about the extension + */ +export interface SupportedExtension { + /** + * Unique Identifier for this extension + */ + extension: string; + /** + * Unique Identifier for this publisher + */ + publisher: string; + /** + * Supported version for this extension + */ + version: string; +} +/** + * Represents the extension policy applied to a given user + */ +export interface UserExtensionPolicy { + /** + * User display name that this policy refers to + */ + displayName: string; + /** + * The extension policy applied to the user + */ + permissions: ExtensionPolicy; + /** + * User id that this policy refers to + */ + userId: string; +} +export var TypeInfo: { + Contribution: { + fields: any; + }; + ContributionBase: { + fields: any; + }; + ContributionConstraint: { + fields: any; + }; + ContributionIdentifier: { + fields: any; + }; + ContributionPropertyDescription: { + fields: any; + }; + ContributionPropertyType: { + enumValues: { + "unknown": number; + "string": number; + "uri": number; + "guid": number; + "boolean": number; + "integer": number; + "double": number; + "dateTime": number; + "dictionary": number; + "array": number; + "object": number; + }; + }; + ContributionType: { + fields: any; + }; + Extension: { + fields: any; + }; + ExtensionDataCollection: { + fields: any; + }; + ExtensionDataCollectionQuery: { + fields: any; + }; + ExtensionEventCallback: { + fields: any; + }; + ExtensionEventCallbackCollection: { + fields: any; + }; + ExtensionFlags: { + enumValues: { + "builtIn": number; + "trusted": number; + }; + }; + ExtensionManifest: { + fields: any; + }; + ExtensionPolicy: { + fields: any; + }; + ExtensionPolicyFlags: { + enumValues: { + "none": number; + "private": number; + "public": number; + "preview": number; + "released": number; + "firstParty": number; + "all": number; + }; + }; + ExtensionRequest: { + fields: any; + }; + ExtensionRequestState: { + enumValues: { + "open": number; + "accepted": number; + "rejected": number; + }; + }; + ExtensionState: { + fields: any; + }; + ExtensionStateFlags: { + enumValues: { + "none": number; + "disabled": number; + "builtIn": number; + "multiVersion": number; + "unInstalled": number; + "versionCheckError": number; + "trusted": number; + }; + }; + InstalledExtension: { + fields: any; + }; + InstalledExtensionState: { + fields: any; + }; + Publisher: { + fields: any; + }; + RequestedExtension: { + fields: any; + }; + Scope: { + fields: any; + }; + SupportedExtension: { + fields: any; + }; + UserExtensionPolicy: { + fields: any; + }; +}; +} +declare module "VSS/Contributions/Controls" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +/** +* Common interface between internal and external contribution hosts +*/ +export interface IExtensionHost { + /** + * Get an instance of a registered object in an extension + * + * @param instanceId Id of the instance to get + * @param contextData Optional data to pass to the extension for it to use when creating the instance + * @return Promise that is resolved to the instance (or a proxy object that talks to the instance in the iframe case) + */ + getRegisteredInstance(instanceId: string, contextData?: any): IPromise; + /** + * Gets the promise that is resolved when the host is loaded, and rejected when the load fails or times out. + */ + getLoadPromise(): IPromise; +} +/** +* Instantiate a contributed control through an internal or external contribution host. +* +* @param $container The jQuery element to place the control in +* @param contribution The contribution (or its id) which contains the details of the contributed control +* @param initialConfig Initial configuration/options to pass to the control +* @param webContext The web context to use when fetching contributions and resolving uris +* @param instanceId Id of the registered object in the contribution's host +* @return Proxied instance of the control +*/ +export function createContributedControl($container: JQuery, contribution: IExtensionContribution | string, initialConfig?: any, webContext?: Contracts_Platform.WebContext, instanceId?: string): IPromise; +/** +* Instantiate a contributed control through an internal or external contribution host. +* +* @param $container The jQuery element to place the control in +* @param contributionId The contribution (or its id) which contains the details of the contributed control +* @param initialConfig Initial configuration/options to pass to the control +* @param webContext The web context to use when fetching contributions and resolving uris +* @param postContent Optional data to post to the contribution url (if not specified, a GET is performed) +* @param uriReplacementProperties Replacement object to use when resolving the content uri +* @param uriPropertyName Name of the uri property to lookup in the contribution's properties +* @param iframeFirstPartyContent: Set to true if the content should be iframed, even if it is first-party content. +* @return IExtensionHost +*/ +export function createExtensionHost($container: JQuery, contribution: IExtensionContribution | string, initialConfig?: any, webContext?: Contracts_Platform.WebContext, postContent?: any, uriReplacementProperties?: any, uriPropertyName?: string, iframeFirstPartyContent?: boolean): IPromise; +/** +* Instantiate a contributed control through an internal or external contribution host. +* +* @param $container The jQuery element to place the control in +* @param uri The uri of the contribution content +* @param contribution The contribution which contains the details of the contributed control +* @param initialConfig Initial configuration/options to pass to the control +* @param postContent: Optional data to post to the contribution url (if not specified, a GET is performed) +* @param iframeFirstPartyContent: Set to true if the content should be iframed, even if it is first-party content. +* @return IExtensionHost +*/ +export function createExtensionHostForContribution($container: JQuery, uri: string, contribution: IExtensionContribution, initialConfig?: any, postContent?: any, iframeFirstPartyContent?: boolean): IExtensionHost; +/** +* Instantiate a contributed background host (no UI) through an internal or external contribution host. +* +* @param contribution The contribution (or full id of the contribution) which contains the details of the contributed control +* @param webContext The web context to use when fetching contributions and resolving uris +* @param uriReplacementProperties Replacement object to use when resolving the content uri +* @param uriPropertyName Name of the uri property to lookup in the contribution's properties +* @return IExtensionHost +*/ +export function getBackgroundHost(contribution: IExtensionContribution | string, webContext?: Contracts_Platform.WebContext, uriReplacementProperties?: any, uriPropertyName?: string): IPromise; +/** +* Instantiate a registered background/service instance (no UI) through an internal or external contribution host. +* +* @param contribution The contribution (or full id of the contribution) which contains the details of the contributed control +* @param instanceId Id of the registered object in the contribution's host +* @param contextData Context data/options to pass to the registered object factory method +* @param webContext The web context to use when fetching contributions and resolving uris +* @param timeout Timeout in milliseconds for the instance creation +* @param timeoutMessage Message to reject the promise with if the fetch times out +* @param uriReplacementProperties Replacement object to use when resolving the content uri +* @param uriPropertyName Name of the uri property to lookup in the contribution's properties +* @return IExtensionHost +*/ +export function getBackgroundInstance(contribution: IExtensionContribution | string, instanceId: string, contextData?: any, webContext?: Contracts_Platform.WebContext, timeout?: number, timeoutMessage?: string, uriReplacementProperties?: any, uriPropertyName?: string): IPromise; +} +declare module "VSS/Contributions/RestClient" { +import Contracts = require("VSS/Contributions/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class ContributionsHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + getInstalledExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {string[]} contributionIds + * @param {boolean} includeDisabledApps + * @return IPromise + */ + getInstalledExtensions(contributionIds?: string[], includeDisabledApps?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + getInstalledExtensionByName(publisherName: string, extensionName: string): IPromise; +} +export class ContributionsHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + getInstalledExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {string[]} contributionIds + * @param {boolean} includeDisabledApps + * @return IPromise + */ + getInstalledExtensions(contributionIds?: string[], includeDisabledApps?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + getInstalledExtensionByName(publisherName: string, extensionName: string): IPromise; +} +export class ContributionsHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + getInstalledExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {string[]} contributionIds + * @param {boolean} includeDisabledApps + * @return IPromise + */ + getInstalledExtensions(contributionIds?: string[], includeDisabledApps?: boolean): IPromise; +} +export class ContributionsHttpClient extends ContributionsHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return ContributionsHttpClient2_1 + */ +export function getClient(): ContributionsHttpClient2_1; +} +declare module "VSS/Contributions/Services" { +import Contributions_Contracts = require("VSS/Contributions/Contracts"); +import Serialization = require("VSS/Serialization"); +import Service = require("VSS/Service"); +export module CustomerIntelligenceConstants { + var CONTRIBUTIONS_AREA: string; + var CONTRIBUTIONS_USAGE_FEATURE: string; + var CONTRIBUTIONS_ACTION: string; + var CONTRIBUTIONS_ACTION_EXECUTE: string; +} +/** +* Optional flags for querying contributions +*/ +export enum ContributionQueryOptions { + IncludeRoot = 1, + IncludeDirectTargets = 2, + IncludeRecursiveTargets = 4, + IncludeAll = 7, +} +/** +* Method used to filter contributions as part of a contribution query call +*/ +export interface ContributionQueryCallback { + (contribution: IExtensionContribution): ContributionQueryCallbackResult; +} +export enum ContributionQueryCallbackResult { + None = 0, + Include = 1, + Recurse = 2, + IncludeAndRecurse = 3, +} +/** + * Manages all RegisteredExtension instances and their contributions. + */ +export class ExtensionService extends Service.VssService { + private static _testExecutionFeatureFlag; + private _extensions; + private _contributionsClient; + private _webPageDataService; + private _contributionsById; + private _contributionsByTargetId; + private _loadedContributionTargets; + private _contributionQueryPromises; + /** + * Private constructor - do not call. + */ + constructor(); + /** + * Ensures the page's Json Island has been processed if web context is the default + * Should be called by the Service factory. + * @param connection Service.VssConnection + */ + initializeConnection(connection: Service.VssConnection): void; + /** + * Given an extension, creates Contribution objects that can be quickly + * looked up, and also have a reference back to the extension. + */ + private _ensureContributionLookups(extension); + /** + * Register an extension + * @param extension Contributions_Contracts.InstalledExtension The extension to register. + */ + registerExtension(extension: Contributions_Contracts.InstalledExtension): void; + /** + * Get the contribution with the given id. + * + * @param id Full id of the contribution to fetch + * @return IPromise + */ + getContribution(id: string): IPromise; + /** + * Gets the contributions that target the given contribution ids + * + * @param targetIds Ids of the targeted contribution(s) + * @param contributionType Optional type of contribution to filter by + * @return IPromise Promise that is resolved when contributions are available. + */ + getContributionsForTarget(targetId: string, contributionType?: string): IPromise; + /** + * Gets the contributions that target the given contribution ids + * + * @param targetIds Ids of the targeted contribution(s) + * @param contributionType Optional type of contribution to filter by + * @return IPromise Promise that is resolved when contributions are available. + */ + getContributionsForTargets(targetIds: string[], contributionType?: string): IPromise; + /** + * Gets contributions for the given contribution ids. + * + * @param ids Ids of the targeted contribution(s) + * @param includeRootItems True to include the contributions with the specified ids + * @param includeChildren True to include contributions that target the specified ids + * @param recursive If true include targeting children recursively + * @return IPromise Promise that is resolved when contributions are available. + */ + getContributions(ids: string[], includeRootItems: boolean, includeChildren: boolean, recursive?: boolean): IPromise; + /** + * Gets contributions for the given contribution ids. + * + * @param ids Ids of the targeted contribution(s) + * @param queryOptions Contribution query options + * @param contributionType Optional type of contribution to filter by + * @param queryCallback Optional method to filter contributions by + * @return IPromise Promise that is resolved when contributions are available. + */ + queryContributions(ids: string[], queryOptions: ContributionQueryOptions, contributionType?: string, queryCallback?: ContributionQueryCallback): IPromise; + /** + * Determines whether or not the provided extension id is currently active - installed, licensed, and enabled. + * If the an extension has set up an ActiveExtensionDataProvider to send the extension active state down with the JSON island data, + * the state is pulled from there. Otherwise, a call is made to the server to get the state. This result is not cached. + * @param extensionId The extension id (e.g. 'ms.vss-testmanager-web') to check + */ + isExtensionActive(extensionId: string): IPromise; + private _resolveContributions(deferred, contributions); + private _getUnqueriedContributions(ids); + private _getPendingLoadPromises(ids); + private _getLoadedContributions(ids, queryOptions, contributionType, queryCallback?); + private _fetchTargetingContributions(contributionId, results, includedContributionIds, queryCallback, contributionType); + /** + * Mark the given contribution ids as already queried-for so that additional gets + * for these contributions don't issue a REST call. + */ + private _registerLoadedContributionTargets(contributions); + /** + * Parse the extensions in the JSON island given by the selector + * @param selector Selector to match a script tag containing JSON + */ + private _processJsonIsland(); +} +/** +* Delegate for web page data resolution plugins. Allows plugins to be notified when +* web page data with a certain key is received +*/ +export interface WebPageDataResolutionPlugin { + /** + * @param key The key of the data + * @param value The new value of the data + * @param existingValue The existing value for the same entry before any data was received + * @returns The value to store for this entry. undefined return value indicates to store the new value + */ + (key: string, newValue: any, existingValue: any): any; +} +/** +* Service for obtaining web page data from contributed data providers +*/ +export class WebPageDataService extends Service.VssService { + private static _resolveDataPlugins; + private _localData; + private _resolvedProviders; + private _contributionPromises; + private _getLocalData(); + private _ensureInitialized(); + private _handleDataProviderResult(result); + /** + * Add a plugin handler that gets called when data with the given key has been sent from the server + * + * @param dataKey The data provider key + * @param handler Function called whenever data with the given key has been provided + */ + static addResolutionPlugin(dataKey: string, handler: WebPageDataResolutionPlugin): void; + /** + * Remove the plugin handler that gets called when data with the given key + * + * @param dataKey The data provider key + */ + static removeResolutionPlugin(dataKey: string): void; + /** + * Get web page data that was contributed from the given contribution + * + * @param key The data provider key + * @param contractMetadata Optional contract metadata to use to deserialize the object + */ + getPageData(key: string, contractMetadata?: Serialization.ContractMetadata): T; + /** + * Ensure that all data providers have been resolved for all of the given data-provider contributions + * + * @param contributions The data provider contributions to resolve + */ + ensureDataProvidersResolved(contributions: IExtensionContribution[]): IPromise; + private fetchPageDataForService(serviceInstanceId, contributionIds); +} +/** + * Provides helper functions for extensions-related types. + */ +export class ExtensionHelper { + private static _httpUrlRegex; + private static _handlebarHelpersRegistered; + private static _asyncReplacementIndicator; + private static _asyncReplacementCounter; + private static _asyncReplacementPromises; + /** + * Generate a full contribution id for the given contribution. + * + * @param contribution The contribution to get the id of + */ + static getFullContributionId(contribution: IExtensionContribution): string; + /** + * Take a contribution id that may be relative or fully qualified. If fully qualified, just return the + * id. If relative, form a fully qualified id by prepending the publisher id and extension id. + * + * @param id Relative or fully qualified contribution id + * @param extension The extension to reference if the id is relative + */ + static ensureFullContributionId(id: string, extension: Extension): string; + /** + * Is the contribution of the given contribution type + * + * @param contribution The contribution whose type to check + * @param contributionType The full id of the contribution type to check for + */ + static isContributionOfType(contribution: IExtensionContribution, contributionType: string): boolean; + /** + * Determine whether or not the given contribution is from a trusted extension and has internal content + * + * @param contribution The contribution whose properties to check + */ + static hasInternalContent(contribution: IExtensionContribution): boolean; + /** + * Determine whether or not the given contribution provides hostable content + * + * @param contribution The contribution whose properties to check + * @param uriProperty The property name which contains the content uri ("uri" by default) + */ + static hasContent(contribution: IExtensionContribution, uriProperty?: string): boolean; + private static _registerHandlebarHelpers(handlebars); + private static resolveDefaultHostUri(webContext, hostContext); + private static handleAsyncReplacements(value, asyncIndex, asyncStopIndex, deferred); + /** + * Processes a mustache template string with the given replacement object + * @param string templateString The mustache template string + * @param any replacementObject + * @return string The template string with all replacements made + */ + static resolveTemplateString(templateString: string, replacementObject: any): IPromise; + /** + * Processes a URI template string with the given replacement object and base URI + * @param string templateString The mustache template string + * @param any replacementObject + * @param string baseUri + * @return string The template string with all replacements made + */ + static resolveUriTemplate(templateString: string, replacementObject: any, baseUri: string): IPromise; + /** + * Get an absolute URI for a given property on a contribution and a replacements object + * @param + */ + static resolveUriTemplateProperty(contribution: IExtensionContribution, replacementObject: any, propertyName?: string): IPromise; + /** + * Given a path and a base URI, construct an absolute URI + * @param string path + * @param string baseUri + * @return string + */ + private static processUri(path, baseUri); + /** + * Publish tracing data for a given contribution + * @param IExtensionContribution contribution + * @param any data + */ + static publishTraceData(contribution: IExtensionContribution, data?: string): void; +} +} +declare module "VSS/Controls" { +export function getId(): number; +export interface EnhancementOptions { + earlyInitialize?: boolean; + cssClass?: string; + coreCssClass?: string; + tagName?: string; + width?: number | string; + height?: number | string; + title?: string; + role?: string; + id?: number | string; + prepend?: boolean; + change?: Function; +} +export class Enhancement { + static ENHANCEMENTS_DATA_KEY: string; + static ENHANCEMENT_OPTIONS_KEY: string; + static ENHANCEMENT_OPTIONPREFIX_KEY: string; + static optionsPrefix: string; + private static enhancementList; + private _id; + private _typeName; + private _eventNamespace; + private _trackedElements; + private _delayedFunctions; + protected _enhancementOptions: EnhancementOptions; + _options: TOptions; + _initialized: boolean; + _element: JQuery; + _disposed: boolean; + /** + * @param options + */ + constructor(options?: TOptions, enhancementOptions?: EnhancementOptions); + /** + * @param type + * @return + */ + static getTypeName(type?: any): string; + /** + * @return + */ + static getOptionPrefix(type: any): string; + /** + * @param type + * @param element + */ + static getEnhancementOptions(type: any, element: any): any; + /** + * @param type + * @param element + * @param options + * @return + */ + static enhance(type: new (options: TOptions, enhancementOptions: EnhancementOptions) => Enhancement, element: Enhancement | JQuery | Node | string, options?: ((element: JQuery) => TOptions) | TOptions, enhancementOptions?: EnhancementOptions): Enhancement; + /** + * @param type + * @param element + * @return + */ + static getInstance(type?: any, element?: any): Enhancement; + static getInstanceO(type?: any, element?: any): Enhancement; + /** + * @param type + * @param selector + * @param options + * @param errorCallback + */ + static registerEnhancement(type?: { + new (options: TOptions): Enhancement; + }, selector?: string, options?: TOptions, errorCallback?: IErrorCallback, enhancementOptions?: EnhancementOptions): void; + /** + * @param type + * @param context + * @param errorCallback + * @return + */ + static ensureEnhancements(type?: any, context?: any, errorCallback?: any): Enhancement[]; + /** + * @param type + * @param context + * @param errorCallback + * @return + */ + static ensureEnhancement(type?: any, context?: any, errorCallback?: any): Enhancement; + /** + * @param type + * @param widgetName + * @param widgetOptions + */ + static registerJQueryWidget(type?: any, widgetName?: any, widgetOptions?: TOptions, enhancementOptions?: EnhancementOptions): void; + /** + * @return + */ + protected _getUniqueId(): string; + /** + * @return + */ + getId(): string; + /** + * @param id + */ + protected _setId(id: string): void; + /** + * Sets options related to the creation of this control or enhancement of an element as this control. + * Note: Options are merged. + * @param EnhancementOptions + */ + setEnhancementOptions(enhancementOptions: EnhancementOptions): void; + /** + * @return + */ + getTypeName(): string; + /** + * @return + */ + protected _getEventNameSpace(): string; + getType(): Function; + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + initialize(): void; + /** + * @return + */ + _ensureInitialized(): boolean; + protected _attemptInitialize(): void; + enhance($element: any): void; + /** + * @param element + */ + protected _enhance(element: JQuery): void; + /** + * @param element + */ + protected _setElement(element: JQuery): void; + protected _setStyles(): void; + /** + * Gets the element associated with this control. + * + * @return + */ + getElement(): JQuery; + /** + * @param element + * @param eventType + * @param args + */ + _fire(element?: any, eventType?: any, args?: any): any; + /** + * @param element + * @param eventType + * @param handler + * @param track + */ + _bind(element?: any, eventType?: any, handler?: any, track?: any): Enhancement; + /** + * @param element + * @param eventType + * @param handler + * @param track + */ + _unbind(element?: any, eventType?: any, handler?: any, track?: any): Enhancement; + /** + * Executes the provided function after the specified amount of time + * + * @param name (Optional) Name for this operation. Allows subsequent calls to cancel this action. + * @param msDelay Delay in milliseconds to wait before executing the Function + * @param cancelPendingOps If true, cancel any pending requests with this name. If false, and there are outstanding requests with this name already in progress, then do nothing. + * @param func Method to execute after the delay + */ + delayExecute(name?: string, msDelay?: number, cancelPendingOps?: boolean, func?: Function): void; + /** + * Cancels any pending delayed functions (delayExecute calls) with the specified name + * + * @param name Name (supplied in the delayExecute call) of the operations to cancel + * @return True if any operation was canceled. False if no operations with the specified name were in progress + */ + cancelDelayedFunction(name: string): boolean; + protected _cleanup(): void; + protected _dispose(): void; + dispose(): void; + /** + * @return + */ + isDisposed(): boolean; + protected _getEnhancementOption(key: string): any; + private _trackElement(domElement); + private _untrackElement(domElement); +} +/** + * Creates a the control specified by TControl in the given container. + * @typeparam TControl extends Control - a reference to the type of control to create. Should be the + * same type as the constructor function passed as the first parameter to this function. Note: TypeScript + * doesn't support the constraint of a type parameter referencing any other type parameter in the same + * list, but callers should ensure that TControl extends Control. + * @typeparam TOptions - The type that is passed in as the options for this control. The instantiated control must + * an options parameter of this type. + * @param controlType: new (options: TOptions) => TControl - the constructor function (ClassName) of this type. + * @param container: JQuery - a JQuery element to place the control in. + * @param controlOptions: TOptions - Options to pass in for this control. See the interface for the options type + * for more details. + * @param enhancementOptions?: EnhancementOptions - Optional options for the control enhancement. + * @return TControl - returns an instance of the controlType (first parameter), typed as a TControl (first type param). + */ +export function create, TOptions>(controlType: new (options: TOptions) => TControl, container: JQuery, controlOptions: TOptions, enhancementOptions?: EnhancementOptions): TControl; +export class Control extends Enhancement { + /** + * Creates a the control specified by TControl in the given container. + * @typeparam TControl extends Control - a reference to the type of control to create. Should be the + * same type as the constructor function passed as the first parameter to this function. Note: TypeScript + * doesn't support the constraint of a type parameter referencing any other type parameter in the same + * list, but callers should ensure that TControl extends Control. + * @typeparam TOptions - The type that is passed in as the options for this control. The instantiated control must + * an options parameter of this type. + * @param controlType: new (options: TOptions) => TControl - the constructor function (ClassName) of this type. + * @param container: JQuery - a JQuery element to place the control in. + * @param controlOptions: TOptions - Options to pass in for this control. See the interface for the options type + * for more details. + * @param enhancementOptions?: EnhancementOptions - Optional options for the control enhancement. + * @return TControl - returns an instance of the controlType (first parameter), typed as a TControl (first type param). + */ + static create, TOptions>(controlType: new (options: TOptions) => TControl, container: JQuery, controlOptions: TOptions, enhancementOptions?: EnhancementOptions): TControl; + /** + * @param type + * @param container + * @param options + * @return + */ + static createIn(type?: any, container?: any, options?: TOptions, koCompatable?: boolean): Control; + private _overlay; + private _elementInDomPromise; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @return + */ + _getUniqueId(): string; + /** + * @param id + */ + _setId(id: string): void; + dispose(): void; + showElement(): void; + hideElement(): void; + enableElement(enabled: any): void; + showBusyOverlay(): JQuery; + hideBusyOverlay(): void; + _createElement(): void; + _initializeElement(): void; + _setStyles(): void; + createIn(container: JQuery): void; + protected _createIn(container: JQuery): void; + /** + * Set Focus to the control + */ + focus(): void; + /** + * Fires the change event for the control immediately + * + * @param sender Source element of the event + */ + protected _fireChange(sender?: any): any; + /** + * Get a promise that is resolved once the containing element for this + * control has been added to the DOM hierarchy. + */ + protected _getInDomPromise(): IPromise; + private _waitForElementInDom(deferred); +} +export class BaseControl extends Control { +} +export class BaseDataSource { + private _source; + private _items; + private _allItems; + _options: any; + constructor(options?: any); + setSource(source: any): void; + getSource(): any; + /** + * @param source + */ + prepareSource(source?: any): void; + getComparer(): any; + ensureItems(): void; + /** + * @param all + */ + getItems(all?: any): any; + /** + * @param allItems + */ + setItems(items: any, allItems?: any): void; + /** + * @param all + */ + getCount(all?: any): any; + /** + * @param all + */ + getItem(index: any, all?: any): any; + /** + * @param all + * @param textOnly + * @return + */ + getItemText(index: any, all?: any, textOnly?: any): string; + /** + * @param startsWith + * @param all + */ + getItemIndex(itemText: any, startsWith?: any, all?: any): any; + nextIndex(selectedIndex: any, delta: any, all: any): number; +} +} +declare module "VSS/Controls/AjaxPanel" { +import Panels = require("VSS/Controls/Panels"); +export class AjaxPanel extends Panels.AjaxPanel { + constructor(options?: any); +} +} +declare module "VSS/Controls/CheckboxList" { +import Controls = require("VSS/Controls"); +/** + * Recommended structure for an item in a CheckboxList control. + * Not enforced - you may supply raw string items if preferred. + */ +export interface ICheckboxListItem { + /** + * The item's identifier or representative value. + */ + value: any; + /** + * The item's display text. Ignored if 'content' is supplied. + */ + text?: string; + /** + * Custom display element to render instead of 'text'. + */ + content?: JQuery; + /** + * The item's tooltip. + */ + title?: string; + /** + * Whether the item is checked. + */ + checked: boolean; +} +export interface ICheckboxListOptions extends Controls.EnhancementOptions { + items?: ICheckboxListItem[]; +} +/** + * Presents a list view of items, with checkboxes for each item. + */ +export class CheckboxListO extends Controls.Control { + static enhancementTypeName: string; + private _items; + private _checkedItems; + private _idMap; + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: ICheckboxListOptions): void; + initialize(): void; + enableElement(enabled: boolean): void; + setItems(items: any[]): void; + getCheckedValues(): any[]; + getCheckedItems(): any[]; + getUncheckedValues(): any[]; + getUncheckedItems(): any[]; + setCheckedValues(values: any[]): void; + _initializeElement(): void; + private _checkItemState(item, state); + private _draw(); + /** + * @param e + * @return + */ + private _onCheckClick(e?); +} +export class CheckboxList extends CheckboxListO { +} +} +declare module "VSS/Controls/Combos" { +import Controls = require("VSS/Controls"); +import Validation = require("VSS/Controls/Validation"); +import Virtualization = require("VSS/Controls/Virtualization"); +export class ListDataSource extends Controls.BaseDataSource { +} +export class BaseComboBehavior { + combo: Combo; + protected _options: any; + protected _dataSource: Controls.BaseDataSource; + private _onForceHideDropPopupDelegate; + private _dropPopup; + constructor(combo: any, options?: any); + initialize(): void; + dispose(): void; + setMode(value: any): void; + canType(): boolean; + getValue(): TValue; + getDropPopup(): TDropPopup; + getDataSource(): TDataSource; + /** + * @return + */ + getDropOptions(): any; + getDropWidth(): number; + showDropPopup(): boolean; + hideDropPopup(): boolean; + toggleDropDown(): void; + isDropVisible(): boolean; + setSource(source: any): void; + /** + * @return + */ + getSelectedIndex(): number; + setSelectedIndex(selectedIndex: any, fireEvent: any): void; + /** + * @return + */ + getText(): string; + /** + * @param value + * @param fireEvent + */ + setText(value: string, fireEvent?: boolean): void; + /** + * @param e + * @return + */ + upKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + downKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + pageUpKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + pageDownKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + leftKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + rightKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyDown(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyPress(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyUp(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + onForceHideDropPopup(e?: JQueryEventObject): any; + private _attachGlobalEvents(); + private _detachGlobalEvents(); +} +export interface IBaseComboDropPopup { + getSelectedValue(): string; + setSelectedValue(value: string): void; + selectNext(page?: boolean): boolean; + selectPrev(page?: boolean): boolean; + dispose(): any; +} +export class BaseComboDropPopup extends Controls.BaseControl implements IBaseComboDropPopup { + combo: Combo; + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + setPosition(): void; + getSelectedValue(): string; + setSelectedValue(value: string): void; + selectNext(page?: boolean): boolean; + selectPrev(page?: boolean): boolean; + dispose(): void; + /** + * @param e + * @return + */ + private _onMouseDown(e); +} +/** + * @publicapi + */ +export interface IComboOptions { + /** + * Id added to the underlying input for accessibility. + */ + id?: string; + /** + * Type of the combo. It can be 'list', 'date-time', 'multi-value', 'tree' or 'treeSearch'. + * @defaultvalue "list" + */ + type?: string; + /** + * Mode of the combo. It can be 'text' or 'drop'. Used by the combo of 'list' type. Determines whether to show drop icon or not. + */ + mode?: string; + /** + * Sets the initial value for the combo. + */ + value?: string; + /** + * Allows screen readers to read combo value. Should be used along with id. + */ + label?: string; + /** + * Data source of the combo. + */ + source?: any[]; + /** + * Determines whether the combo is enabled or not. + */ + enabled?: boolean; + dropWidth?: string | number; + /** + * Specifies whether the combo can be edited or not. The difference from enabled is items in the dropdown can be selected. + */ + allowEdit?: boolean; + noDropButton?: boolean; + validator?: any; + /** + * Extra css class applied to combo. + */ + cssClass?: string; + /** + * Css class for drop icon. + */ + iconCss?: string; + /** + * Css class for the input. + */ + inputCss?: string; + /** + * Css class applied for invalid state. + */ + invalidCss?: string; + /** + * Css class applied for disabled state. + */ + disabledCss?: string; + /** + * Css class applied to drop button when hovered. + */ + dropButtonHoverCss?: string; + /** + * Called when the text of the combo changes. + */ + change?: () => any; + focus?: (e: JQueryEventObject) => any; + blur?: (e: JQueryEventObject) => any; + /** + * Called when selected item changes. Argument is the index of the selected item. + */ + indexChanged?: (index: number) => void; + onKeyDown?: (e: JQueryEventObject) => any; +} +/** + * @publicapi + */ +export class ComboO extends Controls.Control { + static enhancementTypeName: string; + static registerBehavior(behaviorMode: any, behaviorType: any): void; + static attachBehavior(combo: any, options?: any): any; + protected _input: JQuery; + protected _currentText: string; + protected _blockBlur: boolean; + private _dropPopup; + private _dropButton; + private _behavior; + /** + * @param options + */ + initializeOptions(options?: any): void; + _dispose(): void; + _createIn(container: any): void; + /** + * @param element + */ + _enhance(element: JQuery): void; + initialize(): void; + getBehavior(): TBehavior; + /** + * Gets the current text value of the combo. + + * @returns {string} + * @publicapi + */ + getText(): string; + /** + * Sets the text of the combo. + * + * @param text New value to set. + * @param fireEvent Determines whether to fire change event or not (default false). + * @publicapi + */ + setText(text: string, fireEvent?: boolean): void; + getDropButton(): JQuery; + /** + * Gets the input element of combo + * + * @return + */ + getInput(): JQuery; + getInputText(): string; + setInputText(text: string, fireEvent?: boolean): void; + /** + * @return + */ + getSelectedIndex(): number; + setSelectedIndex(selectedIndex: number, fireEvent?: boolean): void; + /** + * Gets the underlying value of the combo. If the type is 'list', value is string. If the type is 'date-time', value is Date. If the type is 'multi-value', value is string[]. + * + * @returns {} + * @publicapi + */ + getValue(): TValue; + /** + * @param newValue + */ + fireChangeIfNecessary(newValue?: string): any; + /** + * Programmatically toggles the dropdown. + * @publicapi + */ + toggleDropDown(): void; + /** + * @param e + * @return + */ + showDropPopup(e?: JQueryEventObject): void; + hideDropPopup(): any; + isDropVisible(): boolean; + isBlockingBlur(): boolean; + blockBlur(): void; + cancelBlockBlur(): void; + /** + * @param e + * @return + */ + _onInputKeyDown(e?: JQueryEventObject): any; + setTextSelection(selectionStart: number): void; + /** + * Sets a new source for the combo. + * + * @param source New source for the combo. + * @publicapi + */ + setSource(source: any[] | Function): void; + /** + * Gets the enabled state of the combo. + * + * @returns {boolean} + * @publicapi + */ + getEnabled(): boolean; + /** + * Sets the enabled state of the combo. + * + * @param value True for enabled, false for disabled. + * @publicapi + */ + setEnabled(value: boolean): void; + /** + * Gets the mode of the combo. + * + * @returns {string} + * @publicapi + */ + getMode(): string; + /** + * Sets the mode of the combo. + * + * @param value 'drop' or 'text'. + * @publicapi + */ + setMode(value: string): void; + /** + * Sets the type of the combo. + * + * @param value 'list', 'date-time', 'multi-value', TreeView.ComboTreeBehaviorName or TreeView.SearchComboTreeBehaviorName. + * @publicapi + */ + setType(type: string): void; + /** + * Gets the type of the combo. + * + * @returns {string} + * @publicapi + */ + getComboType(): string; + /** + * Sets the invalid state of the combo. + * + * @param value True for invalid, false for valid. + * @publicapi + */ + setInvalid(value: boolean): void; + private _ensureBehavior(); + private _decorate(); + private _updateStyles(); + /** + * @param e + * @return + */ + private _onDropButtonClick(e?); + /** + * @param e + * @return + */ + private _onInputClick(e?); + /** + * @param e + * @return + */ + private _onInputFocus(e?); + /** + * @param e + * @return + */ + private _onInputBlur(e?); + /** + * @param e + * @return + */ + private _onMouseDown(e?); + /** + * @param e + * @return + */ + private _onInputKeyPress(e?); + /** + * @param e + * @return + */ + private _onInputKeyUp(e?); +} +export class Combo extends ComboO { +} +export class ComboListDropPopup extends BaseComboDropPopup { + virtualizingListView: Virtualization.VirtualizingListView; + protected _dataSource: Controls.BaseDataSource; + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + /** + * @param page + * @return + */ + selectPrev(page?: boolean): boolean; + /** + * @param page + * @return + */ + selectNext(page?: boolean): boolean; + /** + * @return + */ + getSelectedIndex(): number; + getSelectedValue(): string; + setSelectedValue(value: any): void; + getDataSource(): TDataSource; +} +export class ComboListBehavior extends BaseComboBehavior { + private _enableAutoFill; + private _maxItemLength; + constructor(combo: any, options?: any); + initialize(): void; + setSource(source: any): void; + /** + * @return + */ + getDropOptions(): any; + getValue(): TValue; + /** + * Finds the max item length inside the data source + */ + getMaxItemLength(): number; + /** + * Gets the drop width of this behavior + */ + getDropWidth(): number; + /** + * @param value + * @return + */ + getSelectedIndex(value?: string, all?: any): number; + setSelectedIndex(selectedIndex: number, fireEvent?: boolean): void; + /** + * @param value + * @param fireEvent + */ + setText(value: string, fireEvent?: boolean): void; + /** + * @param e + * @return + */ + upKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + downKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + pageUpKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + pageDownKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyDown(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyPress(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyUp(e?: JQueryEventObject): any; + /** + * @param page + * @return + */ + selectPrev(page?: boolean): boolean; + /** + * @param page + * @return + */ + selectNext(page?: boolean): any; + _createDataSource(): Controls.BaseDataSource; + _dropSelectionChanged(selectedIndex: any, accept: any): void; + /** + * Set selected index + * + * @param selectedIndex new selected index + * @param fireEvent flag to whether to fire index changed + */ + private _setSelectedIndex(selectedIndex, fireEvent?); + private _tryAutoFill(); +} +export class ComboControlValidator extends Validation.BaseValidator { + /** + * @param options + */ + initializeOptions(options?: any): void; + /** + * @return + */ + isValid(): boolean; +} +export interface IDateTimeComboOptions extends IComboOptions { + dateTimeFormat?: string; + defaultTimeOfDay?: number; +} +export class DatePanel extends Controls.BaseControl { + private _date; + private _selectedDate; + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + prevMonth(): void; + nextMonth(): void; + prevYear(): void; + nextYear(): void; + selectDate(date: Date): void; + setSelectedDate(date: Date): void; + getSelectedDate(): Date; + private _draw(date, focusElementClass?); + private _drawCalendarTable(date); + /** + * @param e + * @return + */ + private _onKeyDown(e?); + /** + * @param e + * @return + */ + private _onClick(e?); +} +export class ComboDateDropPopup extends BaseComboDropPopup { + private _datePanel; + private _selectedDate; + initialize(): void; + getSelectedDate(): Date; + setSelectedDate(date: Date): void; + /** + * @param e + * @return + */ + private _onChange(e?); +} +export class ComboDateBehavior extends BaseComboBehavior { + private _timeValue; + constructor(combo: any, options?: any); + initialize(): void; + canType(): boolean; + getValue(): Date; + /** + * @return + */ + getDropOptions(): any; + getDropWidth(): number; + /** + * Get's the current value as a date or null if there is no (valid) date. + * + * @return + */ + getSelectedDate(): Date; + /** + * Sets a date value on the combo using the behavior's dateTime format + * + * @param selectedDate The date value to set + */ + setSelectedDate(selectedDate: Date, fireChange?: boolean): void; + /** + * @param e + * @return + */ + upKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + downKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + pageUpKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + pageDownKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + leftKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + rightKey(e?: JQueryEventObject): any; + private _onChange(); + private _getSelectedDate(); + private _addDays(date, days); + private _getMonthLength(month, year); +} +export class DatePicker extends Combo { + /** + * @param options + */ + initializeOptions(options?: any): void; +} +export class ComboMultiValueDropPopup extends ComboListDropPopup { + private _checkStates; + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + getCheckedItems(): string[]; + getValue(): string; + toggleCheckbox(selectedIndex: any): void; + private _createItem(index); + private _onItemClick(e?, itemIndex?, $target?, $li?); +} +export class ComboMultiValueBehavior extends ComboListBehavior { + constructor(combo: any, options?: any); + canType(): boolean; + getValue(): string[]; + /** + * @return + */ + getDropOptions(): any; + /** + * @param e + * @return + */ + keyDown(e?: JQueryEventObject): any; + private _onChange(); +} +} +declare module "VSS/Controls/Common" { +import Controls_CheckboxList = require("VSS/Controls/CheckboxList"); +import Controls_Combos = require("VSS/Controls/Combos"); +import Controls_Dialogs = require("VSS/Controls/Dialogs"); +import Controls_Filters = require("VSS/Controls/Filters"); +import Controls_Histogram = require("VSS/Controls/Histogram"); +import Controls_Notifications = require("VSS/Controls/Notifications"); +import Controls_Panels = require("VSS/Controls/Panels"); +import Controls_RichEditor = require("VSS/Controls/RichEditor"); +import Controls_Splitter = require("VSS/Controls/Splitter"); +import Controls_StatusIndicator = require("VSS/Controls/StatusIndicator"); +import Controls_Virtualization = require("VSS/Controls/Virtualization"); +export class BaseComboBehavior extends Controls_Combos.BaseComboBehavior { + constructor(combo: Combo, options?: any); +} +export class BaseComboDropPopup extends Controls_Combos.BaseComboDropPopup { + constructor(options?: any); +} +export class Combo extends Controls_Combos.Combo { + constructor(options?: any); +} +export class ComboListBehavior extends Controls_Combos.ComboListBehavior { + constructor(options?: any); +} +export class ComboControlValidatior extends Controls_Combos.ComboControlValidator { + constructor(options?: any); +} +export class DatePanel extends Controls_Combos.DatePanel { + constructor(options?: any); +} +export class ComboDateDropPopup extends Controls_Combos.ComboDateDropPopup { + constructor(options?: any); +} +export class ComboDateBehavior extends Controls_Combos.ComboDateBehavior { + constructor(options?: any); +} +export class DatePicker extends Controls_Combos.DatePicker { + constructor(options?: any); +} +export class ComboMultiValueDropPopup extends Controls_Combos.ComboMultiValueDropPopup { + constructor(options?: any); +} +export class VirtualizingListView extends Controls_Virtualization.VirtualizingListView { + constructor(options?: any); +} +export class AjaxPanel extends Controls_Panels.AjaxPanel { + constructor(options?: any); +} +export class StatusIndicator extends Controls_StatusIndicator.StatusIndicator { + constructor(options?: any); +} +export class Dialog extends Controls_Dialogs.Dialog { + constructor(options?: any); +} +export class ModalDialog extends Controls_Dialogs.ModalDialog { + constructor(options?: any); +} +export class ConfirmationDialog extends Controls_Dialogs.ConfirmationDialog { + constructor(options?: any); +} +export class Splitter extends Controls_Splitter.Splitter { + constructor(options?: any); +} +export class MessageAreaControl extends Controls_Notifications.MessageAreaControl { + constructor(options?: any); +} +export class InformationAreaControl extends Controls_Notifications.InformationAreaControl { + constructor(options?: any); +} +export class ToastNotification extends Controls_Notifications.ToastNotification { + constructor(options?: any); +} +export class RichEditor extends Controls_RichEditor.RichEditor { + constructor(options?: any); +} +export class CollapsiblePanel extends Controls_Panels.CollapsiblePanel { + constructor(options?: any); +} +export class CheckboxList extends Controls_CheckboxList.CheckboxList { + constructor(options?: any); +} +export class FilterControl extends Controls_Filters.FilterControl { + constructor(options?: any); +} +export class Histogram extends Controls_Histogram.Histogram { + constructor(options?: any); +} +export class CopyContentDialog extends Controls_Dialogs.CopyContentDialog { + constructor(options?: any); +} +export class LongRunningOperation extends Controls_StatusIndicator.LongRunningOperation { + constructor(container: any, options?: any); +} +export class WaitControl extends Controls_StatusIndicator.WaitControl { + constructor(options?: any); +} +} +declare module "VSS/Controls/Dialogs" { +import Panels = require("VSS/Controls/Panels"); +/** + * Prevents clicking diabled buttons which happens in Edge. + * See Bug 380864: Inactive "OK" button is clickable on EDGE + */ +export function preventClickingDisabledButtons(buttons: any): void; +/** + * @publicapi + */ +export interface IDialogOptions extends Panels.IAjaxPanelOptions { + /** + * Content of the dialog. It can be either a jQuery selector or a jQuery object. + */ + content?: string | JQuery; + /** + * Text to be displayed in the dialog as the content. + */ + contentText?: string; + /** + * Title of the dialog. + */ + title?: string; + /** + * Specifies where the dialog should be displayed when opened. This option is conveyed to underlying jQuery UI Dialog. See http://api.jqueryui.com/dialog/#option-position for more details. + */ + position?: string; + attachResize?: boolean; + /** + * Indicates whether the dialog is resizable or not. + * @defaultvalue true + */ + resizable?: boolean; + /** + * Delegate to be executed when the dialog is opened. + */ + open?: (eventArgs: any) => any; + /** + * Delegate to be executed when the dialog is closed. + */ + close?: (eventArgs: any) => any; + defaultButton?: string; + /** + * Specifies which buttons should be displayed on the dialog. This option is conveyed to underlying jQuery UI Dialog. See http://api.jqueryui.com/dialog/#option-buttons for more details. + */ + buttons?: any; + /** + * Specifies the jQuery selector for the default element to be focused initially. + * @defaultvalue "First tabbable element" + */ + initialFocusSelector?: string; + /** + * Indicates whether global progress indicator is enabled for the dialog or not. + * @defaultvalue true + */ + hasProgressElement?: boolean; + /** + * Specifies whether the dialog should be displayed when closed. + * @defaultvalue true + */ + disposeOnClose?: boolean; + noFocusOnClose?: boolean; + /** + * Width of the dialog in px or %. + * @defaultvalue 500 + */ + width?: number | string; + /** + * Height of the dialog in px or %. + * @defaultvalue "auto" + */ + height?: number | string; + /** + * An optional boolean to specify whether or not to use the Bowtie styling for this Dialog. + */ + useBowtieStyle?: boolean; + widthPct?: number; + heightPct?: number; +} +/** + * publicapi + */ +export class DialogO extends Panels.AjaxPanelO { + static enhancementTypeName: string; + static _dialogActionInProgress: boolean; + /** + * This should be used in cases where you don't want the user to execute more than 1 particular action involving a Dialog + * in parallel. For example, clicking a link that does some server processing before opening a dialog. On slow connections + * the user may be able to click the link several times before the first dialog ever opens. + * + * @param actionDelegate + * The function to execute which will involve initializing a Dialog. It takes a single optional + * paramater which is a cancellation routine. Call this when you encounter a situation (such as an error) + * where you wish to cancel the operation and have subsequent dialog actions execute without being blocked. + * + */ + static beginExecuteDialogAction(actionDelegate: Function): void; + static create(dialogType: any, options?: any): Dialog; + private static _getNextDialogZIndex(); + static show(dialogType: any, options?: any): Dialog; + private _title; + private _progressElement; + private _dialogResult; + private _resizeDelegate; + /** + * Creates a new dialog with the provided options + */ + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + onLoadCompleted(content: any): void; + /** + * Tries to set the focus using the specified or default selector + */ + setInitialFocus(): void; + /** + * Sets focus on the first enabled input element in the dialog. + * + * @param field The field to set focus. + */ + setFormFocusDelayed($field: any): void; + /** + * Sets a new title for the dialog. + * + * @param title New title value. + * @publicapi + */ + setTitle(title: string): void; + /** + * Gets the current title of the dialog. + * + * @returns {string} + * @publicapi + */ + getTitle(): string; + /** + * Gets the current dialog result which will be used when ok button is clicked. + * + * @returns {any} + * @publicapi + */ + getDialogResult(): any; + /** + * Sets the dialog result. + * + * @param dialogResult Result object used when ok button is clicked. + * @publicapi + */ + setDialogResult(dialogResult: any): void; + /** + * Shows the dialog. + */ + show(): void; + /** + * @param e + * @return + */ + onOpen(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + onClose(e?: JQueryEventObject): any; + /** + * Closes the dialog. + * @publicapi + */ + close(): void; + /** + * @param e + * @return + */ + onDialogResize(e?: JQueryEventObject): any; + private _updateTitle(); + /** + * @param e + * @return + */ + private _onWindowResize(e?); + /** + * @param e + * @return + */ + private _onDialogResizing(e?, ui?); +} +export class Dialog extends DialogO { +} +/** + * @publicapi + */ +export interface IModalDialogOptions extends IDialogOptions { + /** + * Display text for ok button. + * @defaultvalue "ok" + */ + okText?: string; + /** + * Delegate executed when ok button is clicked and a dialog result is available. + */ + okCallback?: Function; + /** + * Display text for cancel button. + * @defaultvalue "cancel" + */ + cancelText?: string; + /** + * Delegate executed when cancel button is clicked. + */ + cancelCallback?: Function; +} +export class ModalDialogO extends DialogO { + static enhancementTypeName: string; + static EVENT_BUTTON_STATUS_CHANGE: string; + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + initialize(): void; + /** + * Updates the enabled state of the ok button. + * + * @param enabled True if enabled, otherwise false. + * @publicapi + */ + updateOkButton(enabled: boolean): void; + processResult(result: any): void; + /** + * @param e + * @return + */ + onOkClick(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + onResultReady(e?: JQueryEventObject, args?: any): any; + /** + * @param e + * @return + */ + onCancelClick(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + onButtonStatusChange(e?: JQueryEventObject, args?: any): any; +} +export class ModalDialog extends ModalDialogO { +} +export interface IConfirmationDialogOptions extends IModalDialogOptions { + successCallback: Function; +} +export class ConfirmationDialogO extends ModalDialogO { + $errorContainer: JQuery; + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + _onSuccess(data: any): void; + _onError(error: any): void; + /** + * @param e + * @return + */ + onOkClick(e?: JQueryEventObject): any; +} +export class ConfirmationDialog extends ConfirmationDialogO { +} +export interface CopyContentDialogOptions extends IModalDialogOptions { + dialogLabel?: string; + dialogLabelExtend?: any; + excludeTextPanel?: boolean; + copyAsHtml?: boolean; + data?: any; + textAreaCopyClass?: string; + pageHtml?: string; +} +export class CopyContentDialog extends ModalDialogO { + static enhancementTypeName: string; + private _$textArea; + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + /** + * Initializes the dialog. + */ + initialize(): void; + /** + * Initializes the dialog UI. + */ + private _decorate(); + private _initializeRichEditor($container); + /** + * Initializes the text area panel + * + * @param $container The text area panel container. + */ + private _initializeTextPanel($container); +} +/** + * Shows the specified dialog type using specified options. + * + * @param dialogType Type of the dialog to show. + * @param options Options of the dialog. + * @returns {Dialog}. + */ +export function show(dialogType: new (options: any) => TDialog, options?: any): TDialog; +} +declare module "VSS/Controls/EditableGrid" { +import Combos = require("VSS/Controls/Combos"); +import Controls = require("VSS/Controls"); +import Grids = require("VSS/Controls/Grids"); +export class CellEditor extends Controls.BaseControl { + constructor(options: any); + initialize(): void; + getValue(): string; + getDisplayValue(): string; + setValue(value: string, doNotSavePrevious?: boolean): void; + clearValue(setEmpty?: boolean): void; + setSize($cellContext: JQuery): void; + dispose(): void; + setPosition(top: number, left: number): void; + getHeight(): number; + focus(): void; + fireEndEdit(e?: JQueryEventObject): void; + beginEdit(initValue: string): void; + _attachEvents(): void; + _detachEvents(): void; + _fireChangedIfNeeded(): void; + _handleKeydown(e: JQueryEventObject): boolean; + _insertNewLineAtCursor(): void; + _setCaretPositionToEnd($element: JQuery): void; + _decorateElement(): void; + _resetPosition(): void; + valueChanged: () => void; + endEdit: (e?: JQueryEventObject) => void; + _prevValue: string; + private _inEditMode; + private _initValue; +} +export class TextCellEditor extends CellEditor { + initialize(): void; + setPosition(top: number, left: number): void; + getHeight(): number; + focus(): void; + _attachEvents(): void; + _detachEvents(): void; + _handleKeydown(e: JQueryEventObject): boolean; + _resetPosition(): void; + _editableArea: JQuery; +} +export class RichTextCellEditor extends TextCellEditor { + getValue(): string; + private _getLastHtmlTag($searchElem?); + private _hasNonbreakingSpaceAtEnd($element); + setValue(htmlString: string, doNotSavePrevious?: boolean): void; + clearValue(setEmpty?: boolean): void; + setSize($cellContext: JQuery): void; + _insertNewLineAtCursor(): void; + _attachEvents(): void; + _detachEvents(): void; + _createElement(): void; + _decorateElement(): void; + _handleKeydown(e: JQueryEventObject): boolean; + _setCaretPositionToEnd($element: JQuery): void; +} +export class PlainTextCellEditor extends TextCellEditor { + constructor(options: any); + getValue(): string; + setValue(value: string, doNotSavePrevious?: boolean): void; + clearValue(setEmpty?: boolean): void; + setSize($cellContext: JQuery): void; + _createElement(): void; + _attachEvents(): void; + _detachEvents(): void; + _setCaretPositionToEnd($element: JQuery): void; +} +export class ComboCellEditor extends CellEditor { + private _comboControl; + initialize(): void; + _populateUINodes(node: any, uiNode: any): any; + _updateEditControl(values: string[], controlType: string): void; + getComboControl(): Combos.Combo; + createIn(container: any): void; + _attachEvents(): void; + _detachEvents(): void; + setSize($cellContext: JQuery): void; + setPosition(top: number, left: number): void; + getHeight(): number; + focus(): void; + _resetPosition(): void; + getValue(): string; + setValue(value: string, doNotSavePrevious?: boolean): void; + clearValue(setEmpty?: boolean): void; + _createElement(): void; +} +export class CellInfo { + constructor(rowInfo: any, dataIndex: number, columnInfo: any, columnOrder: number); + rowInfo: any; + columnInfo: any; + dataIndex: number; + columnOrder: number; +} +export class RowHeightInfo { + constructor(height: number); + height: number; + isInvalid: boolean; +} +export class EditableGrid extends Grids.GridO { + static Commands: { + CMD_APPEND: string; + CMD_CUT: string; + CMD_COPY: string; + CMD_PASTE: string; + CMD_INSERT_ROW: string; + CMD_DELETE_ROWS: string; + CMD_CLEAR_ROWS: string; + CMD_INSERT_COLUMNS: string; + CMD_DELETE_COLUMNS: string; + CMD_RENAME_COLUMN: string; + }; + constructor(options?: any); + initialize(): void; + /** + * @param options + */ + initializeOptions(options?: any): void; + getPinAndFocusElementForContextMenu(eventArgs: any): { + pinElement: JQuery; + focusElement: JQuery; + }; + _getClickedColumnIndex(e?: JQueryEventObject): number; + _shouldAttachContextMenuEvents(): boolean; + onContextMenu(eventArgs: any): any; + /** + * gets context menu items list + * + * @return new list of context menu items + */ + _getContextMenuItems(): any; + _updateContextMenuCommandStates(menu: any): void; + _onContextMenuItemClick(e?: any): void; + _onInsertRow(selectedDataIndices: number[], selectedRowIndices: number[]): void; + _onDeleteRows(selectedDataIndices: number[], selectedRowIndices: number[]): void; + _onClearRows(selectedDataIndices: number[], selectedRowIndices: number[]): void; + getSelectedRowIndices(): number[]; + _drawCell(rowInfo: any, dataIndex: number, expandedState: number, level: number, column: any, indentIndex: number, columnOrder: number): any; + onHyperLinkClick(dataIndex: number, columnIndex: string): void; + onBeginCellEdit(dataIndex: number, columnIndex: string): void; + onEndCellEdit(dataIndex: number, columnIndex: string, newValue: string, ignoreValueChange?: boolean): void; + canEditCell(dataIndex: number, columnIndex: string): boolean; + onCellChanged(dataIndex: number, columnIndex: string, newValue: string): void; + _appendRow(): void; + _applyColumnSizing(columnIndex: number, initialWidth?: number, finish?: boolean): void; + _invalidateRowHeights(): void; + ensureRowSelectionWhenLayoutComplete(command: any, indicesToSelect?: number[]): void; + private _focusGrid(); + whenLayoutComplete(command: any, indicesToSelect?: number[]): void; + private _setSelection(indicesToSelect); + private _validateIndicesToSelect(indicesToSelect); + onLayoutComplete(command: any, indicesToSelect?: number[]): void; + _getRowHeightInfo(dataIndex: number): RowHeightInfo; + _setRowHeight(dataIndex: number, height: number): void; + private _setCellValue($cell, value, isRichText, title?); + _setColumnInfo(column: any, index: number): void; + getCellEditorForColumn(index: any): CellEditor; + getCurrentEditRowIndex(): number; + layout(): void; + private _layoutInternal(); + _getSelectedCellInfo(): CellInfo; + _onContainerMouseDown(e?: any): void; + private _setCellEditor($currentCell, clearExisting); + _handleEditorEndEdit(e?: JQueryEventObject, $currentCell?: JQuery): void; + private _handleEndEdit($currentCell, ignoreValueChange?); + private _allowCellResize($row); + private _resizeCellsInRowToHeight($row, dataIndex); + _onKeyDown(e?: JQueryEventObject): any; + _createFocusElement(): JQuery; + private _selectCellForSelectedRowIndex(delayEdit?); + private _getCellForRow($row, columnIndex); + _onUpKey(e?: JQueryEventObject, bounds?: any): void; + _onDownKey(e?: JQueryEventObject, bounds?: any): void; + _onRightKey(e?: JQueryEventObject): void; + _onLeftKey(e?: JQueryEventObject): void; + _selectNextOrPrevCell(next: boolean, doNotGetCellIntoView?: boolean): boolean; + _getRowsPerPage(e?: JQueryEventObject): number; + _onPageUpPageDownKey(e?: JQueryEventObject, bounds?: any): void; + _onHomeKey(e?: JQueryEventObject, bounds?: any): void; + _onEndKey(e?: JQueryEventObject, bounds?: any): void; + _handleCellSelectionAfterViewPortUpdate(): void; + handleHeaderSelectionAfterViewPortUpdate(): void; + _onEnterKey(e?: JQueryEventObject, bounds?: any): any; + _isHyperLinkCell(cellInfo: CellInfo): boolean; + _onBackSpaceKey(e?: JQueryEventObject): void; + _onDeleteKey(e?: JQueryEventObject): any; + _onTabKey(e?: JQueryEventObject): void; + cacheRows(aboveRange: any, visibleRange: any, belowRange: any): void; + _drawRows(visibleRange: any, includeNonDirtyRows: any): void; + setHeightForLowerContentSpacer(height: number): void; + setHeightForUpperContentSpacer(height: number): void; + _includeNewlyInsertedRowsInViewport(affectedIndices: number[]): void; + _adjustContentSpacerHeightsPostDelete(): void; + private _calculateHeightForUpperContentSpacer(firstVisibleIndex, firstVisibleIndexTop); + private _calculateHeightForLowerContentSpacer(lastVisibleIndex, lastVisibleIndexTop, totalHeight); + _getOuterRowHeight(index: number): number; + protected _addSpacingElements(): void; + getSelectedCellIntoView(): boolean; + _getVisibleRowIndices(): { + first: number; + last: number; + }; + _getVisibleRowIndicesAndDoCalculations(): { + first: number; + last: number; + }; + _layoutContentSpacer(): void; + _onCanvasScroll(e?: any): boolean; + private _onScroll(e?); + _onLastRowVisible(rowIndex: number): void; + private _isScrolledIntoView($elem); + _tryFinishColumnSizing(cancel: any): void; + _onContainerResize(e?: JQueryEventObject): any; + _selectRowAndCell($cell: JQuery, doNotGetCellIntoView?: boolean): void; + getSelectedCell(): JQuery; + selectSameRowNthCell(n: number, doNotGetCellIntoView?: boolean): boolean; + _selectNextRowNthCell(n: number, doNotGetCellIntoView?: boolean): boolean; + _selectPrevRowLastCell(doNotGetCellIntoView?: boolean): boolean; + _selectNextRowFirstCell(doNotGetCellIntoView?: boolean): boolean; + private _areEqual($cell1, $cell2); + _onKeyPress(e?: JQueryEventObject): any; + private _isChar(e?); + _onRowDoubleClick(e?: JQueryEventObject): any; + _cleanUpGrid(): void; + private _deleteEditors(); + _editCell($cell: JQuery, delayEdit: boolean, clearExisting: boolean, charCode?: number): void; + private _editCellInternal($cell, cellInfo, clearExisting, charCode?); + _canEdit(cellInfo: CellInfo): boolean; + _onRowMouseDown(e?: JQueryEventObject): any; + _onRowClick(e?: JQueryEventObject): any; + private _getRowFromCell($cell); + private _getRowFromEvent(e?, selector?); + private _areCellInfoEqual(cellInfo1, cellInfo2); + onCellSelectionChanged($cell?: JQuery, delayEdit?: boolean): void; + private _selectCell($cell, doNotBringRowToView?, doNotFireEndEdit?, doNotBringCellIntoView?, delayEdit?, preventEdit?); + private _getCellFromEvent(e?, selector?); + private _getCellInfoFromEvent(e?, selector?); + _updateViewport(includeNonDirtyRows?: boolean): void; + postUpdateViewPort(): void; + _ensureRowDrawn(dataIndex: any): boolean; + /** + * @param rowIndex + * @param force + * @return + */ + _getRowIntoView(rowIndex: number, force?: boolean): boolean; + private _getRowHeightBetweenRows(startIndex, endIndex); + private _scrollCanvasUp(startIndex, endIndex); + private _scrollCanvasDown(startIndex, endIndex); + updateRows(indices?: number[]): void; + _updateRow(rowInfo: any, rowIndex: number, dataIndex: number, expandedState: any, level: number, columnsToUpdate?: { + [id: number]: boolean; + }, forceUpdateHeight?: boolean): void; + _updateRowStyle(rowInfo: any): void; + private _isCellEmpty($cell); + private _getEmptyRowOuterHeight(dataIndex, $row); + _updateRowAndCellHeights(dataIndex: number, $row: JQuery, forceUpdate?: boolean): void; + _clearSelections(): void; + _fireEndEdit(): void; + _rowHeightsDifferencePostDelete: number; + _emptyRowOuterHeight: number; + _gettingRowIntoView: boolean; + _inEditMode: boolean; + _lastVisibleRange: any; + private _currentCellEditor; + private _editRowIndex; + private _heightForUpperContentSpacer; + private _heightForLowerContentSpacer; + private _rowMaxHeight; + private _$selectedCell; + private _selectedCellInfo; + private _columnIndexToEditorMap; + private _columnResizeInProgress; + private _gridRowHolder; + private _belowContentSpacer; + private _isLayoutInProgress; + private _borderHeight; + private _selectCellOnLayoutComplete; +} +} +declare module "VSS/Controls/FileInput" { +import Controls = require("VSS/Controls"); +import Utils_File = require("VSS/Utils/File"); +/** +* Options for the file input control. +*/ +export interface FileInputControlOptions { + initialFiles?: FileList; + maximumNumberOfFiles?: number; + maximumTotalFileSize?: number; + maximumSingleFileSize?: number; + detectEncoding?: boolean; + fileNamesCaseSensitive?: boolean; + resultContentType?: FileInputControlContentType; + updateHandler: (updateEvent: FileInputControlUpdateEventData) => void; +} +/** +* File result from files uploaded to the FileInputControl. +*/ +export interface FileInputControlResult { + name: string; + type: string; + size: number; + lastModifiedDate: Date; + content?: string; + encoding?: Utils_File.FileEncoding; +} +export enum FileInputControlContentType { + Base64EncodedText = 0, + RawText = 1, +} +/** +* Event data passed to FileInputControl update events. +*/ +export interface FileInputControlUpdateEventData { + loading: boolean; + files: FileInputControlResult[]; +} +/** +* Information about a row in the file input control +*/ +export interface FileInputControlRow { + $listElement: JQuery; + $statusElement: JQuery; + $fileNameElement: JQuery; + result: FileInputControlResult; +} +/** +* HTML5 based file input control which accepts one or multiple files with +* browse and drag/drop support. Reads content as a base64 encoded string. +*/ +export class FileInputControl extends Controls.Control { + private _$fileInputContainer; + private _$fileList; + private _inputOptions; + private _results; + private _pendingResults; + private _rows; + private _$overallStatusContainer; + private _$overallStatusText; + private _$errorMessageContainer; + static createControl($container: JQuery, options: FileInputControlOptions): FileInputControl; + /** + * Is this control supported on the current browser? Requires HTML5 FileReader support which + * is present on all supported browsers except IE9. + */ + static isSupported(): boolean; + initializeOptions(options?: any): void; + initialize(): void; + private _triggerUpdateEvent(); + private _updateOverallStatus(); + private _getTotalFilesSize(); + private _addFiles(files); + private _addFile(file); + private _getFriendlySizeString(numBytes, decimalPlaces?); + private _clearError(); + private _displayError(errorText); + getFiles(): FileInputControlResult[]; + isLoadInProgress(): boolean; + getRows(): FileInputControlRow[]; + /** + * Clear all files in the list. + */ + clear(): void; +} +export interface FileDropTargetOptions { + filesDroppedCallback: (fileList: FileList) => any; + dragEnterCallback?: (e: JQueryEventObject) => boolean; + dragLeaveCallback?: (e: JQueryEventObject) => boolean; + dragOverCssClass?: string; +} +export class FileDropTarget extends Controls.Enhancement { + static makeDropTarget($element: JQuery, options: FileDropTargetOptions): FileDropTarget; + private _dropTargetOptions; + private _dragEventDelegate; + private _dragLeaveEventDelegate; + private _dropEventDelegate; + private _dragOverClassName; + _enhance($element: JQuery): void; + _dispose(): void; + private _handleDragEvent(e); + private _handleDragLeaveEvent(e); + private _handleDropEvent(e); +} +} +declare module "VSS/Controls/Filters" { +import Controls = require("VSS/Controls"); +export interface IFilterControlOptions extends Controls.EnhancementOptions { + enableGrouping?: boolean; + enableRowAddRemove?: boolean; + hideLogicalOperator?: boolean; + hideOperatorHeader?: boolean; +} +export class FilterControlO extends Controls.Control { + static enhancementTypeName: string; + private _clauseTable; + private _groupHeaderCell; + private _filter; + constructor(options?: any); + /** + * Get the default clause for this filter. + */ + _getDefaultClause(): void; + /** + * Update the and/or dropdown based on the given clause + * + * @param andOrControl The control to be updated. + * @param clause The clause associated with the control. + */ + _updateAndOrControl(andOrControl: any, clause: any): void; + /** + * Update the field dropdown based on the given clause + * + * @param fieldControl The control to be updated. + * @param clause The clause associated with the control. + */ + _updateFieldControl(fieldControl: any, clause: any): void; + /** + * Update the operator dropdown based on the given clause + * + * @param operatorControl The control to be updated. + * @param clause The clause associated with the control. + * @param updateClause True to update the clause with the new operator/value. + */ + _updateOperatorControl(operatorControl: any, clause: any, updateClause?: boolean): void; + /** + * Update the value dropdown based on the given clause + * + * @param valueControl The control to be updated. + * @param clause The clause associated with the control. + */ + _updateValueControl(valueControl: any, clause: any): void; + /** + * Validate the given clause. + * + * @param clauseInfo The clause info. + */ + _validateClause(clauseInfo: any): void; + /** + * Handler called when the field name control's value is changed. + * + * @param clauseInfo The clause info. + * @param oldValue The old field name. + */ + _handleFieldNameChanged(clauseInfo: any, oldValue: string): void; + /** + * Handler called when the operator control's value is changed. + * + * @param clauseInfo The clause info. + * @param oldValue The old operator value. + */ + _handleOperatorChanged(clauseInfo: any, oldValue: string): void; + /** + * Mark this filter as dirty. + */ + _setDirty(): void; + /** + * @param options + */ + initializeOptions(options?: IFilterControlOptions): void; + setFilter(filter: any): void; + private _createClauseTable(); + private _createHeaderRow(); + _getInsertClauseTooltipText(): string; + _getRemoveClauseTooltipText(): string; + private _createClauseRow(clause); + createClauseValueControl(container: JQuery, options?: any): any; + /** + * Gets the string to be displayed in place of "add new clause" hyperlink. + */ + _getAddNewClauseText(): string; + private _createAddClauseRow(); + private _onClauseChange(change, clauseInfo); + getClauseValue(valueControl: any, clause: any): string; + /** + * @param e + * @return + */ + private _addClauseClick(e?, clauseInfo?); + /** + * @param e + * @return + */ + private _removeClauseClick(e?, clauseInfo?); + private _updateGroupLink(); + private _groupSelectedClauses(); + /** + * @param e + * @return + */ + private _ungroupClick(e?, clauseInfo?); + private _handleFilterModified(); +} +export class FilterControl extends FilterControlO { +} +} +declare module "VSS/Controls/FormInput" { +import Combos = require("VSS/Controls/Combos"); +import Controls = require("VSS/Controls"); +import FormInput_Contracts = require("VSS/Common/Contracts/FormInput"); +/** +* Options for the file input control. +*/ +export interface FormInputControlOptions { + inputsViewModel: InputsViewModel; + headerLabel: string; + comboControlMap: { + [key: string]: Combos.Combo; + }; +} +export interface ExtendedInputDescriptor extends FormInput_Contracts.InputDescriptor { + /** + * A list of functions to be called when this input is deleted. + */ + deleteCallbacks: (() => void)[]; + /** + * A list of functions, all of which must return true for this input to be considered valid + */ + dependencies: InputViewModelDelegate[]; + /** + * A list of functions to be called when the state of all dependencies of this input being satisfied changes. + */ + dependenciesSatisfiedCallbacks: ((satisfied: boolean) => void)[]; + /** + * Gets whether this input should be invisible until all of its dependencies are satisfied or not. + */ + hideUntilSatisfied: boolean; + /** + * Gets whether this input is deletable. + */ + isDeletable: boolean; + /** + * Gets whether this input should be invalidated when one of its dependency's value changes or not. + * Odd name is due to the fact that the default should be to invalidate (based on FormInput_Contracts.InputDescriptor). + */ + noInvalidateOnDependencyChange: boolean; + /** + * Gets whether or not to display the valid icon for this input. + */ + noValidIcon: boolean; + /** + * Information to use to validate this input's value + */ + validation: ExtendedInputValidation; + /** + * A list of functions to be called when the value of this input is changed. + */ + valueChangedCallbacks: InputViewModelDelegate[]; +} +export interface ExtendedInputValidation extends FormInput_Contracts.InputValidation { + /** + * A function called when checking input validity. Validation.isValid must be true for the input to be considered valid. + */ + validateFunction: InputViewModelDelegate; +} +export interface Validation { + /** + * True if input is valid, false otherwise. + */ + isValid: boolean; + /** + * Error message if input is not valid + */ + error: string; +} +export interface InputGroup { + $header: JQuery; + $table: JQuery; + memberCount: number; +} +export interface InputViewModelDelegate { + (inputViewModel: InputViewModel): T; +} +export class FormInputControl extends Controls.Control { + private _$inputsContainer; + private _headerLabel; + private _comboControlMap; + private _inputGroups; + private _$inputIdToElements; + private _inputsViewModel; + static createControl($container: JQuery, options: FormInputControlOptions): FormInputControl; + initializeOptions(options?: any): void; + initialize(): void; + deleteControl(): void; + private _createGroup(headerLabel); + addInputViewModel(inputViewModel: InputViewModel): void; + removeInputViewModel(inputViewModel: InputViewModel, removeFromInputsViewModel?: boolean): void; + showInputViewModel(inputViewModel: InputViewModel): void; + hideInputViewModel(inputViewModel: InputViewModel): void; + private _showHideInputViewModel(inputViewModel, show); + private _createDeleteButton(inputViewModel); + getGroupHeader(groupName?: string): JQuery; + getInputFieldById(id: string): JQuery; + createRowBeforeInput(id: string): JQuery; + createRowAfterInput(id: string): JQuery; + private _createInputField(inputViewModel, $parent, comboControlMap); + private _textInputValueChanged(combo, inputViewModel); + private _radioInputValueChanged($radio, radioValue, inputViewModel); + private static _fixLinkTargets(element); + static getProgressIconForInput(inputId: string): JQuery; + static getValidationIconForInput(inputId: string): JQuery; +} +export class FormInputViewModel { + protected _inputsViewModels: { + [key: string]: InputsViewModel; + }; + protected _dependentInputsLoadingCallback: any; + protected _dependentInputsLoadedCallback: any; + protected _inputValidChangedCallback: any; + protected _inputValuesChangedCallback: any; + protected _queryForValuesCallback: any; + protected _isDirty: boolean; + mapInputIdToComboControl: { + [key: string]: Combos.Combo; + }; + constructor(dependentInputsLoadingCallback: any, dependentInputsLoadedCallback: any, inputValidChangedCallback: any, inputValuesChangedCallback: any, queryForValuesCallback?: any); + addInputsViewModel(key: string, inputsViewModel: InputsViewModel): void; + isDirty(): boolean; + inputsAreValid(inputsKey: string): boolean; + queryInputValues(inputsViewModel: InputsViewModel, inputsToQuery: InputViewModel[], callback: any, callbackContext: any): void; + onInputValuesChanged(inputViewModel: InputViewModel): void; + protected _beginQueryForValues(inputValues: FormInput_Contracts.InputValues[], inputsViewModel: InputsViewModel): IPromise; + protected _showOrHideProgressIndicator(inputId: string, show: boolean): void; +} +export class InputsViewModel { + private _inputViewModels; + private _mapNameToInputViewModel; + private _mapNameDependencyCount; + protected _satisfiedDependentInputs: InputViewModel[]; + private _valuesChangedCallback; + private _formInputViewModel; + constructor(formInputViewModel: FormInputViewModel, inputDescriptors: FormInput_Contracts.InputDescriptor[], inputValues: { + [key: string]: any; + }, inputValidChangedCallback: InputViewModelDelegate, valuesChangedCallback: InputViewModelDelegate); + addInputViewModel(inputDescriptor: ExtendedInputDescriptor, inputValue?: any, inputValidChangedCallback?: InputViewModelDelegate, valuesChangedCallback?: InputViewModelDelegate): InputViewModel; + removeInputViewModel(inputViewModel: InputViewModel): void; + areDirty(): boolean; + areValid(): boolean; + getInputViewModels(): InputViewModel[]; + getInputViewModelById(id: string): InputViewModel; + getInputsAsDictionary(): { + [inputId: string]: any; + }; + allDependentsSatisfied(inputViewModel: InputViewModel): boolean; + private _invalidateDependencies(changedInputViewModel); + private _updateDependencies(changedInputViewModel); + protected _querySatisfiedDependentInputValues(): void; + private _isADependent(inputViewModel); + private _onValueChanged(inputViewModel); + private _onBlur(inputViewModel); +} +export class InputViewModel { + private _inputDescriptor; + private _validation; + private _value; + private _selectedIndex; + private _isValid; + private _isDirty; + private _dependenciesSatisfied; + private _validationError; + private _dependencies; + private _validityDelegate; + private _validityFollowers; + private _blurCallback; + private _inputValidChangedCallback; + private _valueChangedCallbacks; + private _valuesChangedCallback; + private _dependenciesSatisfiedCallbacks; + private _deleteCallbacks; + private _suppressValidityChangeNotifications; + constructor(inputDescriptor: FormInput_Contracts.InputDescriptor, inputValue: any, inputValidChangedCallback: InputViewModelDelegate, blurCallback: InputViewModelDelegate, valueChangedCallbacks: InputViewModelDelegate[], valuesChangedCallback: InputViewModelDelegate, dependencies?: InputViewModelDelegate[], dependenciesSatisfiedCallbacks?: ((satisfied: boolean) => void)[], deleteCallbacks?: (() => void)[]); + private _addFunctions(functions, adder); + validate(): void; + isDirty(): boolean; + isValid(): boolean; + isRequired(): boolean; + isEmpty(): boolean; + isDropList(): boolean; + getId(): string; + getValue(): any; + getValidationMessage(): string; + getSelectedIndex(): number; + setSelectedIndex(index: number): void; + getInputDescriptor(): ExtendedInputDescriptor; + getPossibleValueAtIndex(index: number): FormInput_Contracts.InputValue; + setValue(value: any): void; + refresh(): void; + dependsOn(inputValueId: string): boolean; + invalidateValues(): void; + invalidateOnDependencyChange(): boolean; + updateValues(values: FormInput_Contracts.InputValues): void; + onBlur(): void; + setStateIcon(): void; + suppressValidityChangeNotifications(suppress: boolean): void; + addValueChangedCallback(callback: InputViewModelDelegate, addToFront?: boolean): void; + removeValueChangedCallback(callback: InputViewModelDelegate): boolean; + setValidityDelegate(validityDelegate: InputViewModel): void; + addValidityFollower(follower: InputViewModel, addToFront?: boolean): void; + removeValidityFollower(follower: InputViewModel): void; + addDependency(dependency: InputViewModelDelegate, addToFront?: boolean): void; + checkDependenciesSatisfied(): boolean; + getDependenciesSatisfied(): boolean; + private _dependenciesSatisfiedChange(satisfied); + inputDependenciesSatisfied(satisfied: boolean): boolean; + addDependenciesSatisfiedCallback(callback: (satisfied: boolean) => void, addToFront?: boolean): void; + deleteViewModel(): void; + addDeleteCallback(callback: () => void, addToFront?: boolean): void; + private _invalidateValue(); + private _setValue(value, force); + private _computeSelectedIndex(); + private _setDirty(isDirty); + private _setValid(isValid, error?); + private _getDefaultIndex(); + private _getSelectedIndex(); + private _getDefaultValue(); + private _validate(); + private _validateBoolean(); + private _validateGuid(); + private _validateNumber(); + private _validateString(); + private _validateUri(); +} +} +declare module "VSS/Controls/Grids" { +import Controls = require("VSS/Controls"); +import Menus = require("VSS/Controls/Menus"); +import Search = require("VSS/Search"); +/** + * @publicapi + */ +export interface IGridOptions { + /** + * Data source of the grid. It can be array of arrays ([[], [], [], ...]), array of objects ([{}, {}, {}, ...]) + * @defaultvalue "[]" + */ + source?: any; + /** + * Specifies the expand states of each item in the source. If an item has a total of n descendants; -n makes the item collapsed, n makes the item expanded, 0 means no children and descendants. + */ + expandStates?: number[]; + /** + * Determines whether the header is displayed or not + * @defaultvalue true + */ + header?: boolean; + /** + * Height of the grid in px or % + */ + height?: string; + /** + * Width of the grid in px or % + */ + width?: string; + /** + * Determines whether multiple selection is allowed or not + * @defaultvalue true + */ + allowMultiSelect?: boolean; + /** + * Determines whether moving columns is allowed or not + * @defaultvalue true + */ + allowMoveColumns?: boolean; + /** + * Determines whether selecting text is allowed or not + * @defaultvalue false + */ + allowTextSelection?: boolean; + /** + * Determines whether the last cell should fill remaining content (if exists) + * @defaultvalue false + */ + lastCellFillsRemainingContent?: boolean; + /** + * List of columns to be displayed in the grid + * @defaultvalue "[]" + */ + columns?: IGridColumn[]; + /** + * Options about the gutter. If specified false, gutter will be invisible + * @defaultvalue false + */ + gutter?: IGridGutterOptions; + /** + * Options about the context menu displayed when gutter clicked + */ + contextMenu?: IGridContextMenu; + /** + * Initial sort info for the grid + * @defaultvalue "[]" + */ + sortOrder?: IGridSortOrder[]; + /** + * Specifies whether grid should be sorted initially using the sortOrder option + * @defaultvalue true + */ + autoSort?: boolean; + asyncInit?: boolean; + initialSelection?: boolean; + sharedMeasurements?: boolean; + payloadSize?: number; + extendViewportBy?: number; + coreCssClass?: string; + draggable?: any; + droppable?: any; + sort?: Function; + enabledEvents?: any; + openRowDetail?: any; + suppressRedraw?: boolean; + keepSelection?: boolean; + /** + * @privateapi + * Type of the formatter which is used for retrieving the content from the grid + * Used in beginTableFormat, called when triggering a copy action + */ + formatterType?: new (grid: GridO, options?: any) => ITableFormatter; +} +export interface IGridContextMenu { + /** + * Menu items to be shown when gutter clicked. Value can be a list of menu items or a function which returns an a list of menu items + */ + items?: any; + /** + * Execute action for the popup menu + */ + executeAction?: (args: any) => any; + contributionIds?: string[]; +} +export interface IGridGutterOptions { + /** + * Determines whether a context menu is show in the gutter or not + * @defaultValue false + */ + contextMenu?: boolean; + checkbox?: boolean; + icon?: IGridGutterIconOptions; +} +export interface IGridGutterIconOptions { + /** + * String or number value to get the icon value from source item corresponding to current row + */ + index?: any; + /** + * String or number value to get the icon tooltip value from source item corresponding to current row + */ + tooltipIndex?: any; +} +export interface IGridColumn { + /** + * Index of the column which can be either number or string. If number specified, each item of the data source is expected to be an array. Then array[index] is displayed in the column. If string specified, each item if the data source is expected to be an object. Then object[index] is displayed in the column. + * @defaultvalue "index in the columns array" + */ + index?: any; + /** + * Name of the column used for identification purposes + */ + name?: string; + /** + * Determines whether moving this column is enabled or not + * @defaultvalue true + */ + canSortBy?: boolean; + /** + * Determines whether sorting this column is enabled or not + * @defaultvalue true + */ + canMove?: boolean; + /** + * Width of the column in pixels + * @defaultvalue 100 + */ + width?: number; + /** + * Css class to be added to the header cell + */ + headerCss?: string; + /** + * Css class to be added to the cells under this column + */ + rowCss?: string; + /** + * Display text of the column + * @defaultvalue "" + */ + text?: string; + /** + * Tooltip text of the column + * @defaultvalue "" + */ + tooltip?: string; + /** + * Specifies how ordering should be performed ("asc" or "desc") + * @defaultvalue "asc" + */ + order?: string; + /** + * Determines whether the column should be hidden or not + * @defaultvalue false + */ + hidden?: boolean; + /** + * Determines whether column moving effects this column or not + * @defaultvalue false + */ + fixed?: boolean; + /** + * If the value of cell is Date, format is used (like 'mm/dd/yyyy') + */ + format?: string; + hrefIndex?: number; + indentOffset?: number; + indent?: boolean; + maxLength?: number; + fieldId?: any; + comparer?: (column: IGridColumn, order: number, rowA: any, rowB: any) => number; + isSearchable?: boolean; + getCellContents?: (rowInfo: any, dataIndex: number, expandedState: number, level: number, column: any, indentIndex: number, columnOrder: number) => void; + getHeaderCellContents?: (IGridColumn) => JQuery; + getColumnValue?: (dataIndex: number, columnIndex: number | string, columnOrder?: number) => any; +} +export interface IGridSortOrder { + /** + * Refers to column index + */ + index: any; + /** + * Determines whether to sort ascending (default) or descending + * @defaultvalue "asc" + */ + order?: string; +} +export interface IGridRowInfo { + dataIndex?: number; + rowIndex?: number; + row?: JQuery; + dirty?: boolean; + gutterRow?: any; +} +/** + * Base item for a grid source (represents a row) + */ +export interface IGridSourceItem { +} +/** + * Contract for the grid source. + * Implementers should return source and expandStates arrays. + */ +export interface IGridSource { + /** + * Grid to update the source + */ + grid: Grid; + /** + * Gets the source which can be consumed by the grid + */ + getSource(): any[]; + /** + * Gets the expand states of the source + */ + getExpandStates(): number[]; + /** + * Updates the source of the grid + */ + update(items: IGridSourceItem[]): any; +} +/** + * Default datasource implementation for the grid. It can be used for a flat list. + */ +export class GridDefaultSource implements IGridSource { + grid: Grid; + protected _source: any[]; + constructor(items: IGridSourceItem[]); + update(items: IGridSourceItem[]): void; + getSource(): any[]; + getExpandStates(): number[]; + protected _updateSource(items: IGridSourceItem[]): void; +} +/** + * Item contract for a hierarchical data source. + * It can either have its own properties to be shown in the grid or values array can be used. + * If values used, column.index should correspond to the index in the values. + */ +export interface IGridHierarchyItem extends IGridSourceItem { + /** + * Values to be used by grid to display grid content. index: number should be used for columns if values are used. + */ + values?: any[]; + /** + * Children of this item + */ + children?: IGridHierarchyItem[]; + /** + * Determines whether this item should be displayed collapsed or not + */ + collapsed?: boolean; +} +/** + * Hierarchical datasource implementation. + */ +export class GridHierarchySource extends GridDefaultSource implements IGridSource { + private _expandStates; + constructor(items: IGridHierarchyItem[]); + getExpandStates(): any[]; + protected _updateSource(items: IGridHierarchyItem[]): void; + private _prepareItems(items); +} +/** + * @publicapi + */ +export class GridO extends Controls.Control { + static enhancementTypeName: string; + static MAX_COPY_SIZE: number; + static PAYLOAD_SIZE: number; + static EVENT_ROW_UPDATED: string; + static EVENT_ROW_TOGGLED: string; + static EVENT_SELECTED_INDEX_CHANGED: string; + static DATA_DRAGGING_ROWINFO: string; + static DATA_DROPPING_ROWINFO: string; + private _selectionStart; + private _header; + private _gutterHeader; + private _columnSizing; + private _columnMoving; + private _columnMovingElement; + private _columnMovingPinElement; + private _columnInsert; + private _unitEx; + private _sizingElement; + private _ddRowAcceptStatus; + private _ddRowOverStatus; + private _ddDropStarted; + private _activeAriaId; + private _copyInProgress; + private _previousCanvasHeight; + private _previousCanvasWidth; + /** + * Offset height, that shifts the row boundaries up and determines whether the pointer is over a particular row or not + * e.g. An offset percentage (passed in by the consumer of the grid) of 50 shifts each row boundary up half the row height for the purposes of calculating whether the mouse + * pointer is over the current row or not. The net effect of this is, if the pointer is in the top half of the current row/bottom half of the previous row, + * then the pointer is assumed to interesect with the current row. + */ + private _rowOffsetHeight; + private _isAboveFirstOrBelowLastRow; + _contentSpacer: any; + _dataSource: any[]; + _expandStates: any; + _indentLevels: any; + _columns: IGridColumn[]; + _sortOrder: any[]; + _visibleRange: any[]; + _count: number; + _expandedCount: number; + _selectedIndex: number; + _indentIndex: number; + _selectionCount: number; + _selectedRows: any; + _rowHeight: number; + _cellOffset: number; + _gutterWidth: number; + _contentSize: any; + _rows: any; + _focus: JQuery; + _scroller: any; + _canvasDroppable: any; + _canvas: any; + _canvasHeight: number; + _canvasWidth: number; + _headerCanvas: any; + _gutter: any; + _popupMenu: any; + _resetScroll: boolean; + _ignoreScroll: boolean; + _scrollTop: number; + _scrollLeft: number; + _droppable: any; + _draggable: any; + _draggingRowInfo: any; + _cancelable: any; + _active: boolean; + _cellMinWidth: number; + private _draggableOverGrid; + /** + * Creates new Grid Control + * + * @param options The initialization options for the grid which have the following properties + * + * "columns" is a required property containing the array of grid column descriptors that have the following structure: + * { + * index: The index for the + * text: column header text, string, optional, default: "", + * width: width in pixels of the column, number, optional, default: 100, + * canSortBy: true if the grid can be sorted by the column, boolean, optional, default: true + * canMove: true if this column can be moved (has effect only if allowMoveColumns is set to true for the grid as well), boolean, optional, default: true + * getCellContents: function that returns cell contents, function, optional, default: this._drawCell + * The function takes the same parameters as _drawCell and should return a jQuery object + * that represents the cell's contents. The first element will be appended to the row. + * If the function returns null or undefined nothing will be appended for that cell. + * getHeaderCellContents: function that returns column header cell contents, function, optional, default: this._drawHeaderCellValue + * The function takes the same parameters as _drawHeaderCellValue and should return a jQuery object + * that represents the cell's contents. The first element will be appended to the header cell's contents. + * If the function returns null or undefined nothing will be appended for that header cell. + * getColumnValue: function that returns the value for a cell contents, function, optional, default: this.getColumnValue; + * The return value of the function will be converted to a string an added as the cell contents. + * } + * "enabledEvents" is an optional property containing an object with properties for each of the enabled events. + * { + * GridO.EVENT_ROW_UPDATED: true + * } + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * Gets the number of selected items. + * @returns {number} + * @publicapi + */ + getSelectionCount(): number; + /** + * @param element + */ + _enhance(element: JQuery): void; + initialize(): void; + /** + * Gets the row information for the item currently being dragged. + * + * @return + */ + getDraggingRowInfo(): any; + /** + * Get the rows that currently have a draggable item "over" them + */ + _getDragOverRows(): any; + _getAcceptStatus(dataIndex: number): any; + /** + * Clear the cached row acceptance map + */ + _resetRowAcceptStatus(): void; + /** + * See if the row has accepted and activate if it has. + */ + _rowDropTryActivate(droppingRowInfo: any, e?: any, ui?: any): any; + _rowIntersect(draggable: any, targetRowInfo: any): any; + initializeDataSource(suppressRedraw?: boolean): void; + /** + * Sets the source of the grid using GridSource object. + * + * @param source GridSource object to set the grid source. + * @publicapi + */ + setDataSource(source: IGridSource): void; + /** + * Sets the data source, expands states, columns and sort order of the grid. + * + * @param source New source for the grid (See grid options for details). + * @param expandStates Expand states for the new source. If source is not in hierarchical structure, specify null (See grid options for details). + * @param columns New columns for the grid (See grid options for details). + * @param sortOrder New sort order for the grid (See grid options for details). + * @param selectedIndex Index of the rows to be selected after new data source is set. + * @param suppressRedraw If true, grid is not redrawn after data source is set. + * @publicapi + */ + setDataSource(source?: any[], expandStates?: any[], columns?: IGridColumn[], sortOrder?: IGridSortOrder[], selectedIndex?: number, suppressRedraw?: boolean): any; + _setColumnInfo(column: IGridColumn, index: number): void; + /** + * Gets the information about a row associated with the given data index. + * + * Returns a rowInfo object containing rowIndex, dataIndex and a jQuery wrapper for the actual row. + * + * @param dataIndex The data index for the record to retrieve. + * @returns {IGridRowInfo} + * @publicapi + */ + getRowInfo(dataIndex: number): IGridRowInfo; + /** + * Gets the data being used to display the row at the provided data index. + * + * @param dataIndex The data index for the record to retrieve. + * @return {any} + * @publicapi + */ + getRowData(dataIndex: number): any; + /** + * Gets the columns currently being displayed in the grid. + * @returns {IGridColumn[]} + * @publicapi + */ + getColumns(): IGridColumn[]; + /** + * Gets the current sort order being used in the grid. + * @returns {IGridSortOrder[]} + * @publicapi + */ + getSortOrder(): IGridSortOrder[]; + /** + * Set new column info for the column associated with the specified column name. + * + * @param columnName Name of the column to change the options. + * @param options New column options. + * @publicapi + */ + setColumnOptions(columnName: string, options?: IGridColumn): void; + _getDataIndex(visibleIndex: any): any; + _getRowIndex(dataIndex: any): number; + expandNode(dataIndex: any): void; + collapseNode(dataIndex: any): void; + expandAllNodes(): boolean; + collapseAllNodes(): boolean; + expandAll(): void; + collapseAll(): void; + /** + * Expand or collapse node(s), and set selection focus at a given target index or at the current selected index as default behavior. + * + * @param expand If true, expands the node, otherwise collapsed. + * @param applyToAllRows True to expand or collapse all nodes, false to expand or collapse the node at a given target index, or at the current selected index as default behavior. + * @param targetIndex The node index to be expanded or collapsed, and get selection focus. + * @returns {boolean} + * @publicapi + */ + tryToggle(expand: boolean, applyToAllRows: boolean, targetIndex?: number): boolean; + _getVisibleRowIndices(): { + first: number; + last: number; + }; + /** + * @param rowIndex + * @param force + * @return + */ + _getRowIntoView(rowIndex: number, force?: boolean): boolean; + /** + * @param force + */ + getSelectedRowIntoView(force?: boolean): boolean; + cacheRows(aboveRange: any, visibleRange: any, belowRange: any): void; + _drawRowsInternal(visibleRange: any, includeNonDirtyRows: any): { + rowsFragment: any; + gutterFragment: any; + }; + _drawRows(visibleRange: any, includeNonDirtyRows: any): void; + /** + * Updates the row identified by the given rowIndex. + * + * @param rowIndex Index of row to be updated + * @param dataIndex DataIndex of row to be updated + * @param columnsToUpdate HashSet of column indices. If given, + * only columns in this set will be updated. + */ + updateRow(rowIndex: number, dataIndex?: number, columnsToUpdate?: { + [id: number]: boolean; + }): void; + _updateRow(rowInfo: any, rowIndex: any, dataIndex: any, expandedState: any, level: any, columnsToUpdate?: { + [id: number]: boolean; + }): void; + /** + * Updates the container element for the row identified by rowIndex + * + * @param rowIndex Index of row to be updated + * @param keepContent If set, the content of the container element (i.e., + * any column data) will not be removed + * @return Returns DOM row container element + */ + _updateRowSize(rowIndex: number, row: any, keepContent?: boolean): any; + /** + * Default implementation for creating the contents of a given cell. + * + * Custom Drawn Columns: + * If you want a custom drawn column, then the preferred method is to set a "getCellContents" property + * on the column to a function that takes the same parameters as this function and returns a jQuery + * object that represents the contents. + * + * @param rowInfo The information about grid row that is being rendered. + * @param dataIndex The index of the row. + * @param expandedState Number of children in the tree under this row recursively. + * @param level The hierarchy level of the row. + * @param column Information about the column that is being rendered. + * @param indentIndex Index of the column that is used for the indentation. + * @param columnOrder The display order of the column. + * @return Returns jQuery element representing the requested grid cell. The first returned element will be appended + * to the row (unless the function returns null or undefined). + */ + _drawCell(rowInfo: any, dataIndex: number, expandedState: number, level: number, column: any, indentIndex: number, columnOrder: number): any; + /** + * Default implementation for creating the element that represents content of a header cell. + * + * Custom Drawn Column Header: + * If you want a custom drawn column header, then the preferred method is to set a "getHeaderCellContents" property + * on the column to a function that takes the same parameters as this function and returns a jQuery + * object that represents the contents. + * + * @param column Information about the header column that is being rendered. + * @return Returns jQuery element representing the requested header cell contents. + */ + _drawHeaderCellValue(column: any): JQuery; + _layoutHeader(): void; + layout(): void; + redraw(): void; + /** + * Gets the value for a column. The default use of the return value is to + * convert it to a string and set it as the cell's text value. + * + * @param dataIndex The index for the row data in the data source + * @param columnIndex The index of the column's data in the row's data array + * @param columnOrder The index of the column in the grid's column array. This is the current visible order of the column + * @return + */ + getColumnValue(dataIndex: number, columnIndex: number | string, columnOrder?: number): any; + getColumnText(dataIndex: any, column: any, columnOrder?: any): any; + _getExpandState(dataIndex: any): number; + /** + * @param rowIndex + * @param dataIndex + * @param options + */ + _selectRow(rowIndex: number, dataIndex?: number, options?: any): void; + /** + * @return + */ + getSelectedRowIndex(): number; + setSelectedRowIndex(selectedRowIndex: any): void; + /** + * @return + */ + getSelectedDataIndex(): number; + /** + * @return The last data index of the grid + */ + getLastRowDataIndex(): number; + /** + * @return + */ + getSelectedDataIndices(): number[]; + /** + * Ensures that an item (identified by a data index) has an associated row by + * expanding any enclosing collapsed rows. Returns the rowIndex of the associated row. + * + * @param dataIndex The data index of the item to ensure is expanded + * @return + */ + ensureDataIndexExpanded(dataIndex: number): number; + /** + * Sets the selected item in the grid by the data index. + * Optionally ensure that the item is not hidden by collapsed rows. + * + * @param dataIndex The data index of item to show + * @param expandNodes If true, all containing collapsed nodes will be expanded + */ + setSelectedDataIndex(dataIndex: number, expandNodes?: boolean): void; + selectionChanged(selectedIndex: any, selectedCount: any, selectedRows: any): void; + selectedIndexChanged(selectedRowIndex: any, selectedDataIndex: any): void; + _updateRowSelectionStyle(rowInfo: any, selectedRows: any, focusIndex: any): void; + /** + * @param timeout + */ + focus(timeout?: number): void; + /** + * Gets info about the row on which context menu is opened. + * + * If no context menu is open, returns null. + * + * @returns {IGridRowInfo} + * @publicapi + */ + getContextMenuRowInfo(): IGridRowInfo; + /** + * Creates the context menu options. This function is intended to be overriden by derived objects. + * + * @param rowInfo The information about the row with context + * @param menuOptions The menu information. See _createContextPopupMenuControl + * @return + */ + _createContextMenu(rowInfo: any, menuOptions: any): Menus.PopupMenu; + /** + * Creates the PopupMenu control that houses the context menu items for the Grid. Note: this is intentionally + * abstracted from _createContextMenu to allow directly calling it from deep derivations and avoiding inheritance + * base propagation. + * + * @param menuOptions + * The menu information: + * { + * contextInfo: { item, rowInfo} + * items: the list of menu items + * } + * + * @return + */ + _createContextPopupMenuControl(menuOptions: any): Menus.PopupMenu; + /** + * @param e + * @return + */ + _onContainerResize(e?: JQueryEventObject): any; + /** + * @return + */ + _onColumnResize(column: any): any; + /** + * @return + */ + _onColumnMove(sourceIndex: any, targetIndex: any): any; + /** + * @param column + * @param add + */ + _sortBy(column?: any, add?: boolean): void; + /** + * @param sortOrder + * @param sortColumns + * @return + */ + onSort(sortOrder: any, sortColumns?: any): any; + /** + * @param sortOrder + * @param sortColumns + * @return + */ + _trySorting(sortOrder: any, sortColumns?: any): any; + /** + * @param e + * @param selector + */ + _getRowInfoFromEvent(e?: JQueryEventObject, selector?: string): any; + /** + * Handles the row mouse down event + * @param e + * @return + */ + _onRowMouseDown(e?: JQueryEventObject): any; + /** + * @return + */ + onRowMouseDown(eventArgs: any): any; + /** + * Handles the row mouse up event + * @param e + * @return + */ + _onRowMouseUp(e?: JQueryEventObject): any; + /** + * @param eventArgs + * @return + */ + onRowMouseUp(eventArgs: JQueryEventObject): any; + /** + * @return + */ + onRowClick(eventArgs: any): any; + /** + * @return + */ + onRowDoubleClick(eventArgs: any): any; + /** + * @return + */ + onGutterClick(eventArgs: any): any; + /** + * @return + */ + onEnterKey(eventArgs: any): any; + /** + * @return + */ + onDeleteKey(eventArgs: any): any; + _onOpenRowDetail(e?: any, eventArgs?: any): boolean; + /** + * @return + */ + onOpenRowDetail(eventArgs: any): any; + /** + * @return + */ + onContextMenu(eventArgs: any): any; + /** + * @param e + * @return + */ + _onBlur(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + _onFocus(e?: JQueryEventObject): any; + _onKeyPress(e?: JQueryKeyEventObject): any; + /** + * @param e + * @return + */ + _onKeyDown(e?: JQueryKeyEventObject): any; + _onBackSpaceKey(e?: JQueryKeyEventObject): void; + _onUpKey(e?: JQueryKeyEventObject, bounds?: any): void; + _onDownKey(e?: JQueryKeyEventObject, bounds?: any): void; + _onRightKey(e?: JQueryKeyEventObject): void; + _onLeftKey(e?: JQueryKeyEventObject): void; + _onPageUpPageDownKey(e?: JQueryKeyEventObject, bounds?: any): void; + _getRowsPerPage(e?: BaseJQueryEventObject): number; + _onHomeKey(e?: JQueryKeyEventObject, bounds?: any): void; + _onEndKey(e?: JQueryKeyEventObject, bounds?: any): void; + _onTabKey(e?: JQueryKeyEventObject): void; + _onEscapeKey(e?: JQueryKeyEventObject): void; + /** + * @param e + * @return + */ + _onKeyUp(e?: JQueryKeyEventObject): any; + /** + * Enables raising the custom event with the provided event name. + * + * @param eventName Name of the event to enable. + */ + enableEvent(eventName: string): void; + /** + * Disables raising the custom event with the provided event name. + * + * @param eventName Name of the event to disable. + */ + disableEvent(eventName: string): void; + /** + * Gets the collection of expand states for the grid. + */ + getExpandStates(): any; + /** + * Generates a table of the selected items in the grid. + * + * @param operationCompleteCallback A callback function invoked when the + * current selection is available to the client for processing. + * @param errorCallback + */ + beginFormatTable(operationCompleteCallback: IResultCallback, errorCallback?: IErrorCallback, formatterType?: new (grid: GridO, options?: any) => ITableFormatter, options?: any): void; + _createElement(): void; + protected _addSpacingElements(): void; + _createFocusElement(): JQuery; + private _buildDom(); + _shouldAttachContextMenuEvents(): boolean; + _attachEvents(): void; + _getDraggedRowsInfo(e?: JQueryEventObject): any; + private _setupDragDrop(); + /** + * Setup the provided draggable and droppable options + */ + setupDragDrop(draggableOptions: any, droppableOptions: any): void; + disableDragDrop(): void; + enableDragDrop(): void; + /** + * Delegate out to the row accept handlers to determine if the dragging item will be accepted. + */ + private _droppableAcceptHandler($element, draggingRowInfo); + private _droppableDropHandler(e, ui); + /** + * Called when an item is being dragged that will be accepted by rows in this grid. + */ + private _droppableActivateHandler(e, ui); + /** + * Called when an item stops being dragged that will be accepted by rows in this grid. + */ + private _droppableDeactivateHandler(e, ui); + /** + * Called when a draggable item is over the grid. + */ + private _droppableOverHandler(e, ui); + /** + * Called when a draggable item is no longer over the grid. + */ + private _droppableOutHandler(e, ui); + /** + * Called when the mouse moves while the draggable item is over the grid. + * + * @param outOfGrid Indicates if this move event is being triggered as the mouse is leaving the grid. + */ + private _droppableOverMoveHandler(e, ui); + /** + * Gets the draggable instance from the element which is being dragged. + */ + private _getDraggable($draggedElement); + /** + * Clean up all state stored during drag/drop operations. + */ + private _cleanupDragDropState(); + /** + * Unregister the mouse move event which is setup during drag/drop operations. + */ + private _unregisterDragMouseMove(); + /** + * Clear the record of which rows the draggable objects are "over" + */ + private _resetRowOverStatus(); + private _rowDropAccept(droppingRowInfo, $element); + private _rowDropActivate(droppingRowInfo, e?, ui?); + private _rowDropDeactivate(droppingRowInfo, e?, ui?); + private _rowDropOver(droppingRowInfo, e?, ui?); + private _rowDropOut(droppingRowInfo, e?, ui?); + private _rowDrop(droppingRowInfo, draggingRowInfo, e?, ui?); + private _rowDragCreateHelper(draggingRowInfo, e?, ui?); + /** + * Invokes the provided handler + */ + private _invokeDragHandler(e, ui, handlerCallback); + private _takeMeasurements(); + /** + * Ensures that the selected index is correctly set. That is, it will be a noop if the index doesnt change + * and will handle indexes that are out of bounds. + * + * @param index OPTIONAL: The index to select + */ + private _ensureSelectedIndex(index?); + _determineIndentIndex(): void; + private _updateRanges(); + private _updateExpansionStateAndRedraw(action); + /** + * @param includeNonDirtyRows + */ + _updateViewport(includeNonDirtyRows?: boolean): void; + _cleanUpRows(): void; + private _getGutterIconClass(rowIndex, dataIndex, expandedState, level); + private _drawGutterCell(rowInfo, rowIndex, dataIndex, expandedState, level); + _drawHeader(): void; + private _fixColumnsWidth(width); + _layoutContentSpacer(): void; + _fixScrollPos(): void; + /** + * @param includeNonDirtyRows + */ + _redraw(includeNonDirtyRows?: boolean): void; + selectAll(): void; + /** + * Clear the selected rows & selection count, but maintain the selected index. + */ + _clearSelection(): void; + /** + * Highlights the row at the specified rowIndex + * + * @param rowIndex Index of the row in the visible source (taking the expand/collapse states into account) + * @param dataIndex Index of the row in the overall source + * @param options Specifies options such as: + * - keepSelectionStart: Keepd the rowIndex as the basis for range selection + * - doNotFireEvent: Prevents firing events + * - toggle: Toggles the row in the selection + */ + _addSelection(rowIndex: number, dataIndex?: number, options?: any): void; + /** + * Highlights the rows beginning from the selection start until the row at the specified rowIndex + * + * @param rowIndex Index of the row in the visible source (taking the expand/collapse states into account) + * @param dataIndex Index of the row in the overall source + */ + private _addSelectionRange(rowIndex, dataIndex?, options?); + /** + * This is especially necessary for screen readers to read each + * row when the selection changes. + */ + private _updateAriaAttribute(); + private _updateSelectionStyles(); + private _selectionChanged(); + private _selectedIndexChanged(selectedRowIndex, selectedDataIndex); + _showContextMenu(eventArgs: any): void; + getPinAndFocusElementForContextMenu(eventArgs: any): { + pinElement: JQuery; + focusElement: JQuery; + }; + /** + * @param e + * @return + */ + _onContainerMouseDown(e?: JQueryEventObject): any; + _measureCanvasSize(): void; + private _setupDragEvents(); + private _clearDragEvents(); + /** + * @param e + * @return + */ + private _onDocumentMouseMove(e?); + /** + * @param e + * @return + */ + private _onDocumentMouseUp(e?); + /** + * @param e + * @return + */ + private _onHeaderMouseDown(e?); + /** + * @param e + * @return + */ + private _onHeaderMouseUp(e?); + /** + * @param e + * @return + */ + _onHeaderClick(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + _onHeaderDblClick(e?: JQueryEventObject): any; + private _moveSizingElement(columnIndex); + /** + * Given a column index will provide the visible index of this column. That is, it will take in to consideration any + * hidden columns and omit them from the index count. + * + * @param columnIndex The 0-based global column index + * @return The 0-based visible column index + */ + private _getVisibleColumnIndex(columnIndex); + /** + * @param columnIndex + * @param initialWidth + * @param finish + */ + _applyColumnSizing(columnIndex: number, initialWidth?: number, finish?: boolean): void; + _tryFinishColumnSizing(cancel: any): void; + /** + * @param columnIndex + * @param left + */ + private _moveColumnMovingElement(columnIndex, left?); + private _applyColumnMoving(sourceIndex, targetIndex); + private _tryFinishColumnMoving(cancel); + _getSortColumns(sortOrder: any): any[]; + /** + * @param sortOrder + * @param sortColumns + * @return + */ + private _onSort(sortOrder, sortColumns?); + /** + * @param e + * @return + */ + _onSelectStart(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + _onCanvasScroll(e?: JQueryEventObject): any; + /** + * @param e + * @param handler + * @param eventName + * @param args + */ + private _handleEvent(e?, handler?, eventName?, args?); + /** + * @param e + * @return + */ + _onRowClick(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + _onRowDoubleClick(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + private _onGutterClick(e?); + /** + * @param e + * @return + */ + _onEnterKey(e?: JQueryKeyEventObject, bounds?: any): any; + /** + * @param e + * @return + */ + _onDeleteKey(e?: JQueryKeyEventObject): any; + /** + * @param e + * @return + */ + private _onContextMenu(e?, args?); + /** + * @return + */ + private _onToggle(rowInfo); + private _isAncestorFolderToggled(rowInfo); + ancestorFolderToggled(rowInfo: any): void; + nonAncestorFolderToggled(rowInfo: any, currSelectedDataIndex: any): void; + afterOnToggle(rowInfo: any): void; + private _folderToggled(rowInfo); + private _raiseToggleEvent(rowInfo, isExpanded); + copySelectedItems(formatterType?: new (grid: GridO, options?: any) => ITableFormatter, copyAsHtml?: boolean, options?: any): void; + _ensureRowDrawn(dataIndex: any): boolean; + /** + * Ensures that all data objects in the selection have been downloaded and are available to process. + * + * @param itemsAvailableCallback + * @param errorCallback + */ + _beginEnsureSelectionIsAvailable(itemsAvailableCallback?: IResultCallback, errorCallback?: IErrorCallback): void; + _dispose(): void; +} +export class Grid extends GridO { +} +export class ListView extends Grid { + static enhancementTypeName: string; + constructor(options?: any); +} +export class GridSearchAdapter extends Search.SearchAdapter { + private _grid; + private _gridData; + private _results; + private _searchableColumns; + constructor(); + /** + * Attaches the Grid to the filter provider to allow for retrieval of paged data. + * The grid is loaded asynchronously, so can't be attached on page load when initialized. + * + * @param grid The grid to get data from + */ + attachGrid(grid: Grid): void; + /** + * Adds additional items to the search strategy + * + * @param addItemsCallback The function which adds items to the search strategy. + * @param searchCallback The function which searches the newly updated strategy. + */ + addMoreItems(addItemsCallback: Function, searchCallback: () => any): void; + /** + * Creates SearchableObjects for all available work items + * + * @return An array of SearchableObjects. + */ + createSearchableObjects(): any[]; + /** + * Creates the SearchableObject for a row in the grid. + * + * @param dataIndex The data index for the item in the grid. + * @return The SearchableObject representing the row in the grid. + */ + private _createSearchableObject(dataIndex); + /** + * Handles the results in the UI by filtering through all available items to the ones + * provided in the results array. + * + * @param results An array of items + * @param finished Represents whether or not the search is finished + */ + handleResults(results: any[], finished: boolean): void; + /** + * Handles an error being thrown in the search process. + * + * @param message Specific error message if provided. + */ + handleError(message: string): void; + /** + * Handles the search results being cleared and the view resetting to normal. + */ + handleClear(): void; + /** + * Returns whether or not there is more data to be loaded. + * + * @return True if no more data needs to be loaded, false otherwise + */ + isDataSetComplete(): boolean; + /** + * Build the list of searchable columns. + */ + private getSearchableColumns(); +} +export interface ITableFormatter { + getTableFromSelectedItems(): string; +} +export class TabDelimitedTableFormatter implements ITableFormatter { + _options: any; + _grid: Grid; + constructor(grid: Grid, options?: any); + /** + * Iterates through the selected rows and builds a table containing the results. + * + * @return A tab-delimited plain-text table containing all rows and all columns in the current selection. + */ + getTableFromSelectedItems(): string; + getFormattedColumnValue(column: any, value: string): string; +} +export class HtmlTableFormatter implements ITableFormatter { + private static HEADER_BACKGROUND_COLOR; + private static HEADER_COLOR; + private static FONT_SIZE; + private static FONT_FAMILY; + private static BORDER_COLLAPSE; + private static COLUMN_BORDER; + private static COLUMN_VERTICAL_ALIGN; + private static COLUMN_PADDING; + private static ROW_BACKGROUND_COLOR; + private static ROW_ALT_BACKGROUND_COLOR; + _options: any; + _grid: Grid; + constructor(grid: Grid, options?: any); + processColumns(columns: any[]): any[]; + getTableFromSelectedItems(): string; + getFormattedColumnValue(column: any, value: string): string; + protected _getSelectedDataIndicesFromGrid(): number[]; + /** + * Iterates through the selected rows and builds a HTML table containing the results. + * + * @return A HTML table containing all rows and all columns in the current selection. + */ + _getJQTableFromSelectedItems(): JQuery; +} +} +declare module "VSS/Controls/Histogram" { +import Controls = require("VSS/Controls"); +export interface HistogramBarData { + /** + * Value of the bar. + */ + value?: number; + /** + * Text value displayed when the bar is hovered. + */ + title?: string; + /** + * State of the bar which effects vizualization. + */ + state?: string; + /** + * Specifies whether the bar is selected or not. + */ + selected?: boolean; + /** + * Action of this bar. + */ + action?: Function; + /** + * Action arguments. + */ + actionArgs?: any; +} +export interface IHistogramOptions extends Controls.EnhancementOptions { + /** + * List of bars to display in the histogram. + */ + bars?: HistogramBarData[]; + /** + * A generator function to return a list of bars to display in the histogram. + */ + barGenerator?: () => HistogramBarData[]; + /** + * Determines whether to render default bars before actual bar data loaded. + */ + renderDefaultBars?: boolean; + /** + * Number of bars to display. + */ + barCount?: number; + /** + * Width of a bar in px. + */ + barWidth?: number; + /** + * Height of a bar in px. + */ + barHeight?: number; + /** + * Space between the bars in px. + */ + barSpacing?: number; + /** + * Hover state. + */ + hoverState?: string; + /** + * Selected state. + */ + selectedState?: string; + /** + * Determines whether the interaction is allowed or not. + */ + allowInteraction?: boolean; +} +export class HistogramO extends Controls.Control { + constructor(options?: any); + initialize(): void; + refresh(items: HistogramBarData[]): void; + _clearBars(): void; + _getBarCount(): number; + private _getBarWidth(); + private _getBarSpacing(); + private _getBarMaxHeight(); + private _load(items); + private _decorate(); + private _renderDefaultBars(); + private _renderBars(items); + /** + * @param index + * @param item + * @return + */ + private _createBar(index, item?); +} +export class Histogram extends HistogramO { +} +} +declare module "VSS/Controls/Hubs" { +import Controls = require("VSS/Controls"); +/** +* Info for the hubs and hub groups applicable for a given context +*/ +export interface HubsContext { + HubGroupsCollectionContributionId: string; + selectedHubGroupId: string; + hubGroups: HubGroup[]; + hubs: Hub[]; +} +/** +* Represents a hub group - the first level of navigation +*/ +export interface HubGroup { + id: string; + name: string; + uri: string; + order: number; + hasHubs: boolean; +} +/** +* Represents a hub - the second level of navigation +*/ +export interface Hub { + id: string; + name: string; + groupId: string; + uri: string; + order: number; + isSelected: boolean; +} +/** +* Class to manage fetching hub context +*/ +export module HubsContextManager { + /** + * Get the hub context information from the current page + */ + function getHubsContext(): HubsContext; + function getDefaultHubNavigationView(): HubNavigationView; + function addHub(hub: Hub): void; + function addHubGroup(hubGroup: HubGroup): void; + function getSelectedHub(): IPromise; +} +/** +* Control that renders the hubs/navigation area at the top of a page +*/ +export class HubNavigationView extends Controls.BaseControl { + static MAIN_NAVIGATION_HUB_SELECTOR: string; + private _$hubgroupSection; + private _$hubgroupContainer; + private _$hubContainer; + private _$hubSection; + private _hubGroupsInitialized; + private _hubsInitialized; + private _selectedHubGroupSet; + initialize(): void; + private _setHubGroupUris(hub?); + private _decorate(); + updateHubGroupLink(groupId: string, newUrl: string, clickHandler?: (eventObject: JQueryEventObject) => any): void; + private _drawHubGroups(); + private _drawHubs(); + private _findHubGroup(id); + private _doesHubGroupExist(id); + private _doesHubExist(id); +} +export class ExternalHub extends Controls.BaseControl { + private static PROGRESS_LOAD_DELAY; + initialize(): void; + private createHost(contribution); + private beginGetHubContentUri(contribution); +} +} +declare module "VSS/Controls/KeyboardShortcuts" { +import Dialogs = require("VSS/Controls/Dialogs"); +export interface IShortcutGroup { + /** + * The name of the group + */ + name: string; + /** + * The list of shortcuts in the group + */ + shortcuts: IShortcut[]; +} +export interface IShortcut { + /** + * Shortcut combinations that map to this action + */ + combos: string[]; + /** + * Description of this shortcut + */ + description: string; + /** + * Action to invoke for this shortcut + */ + action: Function; +} +/** +* ShortcutManager handles registering multiple groups of keyboard shortcuts +*/ +export interface IShortcutManager { + /** + * Gets the shortcut groups + */ + getShortcutGroups(): IShortcutGroup[]; + /** + * Register a group of shortcuts + * @param group Name of a shortcut group. + * @param combo Keyboard combination. + * @param description Description of the shortcut + * @param action Action which gets called when shortcut is pressed + * + * @returns ShortcutManager + */ + registerShortcut(group: string, combo: string, description: string, action: Function): IShortcutManager; + /** + * Register a group of shortcuts + * @param group Name of a shortcut group. + * @param combos Keyboard combinations that all map to same action. + * @param description Description of the shortcut + * @param action Action which gets called when shortcut is pressed + * + * @returns ShortcutManager + */ + registerShortcuts(group: string, combos: string[], description: string, action: Function): IShortcutManager; + /** + * Removes a group of shortcuts + * This is used when a group of shortcuts is no longer applicable and you want to de-register them. For example, + * if you had a ajax popup that needed its own shortcuts but you want to clear those when it is closed. + * @param group Name of a shortcut group. + */ + removeShortcutGroup(group: string): any; + /** + * Show the shortcut dialog + */ + showShortcutDialog(): void; +} +export class ShortcutManager implements IShortcutManager { + private static _instance; + static getInstance(): IShortcutManager; + private _shortcutsGroups; + getShortcutGroups(): IShortcutGroup[]; + registerShortcut(group: string, combo: string, description: string, action: Function): ShortcutManager; + registerShortcuts(group: string, combos: string[], description: string, action: Function): ShortcutManager; + removeShortcutGroup(group: string): void; + showShortcutDialog(): void; +} +export class ShortcutDialog extends Dialogs.ModalDialog { + initializeOptions(options?: any): void; + initialize(): void; + private renderShortcut(shortcut); + private renderGroup(group); +} +} +declare module "VSS/Controls/Menus" { +import Controls = require("VSS/Controls"); +export var menuManager: any; +export enum MenuItemState { + None = 0, + Disabled = 1, + Hidden = 2, + Toggled = 4, +} +export interface IMenuItemSpec { + /** + * Id of the menu item. Used to distinguish the menu item when action is executed or when changing command state of a menu item + */ + id?: string; + contributionId?: string; + rank?: number; + /** + * Display text of the menu item + */ + text?: string; + /** + * Display html of the menu item (mutually exclusive with text) + */ + html?: string; + /** + * Text displayed when mouse is hovered on the menu item + */ + title?: string; + /** + * Icon for the menu item + */ + icon?: string; + /** + * Determines whether the menu item is a separator or not. If specified along with text, menu item acts like a group text + * @defaultvalue false + */ + separator?: boolean; + /** + * Determines whether the menu item is initially disabled or not + * @defaultvalue false + */ + disabled?: boolean; + /** + * Children of this menu item + */ + childItems?: any; + /** + * Extra css class name for this menu item + */ + cssClass?: string; + groupId?: string; + arguments?: any; + action?: (commandArgs: any) => void; +} +export interface MenuBaseOptions { + type: string; + contextInfo: any; + arguments: any; + updateCommandStates: Function; + getCommandState: Function; + overflow: string; + align: string; + cssClass: string; + cssCoreClass: string; +} +export class MenuBase extends Controls.Control { + _type: any; + _parent: any; + _children: any; + _commandStates: any; + actionArguments: any; + /** + * @param options + */ + constructor(options?: any); + getOwner(): any; + getContextInfo(): any; + /** + * @return + */ + getActionArguments(): any; + /** + * Returns the menu type. The values are outlines in the MenuType enumeration + * + * @return The menu type value + */ + getMenuType(): number; + updateCommandStates(commands: ICommand[]): void; + isMenuBar(): boolean; + _fireUpdateCommandStates(context: any): void; + _clear(): void; + private _updateCommandStates(commands); +} +export interface MenuItemOptions extends MenuBaseOptions { + item: any; + immediateShowHide: boolean; + clickToggles: boolean; +} +export class MenuItem extends MenuBase { + static enhancementTypeName: string; + static getScopedCommandId(id: any, scope: any): any; + private _highlightHover; + private _highlightPressed; + private _index; + _item: any; + _align: any; + /** + * @param options + */ + constructor(options?: MenuItemOptions); + /** + * @param options + */ + initializeOptions(options?: MenuItemOptions): void; + getCommandId(): any; + getAction(): any; + hasAction(): boolean; + hasSubMenu(): any; + isDecorated(): boolean; + isDefault(): boolean; + isSeparator(): boolean; + /** + * Returns if this menu item is a label. Labels are menu items that aren't actions, like separators, but contain content, such as text. + * NOTE: Currently, Labels are implemented using separators. However, there are plans to revisit this. + */ + isLabel(): any; + isSelected(): boolean; + getCommandState(commandId?: string, context?: any): MenuItemState; + getIndex(): number; + setIndex(value: number): void; + isHidden(): boolean; + isEnabled(): boolean; + isToggled(): boolean; + initialize(): void; + update(item: any): void; + updateItems(items: any): void; + _decorate(): void; + private _getExternalIcon(url); + select(): void; + deselect(): void; + escaped(): void; + /** + * @param options + */ + execute(options?: any): any; + executeAction(args?: any): any; + collapse(options?: any): void; + setFocus(): void; + removeFocus(): void; + /** + * Called to show the hover highlight the button + */ + showHoverHighlight(): void; + /** + * Called to make the button appear to be 'pressed' + */ + showPressedHighlight(): void; + /** + * Called to make the button appear to be 'pressed' + */ + removePressedHighlight(): void; + /** + * Called to remove all highlighting on the button + */ + removeHighlight(): void; + /** + * Updates the title of a menu item using either the specified text or + * the function provided in the options + * + * @param text New title to be displayed + */ + updateTitle(text: string): void; + /** + * Updates the text of a menu item using either the specified text or + * the function provided in the options + * + * @param text New text to be displayed + */ + updateText(text: string): void; + getSubMenu(): any; + tryShowSubMenu(options?: any): boolean; + showSubMenu(options?: any): void; + hideSubMenu(options?: any): void; + hideSiblings(options?: any): void; + private _attachMenuEvents(); + private _createIconElement(); + private _createTextElement(); + private _createHtmlElement(); + private _createDropElement(); + private _createSeparatorElement(); + private _updateState(); + private _onMouseOver(e?); + private _onMouseOut(e?); + private _onMouseDown(e?); + private _onMouseUp(e?); + private _onClick(e?); + private _onDropClick(e?); + private _onKeyDown(e); +} +export interface MenuContributionProviderOptions { + defaultTextToTitle?: boolean; +} +export interface MenuOptions extends MenuBaseOptions { + suppressInitContributions: boolean; + contributionIds: string[]; + /** + * Items to be displayed in the menu + */ + items: IMenuItemSpec[]; + /** + * Action executed when a menu item is clicked + */ + executeAction: Function; + getContributionContext: Function; +} +/** + * @publicapi + */ +export class Menu extends MenuBase { + static enhancementTypeName: string; + private _items; + private _itemsSource; + private _defaultMenuItem; + private _childrenCreated; + private _popupElement; + private _skipUpdateMenuItemStates; + private _positioningRoutine; + private _pinElement; + private _menuContributionProvider; + protected _contributedItems: IContributedMenuItem[]; + protected _contributionProviderOptions: MenuContributionProviderOptions; + _menuItems: any; + _selectedItem: any; + _visible: boolean; + _active: boolean; + _blockBlur: boolean; + _focusItem: any; + /** + * @param options + */ + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + private _initializeItemsSource(); + _decorate(): void; + /** + * Gets the item which has the specified id. + * + * @param id Id associated with the menu item. + * @return {MenuItem} + * @publicapi + */ + getItem(id: string): MenuItem; + /** + * Gets an array of all menu items. + * + * @return {MenuItem[]} + * @publicapi + */ + getItems(): MenuItem[]; + /** + * Gets the item which has the specified tag + * + * @param tag Associated with the menu item + * @return + */ + getItemByTag(tag: string): MenuItem; + getCommandState(commandId: string, context?: any): MenuItemState; + /** + * Updates the command states of the items with the specified ids. + * + * @param commands List of commands to update. + * @publicapi + */ + updateCommandStates(commands: ICommand[]): void; + updateItems(items: any): void; + protected _updateItemsWithContributions(items: any, contributedMenuItems: IContributedMenuItem[]): void; + protected _updateCombinedSource(items: any): void; + /** + * Create a list from itemsSource to reflect the order of items after grouping is done. + * Groups of items come before all ungrouped items. + * A separator goes between each group of items. + * Ungrouped items remain at the end of the menu with their manually-specified separators still in tact. + * If any groups are defined, separators are guaranteed not to be the first or last item in the menu. + */ + getGroupedItems(): IMenuItemSpec[]; + appendItems(appendedItems: any): void; + /** + * @param element + */ + _enhance(element: JQuery): void; + /** + * @return + */ + _getMenuItemType(): any; + /** + * @param extraOptions + * @return + */ + getMenuItemOptions(item: any, extraOptions?: any): any; + _getFirstMenuItem(): any; + /** + * @param item + * @param ignoreFocus + */ + _selectItem(item?: any, ignoreFocus?: any): void; + selectDefaultItem(ignoreFocus?: any): void; + selectFirstItem(): boolean; + selectNextItem(): boolean; + selectPrevItem(): boolean; + /** + * @param options + * @return + */ + selectDown(options?: any): boolean; + /** + * @param options + * @return + */ + selectUp(options?: any): boolean; + /** + * @param options + * @return + */ + selectRight(options?: any): boolean; + /** + * @param options + * @return + */ + selectLeft(options?: any): boolean; + show(options?: any): boolean; + /** + * @param options + */ + hide(options?: any): void; + hideChildren(excludedItem: MenuItem, options?: any): void; + /** + * @param options + * @return + */ + escape(options?: any): boolean; + ownFocus(): void; + attach(parent: any): void; + /** + * @return + */ + getMenuItemAlignment(): string; + updateMenuItemStates(): void; + executeAction(eventArgs: any): any; + /** + * Scrolls to ensure that the MenuItem is visible + * + * @param item MenuItem which is to be shown + */ + private _ensureVisible(item); + private _getItems(); + _clear(): void; + /** + * @param menuItemElement + */ + private _createChildMenuItem(item, menuItemElement?); + private _createSplitDropMenuItem(item, menuItem); + private _ensureChildren(); + private _enhanceChildren(); + private _getDefaultMenuItem(); + /** + * @param options + */ + private _getNextEnabledItem(index, options?); + /** + * @param options + */ + private _getPrevEnabledItem(index, options?); + private _ensurePopup(); + private _getPopupAlign(align); + private _showPopup(element, align); + _hidePopup(): void; + private _updateMenuItemStates(); + private _startShowTimeout(element, align); + private _startHideTimeout(); + private _clearTimeouts(); + private _attachAncestorScroll(element); + private _detachAncestorScroll(element); + _onParentScroll(e?: any): void; + private _onMouseDown(e?); + private _blockBlurUntilTimeout(); + refreshContributedItems(): void; + private _refreshContributedMenuItems(); + private _getContributionContext(); +} +export interface MenuOwnerOptions extends MenuOptions { + /** + * Determines whether icons are visible or not + * @defaultvalue true + */ + showIcon: boolean; + markUnselectable: boolean; + showTimeout: number; + hideTimeout: number; + popupAlign: string; + onActivate: Function; + onDeactivate: Function; +} +export class MenuOwner extends Menu { + private _focusElement; + private _activating; + private _canBlur; + private _immediateBlur; + _subMenuVisible: boolean; + _align: any; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * Sets showIcon option. + * + * @param showIcon New state for the showIcon option. + */ + setShowIcon(showIcon: boolean): void; + initialize(): void; + _decorate(): void; + /** + * @return + */ + getMenuItemAlignment(): string; + /** + * @param extraOptions + */ + getMenuItemOptions(item: any, extraOptions?: any): any; + /** + * @param options + * @return + */ + escape(options?: any): boolean; + escaped(options?: any): void; + isActive(): boolean; + activate(): void; + /** + * This is especially necessary for screen readers to read each + * row when the selection changes. + */ + private _updateAriaAttribute(item); + private _hide(); + private _blur(); + private _updateSubMenuVisibleState(); + private _onKeyDown(e?); + private _onFocus(e?); + /** + * @param e + * @return + */ + private _onBlur(e?); + private _proceedBlur(); + private _startBlurTimeout(); + private _clearBlurTimeout(); + _onParentScroll(e?: any): void; + private _onResize(e?); + private _onContextMenu(e?); +} +/** + * @publicapi + */ +export interface MenuBarOptions extends MenuOwnerOptions { + /** + * Orientation of the menubar (horizontal or vertical) + * @defaultvalue "horizontal" + */ + orientation: string; +} +export class MenuBarO extends MenuOwner { + static enhancementTypeName: string; + private _orientation; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @return + */ + getMenuItemAlignment(): string; + /** + * @param options + * @return + */ + selectUp(options?: any): boolean; + /** + * @param options + * @return + */ + selectDown(options?: any): boolean; + /** + * @param options + * @return + */ + selectLeft(options?: any): boolean; + /** + * @param options + * @return + */ + selectRight(options?: any): boolean; +} +export class MenuBar extends MenuBarO { + /** + * Tries to activate the menubar associated with the element matched by the selector. + * @param selector Selector to match the element. + * @returns Menu activated or not. + */ + static tryActivate(selector: string): boolean; + /** + * Sets focus to the control + */ + focus(): void; +} +export interface PopupMenuOptions extends MenuOwnerOptions { + hidden: boolean; + onPopupEscaped: Function; + onHide: Function; +} +export class PopupMenuO extends MenuOwner { + static enhancementTypeName: string; + private _floating; + private _escapeFocusReceiver; + private _popupPinElement; + private _onHide; + _hidden: boolean; + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @return + */ + _getMenuItemType(): any; + _decorate(): void; + popup(focusElement: any, pinElement: any): void; + private _showPopupMenu(); + protected _updateItemsWithContributions(items: any, contributedMenuItems: IContributedMenuItem[]): void; + protected _updateCombinedSource(items: any): void; + /** + * @param options + * @return + */ + selectUp(options?: any): boolean; + /** + * @param options + * @return + */ + selectDown(options?: any): boolean; + /** + * @param options + * @return + */ + selectLeft(options?: any): boolean; + /** + * @param options + * @return + */ + selectRight(options?: any): boolean; + escaped(): void; + _hidePopup(): void; +} +export class PopupMenu extends PopupMenuO { +} +/** + * The command id. + */ +export interface ICommand { + /** + * Optional disabled state. True makes it visible in the menu but not selectable or clickable. + */ + id: string; + /** + * Optional hidden state. True hides it from the menu. + */ + disabled?: boolean; + /** + * Optional toggled state. True shows the item as toggled. + */ + hidden?: boolean; + toggled?: boolean; +} +/** + * Sort the menu items by rank, pushing those without a rank to the bottom of the list. + */ +/** + * Sort the menu items by rank, pushing those without a rank to the bottom of the list. + */ +export function sortMenuItems(items: any): any; +} +declare module "VSS/Controls/Navigation" { +import Controls = require("VSS/Controls"); +import Menus = require("VSS/Controls/Menus"); +import Notifications = require("VSS/Controls/Notifications"); +/** + * Creates a high-level view object for a given page which captures page/hash navigations, + * handles setting page title, etc. + */ +export class NavigationView extends Controls.BaseControl { + static ACTION_CONTRIBUTION: string; + private _chromelessMode; + private _leftPaneVisible; + private _useHostedTitle; + /** + * Creates an instance of the object for the given page + * + * @param options + * attachNavigate: If true, listen for page/hash navigations + * + */ + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + /** + * Function invoked when a page/hash navigation has occurred + * + * @param state Hash object containing the hash-url parameters + */ + onNavigate(state: any): void; + /** + * Get the element that holds the title + */ + _getViewTitle(): JQuery; + /** + * Sets the (text) title of the page + * + * @param title + * Title of the page + * + * @param tooltip + * Optional tooltip for the page's title element + * + */ + setViewTitle(title?: string, tooltip?: string): void; + /** + * Sets the raw-html title element for the page + * + * @param title + * Text title of the page to be used as the document title + * + * @param titleContent + * Raw HTML to inject into the title element (will not be escaped) + * + */ + setViewTitleContent(title: string, titleContent: string): void; + /** + * Sets the document's title + * + * @param title + * Title of the page (text) + * + */ + setWindowTitle(title: string): void; + /** + * Shows or hides the Left (tree) section of the explorer page + * + * @param visible If true, show the left side of the explorer page. False to hide it. + */ + setLeftHubPaneVisibility(visible: boolean): void; + /** + * Set full-screen mode. If true, hide the chrome (hubs, etc.) around the main hub content, hide the splitter, etc. + * + * @param fullScreenMode True to enter full screen mode. False to exit full screen mode. + */ + setFullScreenMode(fullScreenMode: boolean, showLeftPaneInFullScreenMode?: boolean): void; + /** + * Set the desired title mode for the current page. + * Callers must specify directly, as navigation cannot take dependency on TFSOM. + */ + _setTitleMode(isHosted: boolean): void; + /** + * Protected API: returns the desired title format string for use by SetWindowTitle() + */ + _getPageTitleString(): string; + private _attachNavigate(); + _onNavigate(state: any): void; +} +/** + * A high-level singleton wrapper class for a Tri-Split page, providing lightweight + * functionality such as retrieving the left/right/center hub content, left/right + * panes, setting the view title, etc. + * + * This class is designed to enhance the hub view of a Tri-Split page, and depends + * on the structure defined in the HubPageExplorerTriSplitPivot.master page. + */ +export class TriSplitNavigationView extends NavigationView { + private static _instance; + private _leftPane; + private _rightPane; + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + /** + * Retrieve the singleton instance of the class for the current page. + */ + static getInstance(): TriSplitNavigationView; + /** + * Retrieve the left pane element within the current backlog view + */ + getLeftPane(): JQuery; + /** + * Retrieve the right pane element within the current backlog view. + * NOTE: This retrieves the right pane of the left splitter, which has the center + * hub content as well as the right hub content (e.g. the product backlog mapping pane). + */ + getRightPane(): JQuery; +} +export interface IPivotFilterItem { + encoded?: boolean; + id?: string; + selected?: boolean; + text?: string; + title?: string; + value?: any; +} +export class PivotFilter extends Controls.BaseControl { + static enhancementTypeName: string; + private static _behaviors; + /** + * Registers a filter behavior for the pivot filter + * + * @param behaviorType Type of the registered behavior + */ + static registerBehavior(behaviorType: any): void; + /** + * Creates a behavior using the specified names. First found behavior is used + * + * @param names Names of the behaviors to probe + * @param options Options of the behavior + * @return + */ + static createBehavior(names: any[], options?: any): any; + private _behavior; + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + /** + * @param element + */ + _enhance(element: JQuery): void; + initialize(): void; + /** + * Gets all selected items of the pivot filter + * + * @return items + */ + getSelectedItems(): IPivotFilterItem[]; + /** + * Gets the currently selected item + * + * @return item + */ + getSelectedItem(): IPivotFilterItem; + /** + * Gets the item of the specified value + * + * @param value Value of the item (String or Number) + * @return item + */ + getItem(value: any): IPivotFilterItem; + /** + * Gets all of the items + * @return the items + */ + getItems(): IPivotFilterItem[]; + /** + * Gets the specified item selected + * + * @param item Item to select + * @param fireChange Determines whether the control shoudl fire the change event + */ + setSelectedItem(item: IPivotFilterItem, fireChange?: boolean): void; + /** + * Updates the pivot filter using the specified items + * + * @param items New set of items for the pivot filter + */ + updateItems(items: IPivotFilterItem[], options?: any): void; + /** + * Initializes behavior of this pivot filter using specified behavior names + */ + private _initBehavior(behaviorNames); + /** + * This method is called when the control is created in the client using createIn. + * DOM needs to be built by the control itself + */ + _createElement(): void; + private _buildDom(); + private _attachEvents(); + private _onFilterChanged(e?, item?); +} +export class PivotView extends Controls.BaseControl { + static enhancementTypeName: string; + private _extensionContainer; + private _contributionContext; + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + /** + * @param element + */ + _enhance(element: JQuery): void; + /** + * @param selector + * @return the array of items + */ + getItems(selector?: any): any[]; + initialize(): void; + /** + * Sets the DOM (jQuery) container that tab extensions will be loaded in. Should probably be a div. + * @param {JQuery} container + */ + setExtensionContainer(container: JQuery): void; + showExtensionTab(contributionId: string, configuration?: any): void; + setContributionContext(context: any): void; + /** + * If there is a contribution ID associated with this PivotView, load all the contributed pivot items. + */ + refreshContributedItems(): IPromise; + updateItems(): void; + /** + * Set a particular view's link to a new link. + * + * @param id The view whose link needs an update. + * @param link The new link for the specified view. + */ + setViewLink(id: string, link: string): void; + getSelectedView(): any; + /** + * Set a particular view to be enabled or disabled. + */ + setViewEnabled(id: any, isEnabled: any): void; + getView(id: any): any; + setSelectedView(view: any): void; + onChanged(view: any): void; + _createElement(): void; + private _buildDom(); + private _populateItems(ul); + private _attachEvents(); + private _onClick(e?); +} +export class NavigationViewTab extends Controls.BaseControl { + /** + * Creates a control which is used to populate a navigation tab's content section + */ + constructor(options?: any); + /** + * Called whenever navigation occurs with this tab as the selected tab + * + * @param rawState The raw/unprocessed hash/url state parameters (string key/value pairs) + * @param parsedState Resolved state objects parsed by the view + */ + onNavigate(rawState: any, parsedState: any): void; + /** + * Called whenever this tab is active and a navigation occurs that is switching to another tab + */ + onNavigateAway(): void; +} +export class TabbedNavigationView extends NavigationView { + private _hubContent; + private _tabsControl; + private _tabsMap; + private _tabOptionsMap; + private _tabs; + private _currentTab; + private _currentTabId; + private _errorTab; + private _infoTab; + private _$infoContent; + private _currentRawState; + private _currentParsedState; + private _currentNavigationContextId; + private _lastParsedNavigationContextId; + private _showingError; + private _showingInfo; + private _skipTabHideOnAsyncNavigate; + /** + * Creates a high-level view object for a given page that has different tabs which are + * displayed based on the current hash/navigation. + * + * @param options + * tabs: (Object) Mapping of action id to a NavigationViewTab containing the contents of the tab + * hubContentSelector: (String) jQuery selector for the hub content div + * pivotTabsSelector: (String) jQuery selector for the hub tabs div + * hubSplitterSelector: (String) jQuery selector for the hub splitter control + * + */ + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + getTab(tabId: string): NavigationViewTab; + showError(error: any): void; + showErrorContent(title: any, $contentHtml: any, messageType: any, expand: any): void; + showInformationTab(title: string, description: string): void; + appendInformationContent(caption: string, collapsed: boolean): Notifications.InformationAreaControl; + appendSectionTitle(content: string): void; + appendSectionSummary(content: string): void; + appendElement(element: JQuery): void; + /** + * Refresh the current tab (causes setState to be called on the currently visible tab) + */ + refreshCurrentTab(): void; + /** + * Get the action/tab id for the current state + * + * @return Tab id, specified in the _a parameter + */ + getCurrentAction(): string; + /** + * Get the current (parsed) state objects for the current navigation state + * + * @return State Object that was parsed by the view + */ + getState(): any; + /** + * Set the current (parsed) state objects for the current navigation state + */ + setState(parsedState: any): void; + /** + * Get a state hash with null entries for each hash key that exists in the current + * url hash. This state can be extended and passed to VSS.Host.history.addHistoryPoint + * so that existing hash parameters are NOT included in the new url. + * + * @return + */ + getEmptyState(): any; + /** + * Get the raw (unparsed) state objects for the current navigation state (key/value pairs from the hash/url) + * + * @return Object with string values from the url hash portion + */ + getRawState(): any; + /** + * Parse the state info and fetch any artificacts necessary to render the tab/view. Invoke the 'callback' + * method with the new state info object when the state information has been successfully parsed. + * + * @param action The action parameter (_a) in the url hash + * @param rawState The raw state info from the hash url for the new navigation + * @param callback + * Callback that should be called when the state was successfully parsed. The callback takes 2 parameters: the tab id (typically + * the action), and the parsed state info object. + * + * callback(tabId, parsedStateInfo); + * + * + */ + parseStateInfo(action: string, rawState: any, callback: IResultCallback): void; + /** + * Get the visibility state of the specified tab based on the current tab/navigation state. True to show this tab. False to hide it. + * + * @param tabId The Id to get the visiblility state for + * @param currentTabId Id of the currently selected tab + * @param rawState The raw/unprocessed hash/url state parameters (string key/value pairs) + * @param parsedState Resolved state objects parsed by the view + * @return True to show the tab. False to hide it. + */ + getTabVisibility(tabId: any, currentTabId: string, rawState: any, parsedState: any): boolean; + /** + * Get the updated tab label for the specified tab based on the current tab/navigation state. null/undefined to keep the existing label. + * + * @param tabId The Id to get the tab label for + * @param currentTabId Id of the currently selected tab + * @param rawState The raw/unprocessed hash/url state parameters (string key/value pairs) + * @param parsedState Resolved state objects parsed by the view + */ + getTabLabel(tabId: any, currentTabId: string, rawState: any, parsedState: any): void; + /** + * Shows or hides the Hub pivot section (navigation tab strip + filters) + * + * @param visible If true, show the hub pivot (tabs/filters). If false, hide them + */ + setHubPivotVisibility(visible: boolean): void; + private _getErrorTab(); + private _getInfoTab(); + _onNavigate(state: any): void; + _redirectNavigation(action: string, state: any, replaceHistory?: boolean): void; + private _onParseStateInfoSuccess(tabId, rawState, parsedState, navigationContextId); + private _updateTabsControl(selectedTabId, rawState, parsedState); + private _showTab(tab); + private _getTab(tabId); + private _createTab(tabControlType, tabOptions?); +} +export interface NavigationLinkOptions { + state?: any; + getUrl?: (state: any) => string; + target?: string; + text?: string; + title?: string; + $content: JQuery; + initialState?: any; +} +export class NavigationLink extends Controls.BaseControl { + private _navigateHandler; + private _navigationLinkOptions; + initializeOptions(options?: any): void; + constructor(options: NavigationLinkOptions); + initialize(): void; + dispose(): void; + private onNavigate(sender, state); + private updateLink(state); + getLocation(state: any): any; +} +export module FullScreenHelper { + var FULLSCREEN_HASH_PARAMETER: string; + var _events: any; + /** + * Initialize the full screen helper. Sets up event handlers. + * + * @param menuBar A toggle button for full screen mode will be added to the menu bar (if it does not already exist). + */ + function initialize(menuBar: Menus.MenuBar, options?: any): void; + /** + * Gets a value indicating whether full screen mode is active. + */ + function getFullScreen(): boolean; + /** + * Set full screen value. Update full screen view and button. + * Update url with full screen tag if addHistoryPoint is true. + * + * @param value The full screen value to set to. + * @param addHistoryPoint If true, update url with full screen tag. + */ + function setFullScreen(value: boolean, addHistoryPoint?: boolean, showLeftLane?: boolean): void; + /** + * Get state object for the current full screen mode state. + * + * @param value Optional value to set for fullscreen mode. + * If undefined will use current setting. + */ + function getUrlData(value?: boolean): any; + /** + * Gets full screen icon. + */ + function getFullScreenIcon(): string; + /** + * Gets full screen tooltip. + */ + function getFullScreenTooltip(): string; + /** + * Attaches a fullscreen customer intelligence change event handler. + * This event handler will be triggered for publishing full screen customer intelligence. + * + * @param handler Event handler callback. + */ + function attachFullScreenCI(handler: IEventHandler): void; + /** + * Removes fullscreen customer intelligence change handler from the event handler list. + * + * @param handler Event handler callback. + */ + function detachFullScreenCI(handler: IEventHandler): void; + /** + * Attaches a fullscreen customer intelligence change event handler. + * This event handler will be triggered for publishing full screen customer intelligence. + * + * @param handler Event handler callback. + */ + function attachFullScreenUrlUpdateEvent(handler: IEventHandler): void; + /** + * Removes fullscreen customer intelligence change handler from the event handler list. + * + * @param handler Event handler callback. + */ + function detachFullScreenUrlUpdateEvent(handler: IEventHandler): void; +} +} +declare module "VSS/Controls/Notifications" { +import Controls = require("VSS/Controls"); +export enum MessageAreaType { + None = 0, + Info = 1, + Warning = 2, + Error = 3, +} +export interface IMessageAreaControlOptions { + message?: any; + type?: MessageAreaType; + closeable?: boolean; + expanded?: boolean; + hidden?: boolean; + showHeader?: boolean; + showDetailsLink?: boolean; + showIcon?: boolean; + noHeaderNoLinkJustIcon?: boolean; + fillVertical?: boolean; +} +export class MessageAreaControlO extends Controls.Control { + static EVENT_DISPLAY_COMPLETE: string; + static EVENT_DISPLAY_CLEARED: string; + static ERROR_DETAILS_TOGGLED: string; + private _errorHeader; + private _errorContent; + private _messageType; + private _showErrorLink; + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + initialize(): void; + /** + * Set the message + * + * @param message Message string (plain text), jQuery (html) or + * message = { + * type: MessageAreaType, + * header: String for plain text or jQuery for html, + * content: String for plain text or jQuery for html, + * click: function + * } + * + * @param messageType Type of message + */ + setMessage(message: any, messageType?: MessageAreaType): void; + /** + * Set the error message + * + * @param message Message string (plain text), jQuery (html) or + * message = { + * type: MessageAreaType, + * header: String for plain text or jQuery for html, + * content: String for plain text or jQuery for html, + * click: function + * } + * + * @param clickCallback Click callback function + */ + setError(message: any, clickCallback?: Function): void; + /** + * Gets the current message type. + */ + getMessageType(): MessageAreaType; + /** + * Clear the shown message + */ + clear(): void; + /** + * Set the display message + * + * @param message + * message = { + * type: MessageAreaType, + * header: String, + * content: html String OR jQuery, + * click: function + * } + * + */ + private _setDisplayMessage(message); + private _toggle(); + setErrorDetailsVisibility(show: any): void; + /** + * Clear the shown message + * + * @param raiseDisplayCompleteEvent Indicates if the display complete event should be raised. + */ + private _clear(raiseDisplayCompleteEvent); + private _raiseDisplayComplete(); +} +export class MessageAreaControl extends MessageAreaControlO { +} +export class UnsupportedBrowserMessageControl extends Controls.BaseControl { + private _messageArea; + /** + * A message area control that displays a message to a user until they dismiss it. + */ + constructor(options?: any); + /** + * Initialize the control, creating the message area and binding to the dismiss event + */ + initialize(): void; +} +export interface IInformationAreaControlOptions { + caption?: string; + expandedIconClass?: string; + collapsedIconClass?: string; +} +export class InformationAreaControlO extends Controls.Control { + private _$collapseIndicator; + private _$content; + private _$caption; + private _collapsed; + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + appendDetailHeaderContent($headerContent: JQuery): void; + appendDetailContent($detailContent: JQuery): void; + appendCodeContent($codeContent: JQuery): void; + appendDetailHeaderHtml(headerHtml: string): void; + appendDetailHtml(detailHtml: string): void; + appendCodeHtml(codeHtml: string): void; + _updateCollapsedState(collapsed: boolean): void; +} +export class InformationAreaControl extends InformationAreaControlO { +} +/** + * This class affords showing a toast-style notification which fades in, + * appears for a certain amount of time and then fades out. + */ +export class ToastNotification extends Controls.BaseControl { + private _messageArea; + private _fadeInTime; + private _fadeOutTime; + private _toastTime; + private _toasting; + private _delayedFunction; + constructor(options?: any); + initialize(): void; + initializeOptions(options?: any): void; + private _processOptions(); + private _getOptions(); + private _getDefaultOptions(); + /** + * Pop up a toast with the supplied message + * + * @param message This can be a string or JQuery object + * @param messageType The type of message area you want displayed. Defaults to Info. + */ + toast(message: any, messageType?: MessageAreaType): void; + /** + * If toasting ensure we cancel all in-progress toasting activities + */ + private _ensureNoActiveToast(); +} +} +declare module "VSS/Controls/Panels" { +import Controls = require("VSS/Controls"); +export interface ICollapsiblePanelOptions extends Controls.EnhancementOptions { + collapsed?: boolean; + headerText?: string; + headerContent?: string | JQuery; + expandCss?: string; + headerCss?: string; + contentCss?: string; + hoverCss?: string; + iconCss?: string; + collapseCss?: string; + iconCollapseCss?: string; + iconExpandCss?: string; + onToggleCallback?: Function; + customToggleIcon?: JQuery; +} +export class CollapsiblePanel extends Controls.Control { + static EVENT_CONTENT_EXPANDED: string; + static EVENT_CONTENT_COLLAPSED: string; + static enhancementTypeName: string; + private static _defaultToggleIconOverrideClass; + private _dynamicContents; + private _header; + private _content; + private _$toggleIcon; + /** + * @param options + */ + initializeOptions(options?: ICollapsiblePanelOptions): void; + private _swapDefaultToggleIconForCustom($customToggleIcon); + private _createControl(); + _createIn(container: any): void; + /** + * @param element + */ + _enhance(element: JQuery): void; + /** + * Appends the specified plain text to the header section of the CollapsiblePanel + * + * @param header Content to append to the header section + * @return + */ + replaceHeaderTextIfPresent(headerText: string): JQuery; + /** + * Appends the specified plain text to the header section of the CollapsiblePanel + * + * @param headerText Content to append to the header section + * @return + */ + appendHeaderText(headerText: string): CollapsiblePanel; + /** + * Appends the specified HTML, DOM element or jQuery object to the + * header section of the CollapsiblePanel + * + * @param element Content to append to the header section + * @return + */ + appendHeader(element: string | JQuery): CollapsiblePanel; + /** + * Appends the specified content to the display content of the control + * + * @param content This might be a jQuery selector or function. + * If a function is provided, that function will be executed whenever collapse icon is clicked. + * The function should return a content + * @return + */ + appendContent(element: string | JQuery | Function): CollapsiblePanel; + isExpanded(): boolean; + expand(): void; + collapse(): void; + toggleExpandedState(): boolean; +} +/** + * @publicapi + */ +export interface IAjaxPanelOptions { + /** + * Url to load the content from. + */ + url?: string; + /** + * Url request paremeters. + */ + urlParams?: any; + /** + * Callback executed if the load succeeds. + */ + success?: Function; + /** + * Callback executed if the load fails. + */ + error?: Function; + /** + * Determines whether status indicator is displayed or not. + * @defaultvalue true. + */ + showStatusIndicator?: boolean; + cache?: boolean; + replaceContent?: boolean; +} +/** + * @publicapi + */ +export class AjaxPanelO extends Controls.Control { + static enhancementTypeName: string; + private _cancelable; + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + _dispose(): void; + /** + * Begins loading the content using the specified arguments. + * + * @param url Url to load the content from. + * @param params Url request paremeters. + * @param callback Callback executed if the load succeeds. + * @param errorcallback Callback executed if the load fails. + * @publicapi + */ + beginLoad(url: string, params?: any, callback?: Function, errorcallback?: Function): void; + onLoadCompleted(content: any): void; + onLoadError(error: any, handled: any): void; + showError(error: any): void; + private _cancelPendingLoad(); +} +export class AjaxPanel extends AjaxPanelO { +} +} +declare module "VSS/Controls/PopupContent" { +import Controls = require("VSS/Controls"); +export class PopupContentControl extends Controls.BaseControl { + private _$dropElement; + private _$contentContainer; + private _contentSet; + private _documentEventDelegate; + initialize(): void; + setContent(content: any): void; + show(): void; + hide(): void; + toggle(): void; + _enhance($dropElement: any): void; + private _decorate(); + private _handleDocumentMouseDown(e); + _setPosition(): void; + _getDropElement(): JQuery; + private _onShow(); + private _onHide(); + _dispose(): void; +} +export class RichContentTooltip extends PopupContentControl { + private _$popupTag; + initializeOptions(options?: any): void; + initialize(): void; + _getPopupTooltipElement(): JQuery; + _setPosition(): void; +} +} +declare module "VSS/Controls/RichEditor" { +import Controls = require("VSS/Controls"); +export interface RichEditorAttachmentRequestData { + fileName: string; + binaryData: any; +} +export interface RichEditorAttachmentOperationResult { + attachments: RichEditorAttachmentResult[]; +} +export interface RichEditorAttachmentResult { + Url: string; +} +export interface RichEditorAttachmentHandler { + (attachment: RichEditorAttachmentRequestData): JQueryPromise; +} +export class RichEditor extends Controls.BaseControl { + static enhancementTypeName: string; + static INSERT_IMAGE_COMMAND: string; + static RESTORE_COMMAND: string; + static MAXIMIZE_COMMAND: string; + static IMAGE_AUTOFIT_SCALE_FACTOR: number; + private _iframe; + private _window; + private _textArea; + private _isReady; + private _readyList; + private _editable; + private _toolbar; + private _urlToolTip; + private _editor; + private _hasFocus; + private _explicitFocus; + private _keyDownInDocument; + private _customCommandHandlersMap; + private _originalValue; + private _currentValue; + private _textAreaId; + private _hasWaterMark; + private _uploadAttachmentHandler; + /** + * Creates a new rich editor with the provided options + */ + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + _createIn(container: any): void; + /** + * @param element + */ + _enhance(element: JQuery): void; + ready(fn: any): void; + isReady(): boolean; + setEnabled(value: any): void; + getValue(): string; + isEmpty(value: any): boolean; + setValue(value: any): void; + /** + * Inserts an image tag pointing to the specified url at the current caret position if possible. + * If the current caret position cannot be determined, the image tag is inserted at the editor root node. + * + * @param url The url containing an image in which to link to the document. + */ + insertImage(url: string): void; + focus(): void; + selectText(collapseToEnd?: boolean): void; + bindOnCopy(handler: any): void; + getWindow(): Window; + private _resizeImageOnLoadComplete(url, loadCompleteCallback?); + setInvalid(isInvalid: boolean): void; + setUploadAttachmentHandler(handler: RichEditorAttachmentHandler): void; + getTextAreaId(): any; + /** + * Checks whether the value of the control is changed or not and fires the CHANGE event if it has + * + * @param e + * @return + */ + checkModified(e?: JQueryEventObject): any; + private _pasteImage(url); + private _getToolbar(); + private _createToolbar(); + /** + * Creates a toolbar button group. + * + * @param customGroup An object representing a toolbar button group. + */ + private _createToolbarButtonGroup(customGroup); + /** + * @param opacity + */ + private _showPanel(panel, opacity?); + /** + * @param opacity + */ + private _showToolbar(opacity?); + private _getUrlToolTip(); + private _createUrlToolTip(); + private _showUrlToolTip(e?, doShow?); + private _decorate(); + private _initialize(); + private _cleanUp(); + /** + * Attaches necessary events to catch the changes if the control is enabled + */ + private _attachEvents(); + private _detachEvents(); + /** + * @param e + * @return + */ + private _onDblClick(e?); + private _onDocumentReady(); + private _trySettingWaterMark(val); + private _clearWaterMark(); + private _textAreaFocus(); + /** + * @param e + * @return + */ + private _onFocusIn(e?); + /** + * @param e + * @return + */ + private _onFocusOut(e?); + private _onPaste(e?); + private _getImageItem(items); + private _getRandomFileName(fileType?); + private _onFileReadComplete(e, fileType?); + private _uploadAttachment(attachment); + private _onUploadComplete(result); + private _onUploadError(error); + /** + * @param e + * @return + */ + private _onClick(e?); + /** + * @param e + * @return + */ + private _onMouseUp(e?); + /** + * @param e + * @return + */ + private _onMouseDown(e?); + private _reTriggerEvent(e?); + /** + * @param e + * @return + */ + private _onKeyDown(e?); + /** + * @param e + * @return + */ + private _onKeyPress(e?); + /** + * @param e + * @return + */ + private _onKeyUp(e?); + /** + * @param e + * @return + */ + private _onInput(e?); + /** + * @param e + * @return + */ + private _onToolbarButtonClick(e?, args?); + private _getNodeUnderCaret(tagName); + /** + * Finds the node in the ancestors with the specified tag name + */ + private _getNodeAncestor(node, tagName); + /** + * Gets a W3C Range or Microsoft TextRange object depending on the running browser. + * These object types are completely incompatible, so the caller must branch + * on platform or simply compare for equality. + */ + private _getTextRange(); + /** + * Checks whether clicked element is a link and launches url + * + * @param e + */ + private _checkForCtrlClick(e?); + /** + * launch the Url associated with a linkNode + */ + private _processAndLaunchHref(linkNode, e?); + private _executeCommand(commandInfo); + /** + * Creates a hyperlink in this window and selects the new link. + * + * @param args The new link address. + */ + private _createHyperlink(args); + private _setEditable(value); + private _processReadyList(); + private _ensureControlReadiness(); + private _normalizeValue(value); +} +} +declare module "VSS/Controls/Search" { +import Controls = require("VSS/Controls"); +import Search = require("VSS/Search"); +/** + * @interface + * An interface for SearchBoxControl options + */ +export interface ISearchBoxControlOptions { + /** + * filterTitle: Optional: Tooltip for the control. + */ + filterTitle?: string; + /** + * activateSearchHandler: Optional: Callback when the control is activated. + */ + activateSearchHandler?: Function; + /** + * deactivateSearchHandler: Optional: Callback when the control is deactivated. + */ + deactivateSearchHandler?: Function; + /** + * inputChangedEventHandler: Optional: When the control input changed. + */ + inputChangedEventHandler?: Function; + /** + * hideWatermark: Optional: Set to true to hide watermark for the control. + */ + hideWatermark?: boolean; + /** + * searchIconTooltip: Optional: Tooltip for the search icon of ToggleSearchBoxControl. + */ + searchIconTooltip?: string; +} +/** + * A input box control for search or filter. + */ +export class SearchBoxControl extends Controls.Control { + private static inputChangedEventThrottlingInterval; + private _$searchInputTextbox; + private _$searchIcon; + private _active; + private _suppressBlur; + private _activateSearchHandler; + private _deactivateSearchHandler; + private _inputChangedEventHandler; + private _value; + private _inputChangedEventHandlerReset; + private _subsequentInputChange; + constructor(options?: ISearchBoxControlOptions); + initialize(): void; + /** + * Return the triming value of the input box. + */ + getValue(): string; + /** + * Return the value of the input box. + */ + private _getValue(); + /** + * Displays the search box and hides the search button. + */ + activateSearch(): void; + /** + * Removes the search box and shows the search button instead. + */ + deactivateSearch(): void; + protected _displaySearchInputBox(isVisible: boolean): void; + private _clearInput(); + private _createSearchInput(); + private _searchIconClickHandler(e?); + private _bindInputChangedEventHandler(); + private _keyDown(e?); + private _keyUp(e?); + private _mouseDown(e?); + private _mouseUp(); + private _mouseOut(); + /** + * Handle the blur which deactivates search + */ + private _handleBlur(); + /** + * Handle the focus which activates search + */ + private _handleFocus(e?); +} +/** + * A search icon control. When click, it expands to input box control for search or filter. + */ +export class ToggleSearchBoxControl extends SearchBoxControl { + private _$searchIconContainer; + initializeOptions(options?: any): void; + initialize(): void; + /** + * Show the inputbox and hide the search icon. + */ + activateSearch(): void; + /** + * Hide the inputbox and shows the search icon. + */ + deactivateSearch(): void; + private _addSearchToggleIcon(); + private _searchIconHoverIn(); + private _searchIconHoverOut(); + private _toggleSearchIcon(isVisible); + private _searchIconKeyDownHandler(e?); + private _searchIconkeyUpHandler(e?); +} +export interface ITextFilterControlOptions extends ISearchBoxControlOptions { + adapter?: any; +} +export class TextFilterControl extends Controls.Control { + static tagName: string; + static coreCssClass: string; + _textFilterInput: SearchBoxControl; + _searchCore: Search.SearchCore; + private _active; + private _suppressBlur; + _searchAdapter: any; + /** + * Control for backlog search. + * + * @param options Options for the control + */ + constructor(options?: ITextFilterControlOptions); + /** + * @param options + */ + initializeOptions(options?: any): void; + isActive(): boolean; + /** + * Initializes the control. Creates the search box and initializes events. + */ + initialize(): void; + protected _createSearchStrategy(): Search.SearchStrategy; + private _createSearchInputBox(); + /** + * Displays the search box and hides the search button + */ + activateSearch(): void; + /** + * Removes the search bar and shows the search button instead + * + * @param suppressClear Suppress the clearing event + */ + deactivateSearch(suppressClear?: boolean): void; + /** + * Creates the index in the searchCore + */ + createIndex(): void; + /** + * Clears the index in the Search Core + */ + clearIndex(): void; + /** + * Clears the store and performs the search if search is active. + */ + refreshResults(): void; + /** + * Handle input changed event. + */ + attachEventOnKeyUp(e?: JQueryEventObject): void; + /** + * Perform the search. + */ + _performSearch(): void; +} +} +declare module "VSS/Controls/Splitter" { +import Controls = require("VSS/Controls"); +/** + * @publicapi + */ +export interface ISplitterOptions { + /** + * Initial size of the grid in px. + */ + initialSize?: number; + /** + * Specifies which side of the splitter is fixed (left or right). + * @defaultvalue "left" + */ + fixedSide?: string; + /** + * Specifies whether the split should be vertical or not. + * @defaultvalue true + */ + vertical?: boolean; + /** + * Text displayed on splitter handle when toggle button is enabled and splitter is collapsed. + */ + collapsedLabel?: string; + /** + * Enables the toggle button which displays a button for expand/collapse. + * @defaultvalue false + */ + enableToggleButton?: boolean; + animationSpeed?: number; + expandState?: string; + /** + * Sets the minimum width of the splitter's fixed side. + */ + minWidth?: number; + /** + * Sets the maximum width of the splitter's fixed side. + */ + maxWidth?: number; +} +/** + * @publicapi + */ +export class SplitterO extends Controls.Control { + static enhancementTypeName: string; + private static _noSplitCssClass; + static CORE_CSS_CLASS: string; + static HORIZONTAL_CLASS: string; + static VERTICAL_CLASS: string; + static TOGGLE_BUTTON_LENGTH: number; + static TOGGLE_BUTTON_MARGIN: number; + static COLLAPSED_CLASS_NAME: string; + static TOGGLE_BUTTON_ENABLED_CLASS_NAME: string; + static TOGGLE_BUTTON_HOTKEY_ENABLED_CLASS_NAME: string; + static AUTO_COLLAPSE_THRESHOLD: number; + static DEFAULT_ANIMATION_SPEED: number; + static HANDLE_BAR_CLONE_SIZE: number; + private _screenXY; + private _cssPosProp; + private _cssSizeProp; + private _leftFix; + private _fixedSide; + private _fillSide; + private _deltaMultiplier; + private _dragStart; + private _fixedSidePixels; + private _splitterOverlay; + private _$handleBarClone; + private _ignoreWindowResize; + private _$toggleButton; + private _$toggleButtonIcon; + private _minWidth; + private _maxWidth; + leftPane: JQuery; + rightPane: JQuery; + handleBar: JQuery; + expandState: string; + constructor(options: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @param element + */ + _enhance(element: JQuery): void; + initialize(): void; + private _setInitialSize(); + /** + * Sets the minimum width of the splitter's fixed side. + * + * @param minWidth minimum number of pixels the fixed side will fill. + * @publicapi + */ + setMinWidth(minWidth: number): void; + /** + * Sets the maximum width of the splitter's fixed side. + * + * @param maxWidth maximum number of pixels the fixed side will fill. + * @publicapi + */ + setMaxWidth(maxWidth: number): void; + /** + * Resize the fixed side of the splitter to the specified size. + * + * @param newSize New fixed side size in px. + * @param suppressFireResize Determines whether to suppress firing resize event or not. + * @param useAnimation Determines whether to use animation during resize or not. + * @publicapi + */ + resize(newSize: any, suppressFireResize?: boolean, useAnimation?: boolean): void; + /** + * Expand or collapse the splitter. + * + * @param expanded True to expand the splitter, false to collapse it. If not provided, the expansion state toggles. + */ + toggleExpanded(expanded?: boolean): void; + /** + * Expands the splitter. + * @publicapi + */ + expand(): void; + /** + * Collapses the splitter. + * @publicapi + */ + collapse(): void; + /** + * Specifies whether the splitter is expanded or not. + * + * @returns {boolean} + * @publicapi + */ + isExpanded(): boolean; + /** + * @param suppressResize + */ + removeExpand(suppressResize?: boolean): void; + /** + * @param side + */ + protected _expandInternal(side?: string): void; + /** + * Gets the fixed side size in px. + * + * @returns {number} + * @publicapi + */ + getFixedSidePixels(): number; + /** + * @param visible + */ + toggleSplit(visible?: boolean, animate?: boolean, defaultExpandToPixels?: number): void; + /** + * Disables the split. + * @publicapi + */ + noSplit(animate?: boolean): void; + /** + * Enables the split. + * + * @param animate Determines split operation is animated or not (default false). + * @param defaultExpandToPixels Specified value used for split amount. If not specified default value is used. + * @publicapi + */ + split(animate?: boolean, defaultExpandToPixels?: number): void; + /** + * @param newSize + */ + toggleOrientation(vertical: any, newSize?: number): void; + /** + * Changes split orientation to vertical. + * @publicapi + */ + vertical(): void; + /** + * Changes split orientation to horizontal. + * @publicapi + */ + horizontal(): void; + /** + * Sets the label that is shown when the splitter is collapsed + * + * @param labelText Text displayed when the splitter is collapsed (null/empty for none) + * @publicapi + */ + setCollapsedLabel(labelText: string): void; + _createElement(): void; + private _configureCssProps(); + private _attachEvents(); + /** + * Gets the collapse/expand toggle button of this splitter control. + */ + private _ensureToggleButton(); + /** + * Re-position the toggle button. + * + * @param useAnimation true if the layout change is animated; false, otherwise. + */ + private _layoutToggleButton(useAnimation?); + /** + * Set toggle button icon class for rendering + * + * @param isExpanded true if to show expanded icon; false, otherwise. + */ + private _setToggleButtonIconClass(isExpanded); + /** + * Sets the tooltip for the toggle button. + */ + private _setToggleButtonTooltip(); + /** + * Measures the full size of the fixed side pane. + */ + private _measureFixedSide(); + private _handleBarMouseDown(e?); + /** + * Checks if the toggle button is enabled. + */ + private _isToggleButtonEnabled(); + /** + * Checks if the toggle button hotkey is enabled. + */ + private _isToggleButtonHotkeyEnabled(); + /** + * Checks if the splitter is marked as collapsed. + */ + private _isCollapsed(); + /** + * Handles the keyup event for the document. + * + * @param e + * @return + */ + private _onDocumentKeyup(e?); + /** + * Handles the click event for the toggle button. + * + * @param e + * @return + */ + private _onToggleButtonClick(e?); + /** + * Ensures that a clone of the handlebar is available. + */ + private _ensureHandleBarClone(); + /** + * Removes the handlebar clone. + */ + private _removeHandleBarClone(); + private _setupDragEvents(); + private _ensureOverlay(); + private _removeOverlay(); + private _clearDragEvents(); + /** + * @param e + * @return + */ + private _documentMouseMove(e?); + /** + * @param e + * @return + */ + private _documentMouseUp(e?); + private _onWindowResize(); + private _fireWindowResize(); + /** + * Attaches the splitter to the window resize event, performing a resize immediately if specified + * by the input parameter. This is primarily useful for attaching to the resize event after the + * splitter has just been re-attached to the DOM and needs to see if the viewwport size has changed. + * + * @param resizeNow Whether or not the splitter should perform resize now. + */ + attachResize(resizeNow?: boolean): void; + /** + * Detaches the splitter from the window resize event (tells it to ignore the event). + */ + detachResize(): void; + /** + * Creates an option object to be used with $.animate(). + * + * @param cssPropertyName The CSS property for the animation. + * @param cssPropertyValue The target CSS property value for the animation. + */ + private _createAnimationOption(cssPropertyName, cssPropertyValue); + /** + * @param e + * @return + */ + private _handleBarDoubleClick(e?); + _dispose(): void; +} +export class Splitter extends SplitterO { +} +} +declare module "VSS/Controls/StatusIndicator" { +import Controls = require("VSS/Controls"); +import Utils_Core = require("VSS/Utils/Core"); +export interface IStatusIndicatorOptions { + message?: string; + eventTarget?: any; + imageClass?: string; + center?: boolean; + throttleMinTime?: number; + statusStartEvent?: string; + statusCompleteEvent?: string; + statusErrorEvent?: string; +} +export class StatusIndicatorO extends Controls.Control { + static enhancementTypeName: string; + private _statusDiv; + private _image; + private _throttleMinTime; + private _delayStart; + private _lastError; + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + _dispose(): void; + /** + * @param event + */ + start(options?: IStatusIndicatorOptions): void; + /** + * @param delay + */ + delayStart(delay: number): void; + complete(): void; + error(error: Error): void; + setMessage(message: string): void; + showElement(): void; + hideElement(): void; + private _draw(); + private _start(); + private _onClick(); + private _setImageClass(); + private _bindEvents(); + private _error(e?, xhr?, settings?, exception?); + private _startHandler(event, options?); + private _clearTimeout(); +} +export class StatusIndicator extends StatusIndicatorO { +} +export class LongRunningOperation { + private _cancelable; + private _options; + private _$rootElement; + private _waitControl; + private _state; + private _cancelled; + /** + * Creates a new long running operation, showing a blocking indicator in a cancellable means overtop the specified container until the operation has completed. + * + * @param container A DOM object that contains the control on the page in which to overlay the progress indicator. + * @param options A collection of configuration name/value pairs. The following are supported: + * Name Type Value + * cancellable boolean Boolean value indicating whether the operation may be cancelled while it is running. + * + */ + constructor(container: any, options?: any); + /** + * Begins the long running operation, invoking the specified operationCallback when necessary. + * + * @param operationCallback An operation that may take a long time to complete. + */ + beginOperation(operationCallback: IResultCallback): void; + protected createWaitControl(options: IWaitControlOptions): WaitControl; + protected getCancellableOperation(): Utils_Core.Cancelable; + getWaitControl(): WaitControl; + /** + * Signals the completion of a long running operation. + */ + endOperation(): void; + /** + * Gets a boolean value indicating whether the current operation has a pending cancel request. + */ + isCancelled(): boolean; + /** + * Cancels the current operation. + */ + cancelOperation(): void; + /** + * Initializes the long running operation. + */ + private _initialize(); +} +export enum WaitingState { + NotStarted = 0, + Waiting = 1, + Ending = 2, + Ended = 3, + Cancelling = 4, + Cancelled = 5, +} +/** + * @publicapi + */ +export interface IWaitControlOptions extends Controls.EnhancementOptions { + /** + * Target element in which an overlay and a message box is displayed. If not specified, whole window is used. + * defaultvalue window + */ + target?: JQuery; + /** + * Text to be displayed in the message box. + */ + message?: string; + /** + * Message format used if the cancellable is true. Defaut value is {message}({cancelText}). + */ + messageFormat?: string; + /** + * Specifies whether this is control is cancellable or not. If yes, a cancel link is displayed in the message box. + * @defaultvalue false + */ + cancellable?: boolean; + /** + * Cancel text format used when displaying cancel text. + * @defaultvalue "Press {0} to cancel" + */ + cancelTextFormat?: string; + /** + * Callback executed when the control is cancelled. + */ + cancelCallback?: Function; + /** + * Sepcifies whether to fade out the message box when the operation is cancelled or ended. + * @defaultvalue true + */ + fade?: boolean; + /** + * Specifies the amount of delay in milliseconds when the message box is displayed. + * @defaultvalue 250 + */ + showDelay?: number; + /** + * Overlay color. + */ + backgroundColor?: string; + /** + * Progress image to be displayed. + */ + image?: string; + messageElement?: JQuery; + element?: JQuery; + entireWindow?: boolean; + cancelLinkId?: string; + extraStyles?: string; + minLifetime?: number; + minLifeSpanBlocking?: boolean; +} +export interface WaitContext { + instanceId?: string; + options?: { + wait: IWaitControlOptions; + }; + cancellable?: Utils_Core.Cancelable; + showTimer?: Utils_Core.DelayedFunction; +} +/** + * @publicapi + */ +export class WaitControlO extends Controls.Control { + private static _instanceIdSeed; + static DefaultShowDelay: number; + static MinLifeTime: number; + private _originalFocusElement; + private _context; + private _state; + private _keyDownEventHandler; + /** + * Constructs a WaitControl object. + * + * @param options The options to initialize the control. It has the following properties: + * { + * image: hostConfig.getResourcesFile('big-progress.gif'), // optional + * message: "Please wait...", // optional + * target: $('.feedbackrequest-form-container') // optional + * cancellable: true // optional + * cancelCallback: function() { // do something } // optional and only effective when cancellable is true + * } + * + * @return A WaitControl object. + */ + constructor(options?: TOptions); + initializeOptions(options: TOptions): void; + initialize(): void; + /** + * Starts waiting by displaying message box and overlay in the target element. + * + * @param cancelable A VSS.Core.Cancelable object for additional cancel state signaling. + * @publicapi + */ + startWait(cancellable?: Utils_Core.Cancelable): void; + /** + * Ends waiting by removing message box and overlay. + * @publicapi + */ + endWait(): void; + /** + * Cancels waiting by removing message box and overlay. + * @publicapi + */ + cancelWait(): void; + /** + * Sets a new message for the displayed message box. + * + * @param message Message to be displayed. + * @publicapi + */ + setMessage(message: string): void; + /** + * Indicates whether the operation is cancelled or not. + * + * @returns {boolean} + * @publicapi + */ + isCancelled(): boolean; + /** + * Determines if the current waiting session can be started. + */ + private _canStartWait(); + /** + * Determines if the current waiting session can be ended. + */ + private _canEndWait(); + /** + * Determines if the current waiting session can be cancelled. + */ + private _canCancelWait(); + /** + * Starts the waiting. + */ + private _startWait(); + /** + * Ends the waiting. + */ + private _tryEndWait(); + /** + * Cancels the waiting. + */ + private _tryCancelWait(); + /** + * Resets this wait control. + */ + private _reset(); + protected updateWaitElements(wait: IWaitControlOptions): void; + /** + * Shows the wait control. + */ + private _showWait(); + protected getWaitingState(): WaitingState; + protected getWaitingContext(): WaitContext; + /** + * Resizes the waiting control. + */ + private _resizeWait(); + /** + * Handles the keydown event. + * + * @param e + * @return + */ + private _onKeyDown(e?); + /** + * Handles the events to cancel wait. + * + * @param e + * @return + */ + private _handleCancelEvent(e?); + /** + * Binds the keydown event + * + * @param cancelLinkId The id of the cancel hyperlink. + */ + private _bindKeydownEvent(cancelLinkId); + /** + * Unbinds the keydown event + */ + private _unbindKeydownEvent(); + /** + * Removes the wait element. + */ + private _removeWaitElement(); + /** + * Removes the timers used by this controls. + */ + private _removeShowTimer(); + /** + * Gets the unique resize event id for the wait control. + * + * @return The resize event id. + */ + private _getResizeEventId(instanceId); + /** + * Gets the text message to show in the wait control. + * + * @param wait The wait options. + */ + private _getWaitMessage(wait); + getWaitMessageFormatString(): string; +} +export class WaitControl extends WaitControlO { +} +} +declare module "VSS/Controls/TreeView" { +import Combos = require("VSS/Controls/Combos"); +import Controls = require("VSS/Controls"); +export class TreeDataSource extends Controls.BaseDataSource { + root: any; + constructor(options?: any); + setSource(source: any): void; + /** + * @param source + */ + prepareSource(source?: any): void; + /** + * Update the flat content representation from the current tree + */ + updateItemsFromSource(): void; + /** + * @param all + * @param textOnly + * @return + */ + getItemText(index: any, all?: any, textOnly?: any): string; + /** + * @param startsWith + * @param all + */ + getItemIndex(itemText: any, startsWith?: any, all?: any): any; + expandNode(node: any): void; + collapseNode(node: any): void; + _initRoot(): void; + private _prepareCurrentItems(); +} +/** + * @publicapi + */ +export interface ITreeOptions { + /** + * List of nodes used by TreeView for rendering. TreeView only accepts nodes of concrete type TreeNode. Existing node hierarchy needs to be converted to TreeNode before providing to TreeView, see samples for details. + */ + nodes?: TreeNode[]; + /** + * Determines whether icons of the nodes are visible or not. + * @defaultvalue true + */ + showIcons?: boolean; + /** + * Determines whether clicking a node expands/collapses the node or not (if the node has children). + * @defaultvalue false + */ + clickToggles?: boolean; + /** + * Determines whether clicking a node selects the node or not. + * @defaultvalue true + */ + clickSelects?: boolean; + contextMenu?: any; + useEmptyFolderNodes?: boolean; + defaultEmptyFolderNodeText?: string; + styleFocusElement?: boolean; +} +/** + * @publicapi + */ +export class TreeNode { + /** + * @param text + * @param config + * @param children + * @return + */ + static create(text: string, config?: any, children?: TreeNode[]): TreeNode; + id: any; + root: boolean; + text: string; + parent: TreeNode; + children: TreeNode[]; + config: any; + expanded: boolean; + selected: boolean; + icon: any; + tag: any; + noFocus: boolean; + noContextMenu: boolean; + noTreeIcon: boolean; + folder: any; + type: any; + link: string; + title: string; + droppable: any; + iterationPath: string; + definition: any; + linkDelegate: any; + hasExpanded: boolean; + owner: any; + application: any; + emptyFolderNodeText: string; + isEmptyFolderChildNode: boolean; + isSearchHit: boolean; + /** + * @param text + * @param config + * @param children + */ + constructor(text: string, config?: any, children?: TreeNode[]); + hasChildren(): boolean; + clear(): void; + remove(): void; + add(node: TreeNode): void; + /** + * Move this node to reside under the specified new parent. + * + * @param newParent The destination to reparent the source under. + */ + moveTo(newParent: any): void; + addRange(nodes: any): void; + /** + * Finds a node using the given path + * + * @param path Path to find + * @param sepChar Path separator, if not given default will be used + * @param comparer Comparer used to compare nodes in the path, if not given default will be used + */ + findNode(path: string, sepChar?: string, comparer?: (a: string, b: string) => number): TreeNode; + sort(recursive: any, treeNodeComparer: any): void; + path(includeRoot: any, sepChar: any): any; + level(noRoot: any): number; + getContributionContext(): TreeNode; + private _ensureNodeId(); + private _sort(recursive, treeNodeComparer); +} +/** + * @publicapi + */ +export class TreeViewO extends Controls.Control { + static _typeName: string; + static NODE_DATA_NAME: string; + static LEVEL_DATA_NAME: string; + static EXPANDED_CLASS: string; + static COLLAPSED_CLASS: string; + private _focusDelegate; + private _blurDelegate; + private _dragStartDelegate; + private _hasFocus; + private _draggable; + private _droppable; + _focusedNode: JQuery; + private _popupMenu; + rootNode: TreeNode; + _selectedNode: TreeNode; + /** + * Creates new Grid Control + */ + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + _draw(): void; + /** + * Gets the DOM element associated with the specified node + + * @param node Node associated with the seeked DOM element + * @returns {JQuery} + */ + _getNodeElement(node: TreeNode): JQuery; + /** + * Gets the node associated with the element + * + * @param $element The jQuery object wrapping the tree node's DOM element + * @returns {TreeNode} + */ + _getNode($element: JQuery): TreeNode; + /** + * Gets the currently selected node. + * + * @returns {TreeNode} + * @publicapi + */ + getSelectedNode(): TreeNode; + /** + * Sets the specified node as selected. + + * @param node Node to be selected. + * @param suppressChangeEvent If specified true, "selectionChanged" event will not fire. + * @publicapi + */ + setSelectedNode(node: TreeNode, suppressChangeEvent?: boolean): void; + focus(): void; + _expandNodeParents(node: any, suppressChangeEvent?: boolean): void; + _updateSelections(): void; + _updateNode(li: JQuery, node: TreeNode, level: number): any; + /** + * @param level + */ + _drawChildren(node: TreeNode, nodeElement: any, level?: number): void; + /** + * @return + */ + _toggle(node: TreeNode, nodeElement: any, suppressChangeEvent?: boolean): any; + /** + * Ensure the tree node's expansion state is set to a particular value + * + * @param node The tree node + * @param nodeElement The element associated with the node + * @param expand The desired expand state of the node - true = expanded, false = collapsed + * @return true = the node's expansion state was changed, false otherwise + */ + _setNodeExpansion(node: TreeNode, nodeElement: JQuery, expand: boolean): boolean; + /** + * Removes the specified node from the tree. + * + * @param node Node to be removed. + * @publicapi + */ + removeNode(node: TreeNode): void; + /** + * Update the specified node by refreshing the child nodes if anything is added or removed. + * + * @param node Node to be updated. + * @publicapi + */ + updateNode(node: TreeNode): void; + /** + * @param e + * @return + */ + onItemClick(node: TreeNode, nodeElement: any, e?: JQueryEventObject): any; + onShowPopupMenu(node: TreeNode, options?: any): void; + /** + * Indicate whether the element that has focus should be styled differently. + * The current focus element will be updated to match the new preference + * + * @param enabled true, if focus element should be styled. + */ + enableFocusStyling(enabled: boolean): void; + _setFocusElement(element: JQuery): void; + /** + * Gets the node associated with the provided DOM/JQuery element. + * + * @param element Element to get the node for. + * @return {TreeNode} + * @publicapi + */ + getNodeFromElement(element: any): TreeNode; + private _drawNode(node, parentElement, level); + private _drawEmptyFolderNode(parentElement, level, text); + /** + * @param e + * @return + */ + private _click(e?); + /** + * Handle key down events (node selection & expansion) + * + * @param e + * @return + */ + _onInputKeyDown(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + private _onToggle(e?); + /** + * @param e + * @return + */ + private _itemClick(e?); + /** + * @param e + * @return + */ + private _onContextMenu(e?); + private _showPopupMenu(node); + /** + * @param e + * @return + */ + private _onFocus(e?); + /** + * @param e + * @return + */ + _onBlur(e?: JQueryEventObject): any; + _clearFocusOnElement(): void; + /** + * Suppress browser default drag behavior associated with the supplied element to prevent conflicting behavior (text selection/HTML5 default DnD) with JQuery Drag Drop. + * + * @param e + * @return + */ + private _onDragStart(e?); + /** + * Set the droppable + * + * @param droppable + */ + setDroppable(droppable: any): void; + private _getFirstTabbableChild(nodeElement); + private _setNodeElementExpandState(nodeElement, expand, hasChildren?); +} +export class TreeView extends TreeViewO { +} +export class ComboTreeDropPopup extends Combos.ComboListDropPopup { + /** + * @param options + */ + initializeOptions(options?: any): void; + expandNode(): boolean; + collapseNode(): boolean; + _createItem(index: any): any; + _onItemClick(e?: any, itemIndex?: any, $target?: any, $li?: any): boolean; + _getSelectedNode(): any; +} +export class ComboTreeBehavior extends Combos.ComboListBehavior { + constructor(combo: any, options?: any); + canType(): boolean; + /** + * @param e + * @return + */ + leftKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + rightKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyUp(e?: JQueryEventObject): any; + _createDataSource(): Controls.BaseDataSource; +} +export var ComboTreeBehaviorName: string; +export class SearchComboTreeBehavior extends Combos.ComboListBehavior { + private hitText; + private selectedHitIndex; + private originalNodes; + private lastSearchText; + private searchDebounceTimeout; + private debounceWaitTime; + private textHasChanged; + constructor(combo: any, options?: any); + initialize(): void; + canType(): boolean; + /** + * @param e + * @return + */ + leftKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + rightKey(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyDown(e?: JQueryEventObject): any; + /** + * @param e + * @return + */ + keyUp(e?: JQueryEventObject): any; + _createDataSource(): Controls.BaseDataSource; + private mouseUp(); + private clearSearchDebounce(); + private debounceSearch(waitInMilliseconds); + private isComboTextPath(); + private searchNodes(); + private _ensureOriginalNodesStored(); + private getNodesToSearch(searchText); + private createCopyOfSubtreeWhichMatchesSearch(searchText, nodesToSearch); + private stringContains(text, contains); + private modifyDatasourceAndDropdownWithResults(searchHitsFound); + private expandAncestors(node); + private performSearchHitProcessing(alreadyCopiedNodes, node); + private copyNodeToArray(array, node); + private copyNodeAndAncestorsToArray(array, node); + private copyDecendantsToArray(array, node); + private setHit(index); + private acceptSelectedIndex(); +} +export var SearchComboTreeBehaviorName: string; +export function flatten(node: any, items: any, all: any): void; +} +declare module "VSS/Controls/Validation" { +import Controls = require("VSS/Controls"); +export interface BaseValidatorOptions { + bindtokeystrokes?: boolean; + invalidCssClass?: string; + message?: string | (() => string); + group?: string; + allowEmptyString?: boolean; + testEmptyString?: boolean; +} +export class BaseValidator extends Controls.Enhancement { + static optionsPrefix: string; + static EVENT_VALIDATE: string; + static EVENT_VALIDATE_STATUS: string; + instanceId: any; + private _onValidationRequiredDelegate; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + initialize(): void; + dispose(): void; + getValue(): any; + /** + * @return + */ + isValid(): boolean; + getValidationGroup(): string; + getMessage(): string | (() => string); + onKeyUp(): void; + onChanged(): void; + onValidationRequired(e?: any, group?: any): void; + validate(): void; + private _testEmptyString(); +} +export class RequiredValidator extends BaseValidator { + static optionsPrefix: string; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @return + */ + isValid(): boolean; +} +export class RangeValidator extends BaseValidator { + static optionsPrefix: string; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @return + */ + isValid(): boolean; + getMessage(): string; +} +export interface RegexValidatorOptions extends BaseValidatorOptions { + regex?: string; +} +export class RegexValidator extends BaseValidator { + static optionsPrefix: string; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @return + */ + isValid(): boolean; + getMessage(): any; +} +export interface CustomValidatorOptions extends BaseValidatorOptions { + validate?: (val: any) => boolean; +} +export class CustomValidator extends BaseValidator { + static optionsPrefix: string; + /** + * A validator which checks the text in the input by passing it to a function, + * which then returns true if the input is valid, and false if it is invalid. + * + * @param options Options to apply to the validator: + * message: A message logged by the validation summary if the input is invalid / string + * testEmptyString: A boolean which indicates whether or not to test the empty string / boolean + * validate: The function to validate the input against + * + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: any): void; + /** + * Tests if the current input satisfies the function + * + * @return True if the input does satisfy, false if it does not + */ + isValid(): boolean; + /** + * Set the function the validator tests + * + * @param newFxn The new function to test against + */ + setValidate(newValidateFunction: any): void; + /** + * Gets the message that would be logged in the validation summary if the input were to be invalid + * + * @return The message + */ + getMessage(): string; +} +export interface DateValidatorOptions extends BaseValidatorOptions { + parseFormat?: string; +} +export class DateValidator extends BaseValidator { + static optionsPrefix: string; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @return + */ + isValid(): boolean; + getMessage(): any; +} +export interface IntegerRangeValidatorOptions extends BaseValidatorOptions { + minValue?: number; + maxValue?: number; +} +export class IntegerRangeValidator extends BaseValidator { + static optionsPrefix: string; + /** + * A validator that ensures only whole integers between an upper and lower limit are entered. + * + * @param options Options to apply to the validator: + * minValue: The minimum value (inclusive) + * maxValue: The maximum value (inclusive) + * + */ + constructor(options?: TOptions); + /** + * OVERRIDE: Determines whether the input control bound to this validator contains valid input + * + * @return True if valid, false otherwise + */ + isValid(): boolean; + isWithinBounds(value: string, max: number, min: number): boolean; + /** + * OVERRIDE: Gets the error message for display purposes + * + * @return The error message + */ + getMessage(): string; + /** + * Gets the min and max boundaries of the validator + * + * @return {min, max} + */ + private _getBounds(); +} +export interface MaxLengthValidatorOptions extends BaseValidatorOptions { + maxLength?: number; +} +export class MaxLengthValidator extends BaseValidator { + static optionsPrefix: string; + /** + * @param options + */ + constructor(options?: TOptions); + /** + * @param options + */ + initializeOptions(options?: TOptions): void; + /** + * @return + */ + isValid(): boolean; +} +export interface ValidationSummaryOptions { + context: Node; + group: string; +} +export class ValidationSummary extends Controls.Control { + private _messages; + private _ignoreUIUpdate; + private _fixedHeight; + private _singleMessage; + private _showAsWarning; + /** + * @param options + */ + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: ValidationSummaryOptions): void; + initialize(): void; + onValidationStatus(e?: any, validator?: any, group?: any, valid?: any): void; + validate(): void; + private _updateUI(); +} +/** + * @param validationResult + * @param context + * @return + */ +export function validateGroup(group: any, validationResult?: any[], context?: any): boolean; +} +declare module "VSS/Controls/Virtualization" { +import Controls = require("VSS/Controls"); +export class VirtualizingListView extends Controls.BaseControl { + private _itemsContainer; + private _scrollContainer; + private _scrollSpacer; + private _dataSource; + private _firstVisible; + private _selectedIndex; + private _rowHeight; + private _ignoreScrollEvent; + private _enableMouseOver; + private _prevMousePos; + visibleRowCount: number; + /** + * @param options + */ + initializeOptions(options?: any): void; + initialize(): void; + update(): void; + scrollItemIntoView(index: any): void; + /** + * @param page + * @return + */ + selectNext(page?: boolean): boolean; + /** + * @param page + * @return + */ + selectPrev(page?: boolean): boolean; + getSelectedIndex(): number; + /** + * @param noScrollIntoView + */ + setSelectedIndex(selectedIndex: number, noScrollIntoView?: boolean): void; + private _setVisibleBounds(visibleItemIndex); + private _createItem(index); + private _drawItems(); + private _updateItemStyles(); + private _setupScrollbar(height); + private _updateScrollbar(); + private _onScroll(e); + private _onMouseMove(e); + private _onMouseOver(e); + private _onMouseWheel(e); + private _onClick(e); + /** + * @param accept + */ + private _fireSelectionChanged(accept?); +} +} +declare module "VSS/DelegatedAuthorization/Contracts" { +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +export interface AccessTokenResult { + accessToken: VSS_Common_Contracts.JsonWebToken; + accessTokenError: TokenError; + authorizationId: string; + hasError: boolean; + refreshToken: RefreshTokenGrant; + tokenType: string; + validTo: Date; +} +export enum AppSessionTokenError { + None = 0, + UserIdRequired = 1, + ClientIdRequired = 2, + InvalidUserId = 3, + InvalidUserType = 4, + AccessDenied = 5, + FailedToIssueAppSessionToken = 6, + InvalidClientId = 7, + AuthorizationIsNotSuccessfull = 8, +} +export interface AuthorizationGrant { + grantType: GrantType; +} +export enum ClientType { + Confidential = 0, + Public = 1, + MediumTrust = 2, + HighTrust = 3, + FullTrust = 4, +} +export enum GrantType { + None = 0, + JwtBearer = 1, + RefreshToken = 2, + Implicit = 3, +} +export enum HostAuthorizationError { + None = 0, + ClientIdRequired = 1, + AccessDenied = 2, + FailedToAuthorizeHost = 3, + ClientIdNotFound = 4, + InvalidClientId = 5, +} +export interface RefreshTokenGrant extends AuthorizationGrant { + jwt: VSS_Common_Contracts.JsonWebToken; +} +export interface Registration { + clientType: ClientType; + identityId: string; + isValid: boolean; + isWellKnown: boolean; + organizationLocation: string; + organizationName: string; + /** + * Raw cert data string from public key. This will be used for authenticating medium trust clients. + */ + publicKey: string; + redirectUris: string[]; + registrationDescription: string; + registrationId: string; + registrationLocation: string; + registrationLogoSecureLocation: string; + registrationName: string; + registrationPrivacyStatementLocation: string; + registrationTermsOfServiceLocation: string; + responseTypes: string; + scopes: string; + secret: string; + secretVersionId: string; +} +export enum SessionTokenError { + None = 0, + DisplayNameRequired = 1, + InvalidDisplayName = 2, + InvalidValidTo = 3, + InvalidScope = 4, + UserIdRequired = 5, + InvalidUserId = 6, + InvalidUserType = 7, + AccessDenied = 8, + FailedToIssueAccessToken = 9, + InvalidClient = 10, + InvalidClientType = 11, + InvalidClientId = 12, + InvalidTargetAccounts = 13, + HostAuthorizationNotFound = 14, + AuthorizationNotFound = 15, + FailedToUpdateAccessToken = 16, + SourceNotSupported = 17, + InvalidSourceIP = 18, + InvalidSource = 19, +} +export enum SessionTokenType { + SelfDescribing = 0, + Compact = 1, +} +export enum TokenError { + None = 0, + GrantTypeRequired = 1, + AuthorizationGrantRequired = 2, + ClientSecretRequired = 3, + RedirectUriRequired = 4, + InvalidAuthorizationGrant = 5, + InvalidAuthorizationScopes = 6, + InvalidRefreshToken = 7, + AuthorizationNotFound = 8, + AuthorizationGrantExpired = 9, + AccessAlreadyIssued = 10, + InvalidRedirectUri = 11, + AccessTokenNotFound = 12, + InvalidAccessToken = 13, + AccessTokenAlreadyRefreshed = 14, + InvalidClientSecret = 15, + ClientSecretExpired = 16, + ServerError = 17, + AccessDenied = 18, + AccessTokenKeyRequired = 19, + InvalidAccessTokenKey = 20, + FailedToGetAccessToken = 21, + InvalidClientId = 22, + InvalidClient = 23, + InvalidValidTo = 24, + InvalidUserId = 25, + FailedToIssueAccessToken = 26, +} +export interface TokenPairResult { + accessToken: string; + hasError: boolean; + refreshToken: string; + tokenError: TokenError; +} +export var TypeInfo: { + AccessTokenResult: { + fields: any; + }; + AppSessionTokenError: { + enumValues: { + "none": number; + "userIdRequired": number; + "clientIdRequired": number; + "invalidUserId": number; + "invalidUserType": number; + "accessDenied": number; + "failedToIssueAppSessionToken": number; + "invalidClientId": number; + "authorizationIsNotSuccessfull": number; + }; + }; + AuthorizationGrant: { + fields: any; + }; + ClientType: { + enumValues: { + "confidential": number; + "public": number; + "mediumTrust": number; + "highTrust": number; + "fullTrust": number; + }; + }; + GrantType: { + enumValues: { + "none": number; + "jwtBearer": number; + "refreshToken": number; + "implicit": number; + }; + }; + HostAuthorizationError: { + enumValues: { + "none": number; + "clientIdRequired": number; + "accessDenied": number; + "failedToAuthorizeHost": number; + "clientIdNotFound": number; + "invalidClientId": number; + }; + }; + RefreshTokenGrant: { + fields: any; + }; + Registration: { + fields: any; + }; + SessionTokenError: { + enumValues: { + "none": number; + "displayNameRequired": number; + "invalidDisplayName": number; + "invalidValidTo": number; + "invalidScope": number; + "userIdRequired": number; + "invalidUserId": number; + "invalidUserType": number; + "accessDenied": number; + "failedToIssueAccessToken": number; + "invalidClient": number; + "invalidClientType": number; + "invalidClientId": number; + "invalidTargetAccounts": number; + "hostAuthorizationNotFound": number; + "authorizationNotFound": number; + "failedToUpdateAccessToken": number; + "sourceNotSupported": number; + "invalidSourceIP": number; + "invalidSource": number; + }; + }; + SessionTokenType: { + enumValues: { + "selfDescribing": number; + "compact": number; + }; + }; + TokenError: { + enumValues: { + "none": number; + "grantTypeRequired": number; + "authorizationGrantRequired": number; + "clientSecretRequired": number; + "redirectUriRequired": number; + "invalidAuthorizationGrant": number; + "invalidAuthorizationScopes": number; + "invalidRefreshToken": number; + "authorizationNotFound": number; + "authorizationGrantExpired": number; + "accessAlreadyIssued": number; + "invalidRedirectUri": number; + "accessTokenNotFound": number; + "invalidAccessToken": number; + "accessTokenAlreadyRefreshed": number; + "invalidClientSecret": number; + "clientSecretExpired": number; + "serverError": number; + "accessDenied": number; + "accessTokenKeyRequired": number; + "invalidAccessTokenKey": number; + "failedToGetAccessToken": number; + "invalidClientId": number; + "invalidClient": number; + "invalidValidTo": number; + "invalidUserId": number; + "failedToIssueAccessToken": number; + }; + }; + TokenPairResult: { + fields: any; + }; +}; +} +declare module "VSS/Diag" { +export var perfCollector: PerfTracePointCollector; +export var logLevel: number; +export function getDebugMode(): boolean; +export function setDebugMode(debugModeEnabled: boolean): void; +export enum StampEvent { + SinglePoint = 0, + Enter = 1, + Leave = 2, +} +export function timeStamp(label: string, event: StampEvent): void; +export class Measurement { + private label; + /** + * Begin new measurement + * + * @param label Name of the measurement + * @param callback Callback to end measurement + */ + static start(label: string, callback: (measurement: Measurement) => void): void; + constructor(label: string); + /** + * Ends this measurement + */ + finish(): void; +} +export enum LogVerbosity { + Off = 0, + Error = 1, + Warning = 2, + Info = 3, + Verbose = 4, +} +/** + * Log a message to the debug output windows and all other trace listeners + * + * @param level A log verbosity value from VSS.Diag.logVerbosity + * @param message Message to send to all trace listeners + */ +export function log(level: number, message: string): void; +export function logError(message: string): void; +export function logWarning(message: string): void; +export function logInfo(message: string): void; +export function logVerbose(message: string): void; +/** + * Add a listener to listen for logged messages + * + * @param callback A callback method that gets called whenever something is logged + */ +export function listen(callback: IResultCallback): void; +/** + * Remove a log message listener + * + * @param callback Listener to remove + */ +export function unlisten(callback: IResultCallback): void; +/** + * Updates the start/end trace points used when creating a profile. + * + * @param startTracePointName The trace point to begin the profile. + * @param endTracePointName The trace point that will ned the profile. + */ +export function profile(startTracePointName: string, endTracePointName: string): void; +/** + * Explicitly end the profile. + */ +export function profileEnd(): void; +/** + * Logs a trace point which can be consumed by a trace point collector for performance analysis. + * + * @param tracePointName Name of the trace point + * @param data (Optional) Data corresponding to the event that occurred. + */ +export function logTracePoint(tracePointName: string, data?: any): void; +/** + * Add a collector to handle trace points + * + * @param collector Method(tracePointName, data) called when trace points are logged. + */ +export function addTracePointCollector(collector: Function): void; +/** + * Remove a trace point collector + * + * @param collector Collector to remove + */ +export function removeTracePointCollector(collector: Function): void; +/** + * Sets the minimum level at which logged statements get captured and reported to the browser console. + * + * @param level Level which gets logged to the console + */ +export function setLogLevel(level: number): void; +export interface ITracePoint { + name: string; + time: number; + data: any; +} +export class PerfTracePointCollector { + private _tracePoints; + private _overallCounts; + private _activeCounts; + private _moduleInitTime; + private _lastResetTime; + private _lastResetIndex; + constructor(); + register(): void; + getOverallCount(tracePointName: string): number; + getActiveCount(tracePointName: string): number; + getLastTracePoint(tracePointName: string): ITracePoint; + getLastTracePointTime(tracePointName: string): number; + resetActiveCount(tracePointName: string): void; + resetActiveCounts(): void; + getModuleInitTime(): number; + getTracePoints(activeOnly: boolean): ITracePoint[]; + getTracePointCountData(tracePointNames: string[]): string; + dumpTracePoints(activeOnly: boolean): string; + private _updateCount(dictionary, eventName); + private _handleTracePoint(tracePointName, tracePointData); +} +export function measurePerformance(action: Function, message: string, logLevel?: LogVerbosity): void; +/** +* Any function calls to any members of this class will be stripped out in minified version, see WebPlatform.targets file AjaxMin task call with -debug switch. +* NOTE: You must use Diag or VSS_Diag as alias for the import statment for it to work. +* e.g. import Diag = require("VSS/Diag") +* This will be useful as follows +* 1) We will not have overhead of extra function calls in release version specially in the functions that are called many-many times (e.g. event handlers/processors) +* 2) The size of minified version will not be bloated with the size of message strings and function names +* 3) While debugging will still have flexibility to see the logs depending on the Log level +*/ +export class Debug { + /** + * Sets whether or not to display callers in the stack on assert failures. + * + * @param showCallers If true, display callers in the stack of assert failures. + */ + static setDisplayCallers(showCallers: boolean): void; + /** + * Displays a message in the debugger's output window and breaks into the debugger + * + * @param message Message to display in the debugger's output window + */ + static fail(message: string): void; + /** + * Checks for a condition, and if the condition is false, displays a message and prompts the user to break into the debuggeription + * + * @param condition true to continue to execute code; false to display message and break into the debugger + * @param message (Optional) The message to display. The default is an empty string + */ + static assert(condition: boolean, message?: string): void; + /** + * Assert that the value is an object and not null. + * + * @param value Value to ensure is an object. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsObject(value: any, message?: string): void; + /** + * Assert that the value is an object and not null. + * + * @param value Value to ensure is an object. + * @param paramName Name of the parameter that this value is associated with. + * @param optional If true then the assert will accept falsy values + */ + static assertParamIsObject(value: any, paramName: string, optional?: boolean): void; + /** + * Assert that the value is an array. + * + * @param value Value to ensure is an array. + * @param message (Optional) The message to display. The default is an empty string + * @param requireNotEmpty (Optional) If true the array will be checked to ensure it is not empty. + */ + static assertIsArray(value: any, message?: string, requireNotEmpty?: boolean): void; + /** + * Assert that the value is an array. + * + * @param value Value to ensure is an array. + * @param paramName (Optional) Name of the parameter that this value is associated with. + * @param requireNotEmpty (Optional) If true the array will be checked to ensure it is not empty. + */ + static assertParamIsArray(value: any, paramName?: string, requireNotEmpty?: boolean): void; + /** + * Assert that the value is a boolean. + * + * @param value Value to ensure is a boolean. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsBool(value: boolean, message?: string): void; + /** + * Assert that the value is a boolean. + * + * @param value Value to ensure is a boolean. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsBool(value: boolean, paramName: string): void; + /** + * Assert that the value is a number. + * + * @param value Value to ensure is a number. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsNumber(value: number, message?: string): void; + /** + * Assert that the value is a number. + * + * @param value Value to ensure is a number. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsNumber(value: number, paramName: string): void; + /** + * Assert that the value is an integer. + * + * @param value Value to ensure is an integer. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsInteger(value: number, message?: string): void; + /** + * Assert that the value is an integer. + * + * @param value Value to ensure is an integer. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsInteger(value: number, paramName: string): void; + /** + * Assert that the value is a string. + * + * @param value Value to ensure is a string. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsString(value: string, message?: string): void; + /** + * Assert that the value is a string. + * + * @param value Value to ensure is a string. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsString(value: string, paramName: string): void; + /** + * Assert that the value is a string and not empty. + * + * @param value Value to ensure is a string and not empty. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsStringNotEmpty(value: string, message?: string): void; + /** + * Assert that the value is a string and not empty. + * + * @param value Value to ensure is a string and not empty. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsStringNotEmpty(value: string, paramName: string): void; + /** + * Assert that the value is a function. + * + * @param value Value to ensure is a function. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsFunction(value: any, message?: string): void; + /** + * Assert that the value is a function. + * + * @param value Value to ensure is a function. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsFunction(value: any, paramName: string): void; + /** + * Assert that the value is a date. + * + * @param value Value to ensure is a date. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsDate(value: any, message?: string): void; + /** + * Assert that the value is a date. + * + * @param value Value to ensure is a date. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsDate(value: any, paramName: string): void; + /** + * Assert that the value is not null or undefined. + * + * @param value Value to ensure is not null or undefined. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsNotNull(value: any, message?: string): void; + /** + * Assert that the value is not null or undefined. + * + * @param value Value to ensure is not null or undefined. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsNotNull(value: any, paramName: string): void; + /** + * Assert that the value is not undefined. + * + * @param value Value to ensure is not undefined. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsNotUndefined(value: any, message?: string): void; + /** + * Assert that the value is undefined. + * + * @param value Value to ensure is not undefined. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsNotUndefined(value: any, paramName: string): void; + /** + * Assert that the value is a jQuery object. + * + * @param value Value to ensure is a jQuery object. + * @param message (Optional) The message to display. The default is an empty string + */ + static assertIsJQueryObject(value: any, message?: string): void; + /** + * Assert that the value is a jQuery object. + * + * @param value Value to ensure is a jQuery object. + * @param paramName Name of the parameter that this value is associated with. + */ + static assertParamIsJQueryObject(value: any, paramName: string): void; + /** + * Assert that the value is an instance of the expected type. + * + * @param value The value to test for the correct type + * @param type Either the constructor function for a type, + * or a string matching the return value of the typeof operator. This specified the type + * to test for. + * @param message The messge to display on Debug.failure. + * @param optional Flag to determine whether null and undefined are accepted as values. + */ + static assertIsType(value: any, type: any, message: string, optional?: boolean): void; + /** + * Gets the display name for a type. + * + * @param type The string value (from the typeof operator) or a constructor function. + * @return + */ + static getTypeName(type: any): string; + /** + * Assert that the parameter is an instance of the expected type. + * + * @param value The value to test for the correct type + * @param type Either the constructor function for a type, + * or a string matching the return value of the typeof operator. This specified the type + * to test for. + * @param paramName The name of the parameter. + * @param optional Flag to determine whether null and undefined are accepted as values. + */ + static assertParamIsType(value: any, type: any, paramName: string, optional?: boolean): void; + static logInfo(message: string): void; + static logVerbose(message: string): void; +} +} +declare module "VSS/Diag/Services" { +import Service = require("VSS/Service"); +export interface Statistic { + name: string; + id: string; + parentId?: string; +} +export interface ClientActivityStatistic extends Statistic { + startOffset: number; + duration: number; +} +export interface ActivityStatistic extends Statistic { + actionDate: Date; + status?: number; +} +export interface ActivtyStatsCollectionAllowedCallback { + (): boolean; +} +export class ActivityStatsCollector implements Service.ILocalService { + static ACTIVITY_COLLECTION_STATUS: string; + static ACTIVITY_ID_STORAGE_ITEM: string; + static ACTIVITY_CLIENT_STATE_STORAGE_ITEM: string; + static CURRENT_PAGE: string; + private _activtyIdHeader; + private _progressPendingActions; + private _progressPendingActionsNewId; + private _activtyStatsCollectionAllowedCallbacks; + /** + * Global handler for logging activity data + */ + constructor(); + initialize(): void; + addActivtyStatsCollectionAllowedCallback(callback: ActivtyStatsCollectionAllowedCallback): void; + actionStarted(name: string): number; + actionCompleted(id: number, jqXHR: JQueryXHR): void; + logActivity(activityId: string, page: string): void; + logClientStats(): void; + private _createClientStat(name, startOffset, endOffset, id); + getClientStatistics(): IDictionaryStringTo; + getActivityStatistics(): ActivityStatistic[]; + clearStats(): void; + collectStats(shouldCollect: boolean): void; + getCurrentPage(): ActivityStatistic; + setCurrentPage(currentPage: ActivityStatistic): void; + isCollectingStats(): boolean; + private _saveActivity(stat, isCurrentPage?); + private _saveClientActivity(id, stat); + private _allowStatsCollection(); +} +} +declare module "VSS/Error" { +/** + * publish error to telemetry service + */ +export function publishErrorToTelemetry(error: TfsError, immediate?: boolean): void; +} +declare module "VSS/Events/Action" { +import Service = require("VSS/Service"); +export interface IActionWorker { + (actionArgs: any, next: (actionArgs: any) => any): any; +} +export class ActionService implements Service.ILocalService { + static MaxOrder: any; + private _actionWorkers; + /** + * Register a handler for an action. The handler participates in the Chain of Responsibility pattern. + * + * @param action The action to register + * @param actionWorker Function(actionArgs, next), The handler to invoke for the given action when the performAction + * operation is called for the registered action. + * The function is passed the action arguments for next which it should call with the actionsArgs UNLESS + * it explicitly wants to be the end of the chain. + * e.g. + * registerActionWorker('some.action', function (actionArgs, next) { + * if (iCanHandle(actionArgs)) { + * return doProcessing(actionArgs); + * } + * else { + * return next(actionArgs); + * } + * }, 50); + * + * if ActionWorker functions are asynchronous they can still participate in the chain + * + * registerActionWorker('some.async.action', function (actionArgs, next) { + * beginDoSomeStuff(function (result) { + * if (that.imDone(results)) { + * actionArgs.onSuccess.call(this, results); + * } + * else { + * next(actionArgs); + * } + * }); + * }, 50); + * + * @param order The order of the action (default:100). + * Action workers are executed in increasing order. Order must be less than MaxOrder (inclusive) + */ + registerActionWorker(action: string, actionWorker: IActionWorker, order?: number): void; + /** + * Un-Register a handler for an action. + * + * @param action The action to un-register + * @param actionWorker Function(actionArgs, next), The IActionWorker that was registered. + */ + unregisterActionWorker(action: string, actionWorker: IActionWorker): void; + /** + * Invoke the registered action workers for the an action + * + * @param action The action identifier + * @param actionArgs An object passed to the registered action workers. + */ + performAction(action: string, actionArgs?: any): any; + /** + * Clears all action workers + */ + clearActionWorkers(): void; + /** + * Manage actions and the workers that are invoked when those actions are performed. + * Action workers register to handle specific actions. They take whatever action they desire + * and usually call the "next" handler in the chain (see the Chain of Responsibility pattern). + */ + constructor(); +} +export module CommonActions { + var ACTION_WINDOW_OPEN: string; + var ACTION_WINDOW_NAVIGATE: string; + var ACTION_WINDOW_RELOAD: string; + var ACTION_WINDOW_UNLOAD: string; +} +export function getService(): ActionService; +} +declare module "VSS/Events/Document" { +import Service = require("VSS/Service"); +/** + * Represents a document to a host. + * A host can be tha browser, an IDE (e.g. Eclipse, Visual Studio) + */ +export interface RunningDocument { + isDirty(): boolean; +} +export interface RunningDocumentsTableEntry { + document: RunningDocument; + moniker: string; +} +export class RunningDocumentsTable implements Service.ILocalService { + private _runningDocEntries; + constructor(); + /** + * Add specified document to the running document table + * The document must have a method named isDirty that returns boolean + * + * @param moniker Name for this document type + * @param document Object that will be called to determine state (e.g. dirty//modified) + * @return A handle to the entry in the running document table. The handle can be used to remove the entry + */ + add(moniker: string, document: RunningDocument): RunningDocumentsTableEntry; + /** + * Remove an entry from the running document table + * + * @param entry The handle to the entry that will be removed. The handle is returned from the add function + */ + remove(entry: RunningDocumentsTableEntry): void; + /** + * Check if the specified document is modified. If specified moniker is null or undefined + * will return true if any currently opened documents are modified + * + * @param moniker Name for this document type + * @return True if the specified moniker\document is modified, false otherwise. + * Null or undefined moniker will return true if any opened documents are modified + */ + isModified(moniker?: string): boolean; + beginSave(callback: IResultCallback, errorCallback?: IErrorCallback): void; + getUnsavedItemsMessage(): string; + private _isAnyModified(); +} +export interface Document { + save(successCallback: IResultCallback, errorCallback?: IErrorCallback): void; + getMoniker(): string; +} +/** +* Service for host environment to interact with documents in Web Access +* A host environment can be tha browser, an IDE (e.g. Eclipse, Visual Studio) +*/ +export class DocumentService implements Service.ILocalService { + private _activeDocument; + private _runningDocumentsTable; + constructor(); + addDeleteListener(callBack: Function): void; + removeDeleteListener(callBack: IEventHandler): void; + addBuildPropertyChangedListener(callBack: IEventHandler): void; + removeBuildPropertyChangedListener(callBack: IEventHandler): void; + addBuildStoppedListener(callBack: IEventHandler): void; + removeBuildStoppedListener(callBack: IEventHandler): void; + addModifiedChangedListener(callBack: IEventHandler): void; + removeModifiedChangedListener(callBack: IEventHandler): void; + isModified(args?: string): boolean; + save(successCallback: IResultCallback, errorCallback?: IErrorCallback): void; + getActiveDocument(): Document; + setActiveDocument(activeDocument: Document): void; +} +export function getService(): DocumentService; +export function getRunningDocumentsTable(): RunningDocumentsTable; +} +declare module "VSS/Events/Services" { +import Service = require("VSS/Service"); +export class EventService implements Service.ILocalService { + private _events; + fire(eventName: string, sender?: any, eventArgs?: any): boolean; + /** + * Attatch a handler to an event. + * + * @param eventName The event name. + * @param handler The handler to attach. + */ + attachEvent(eventName: string, handler: IEventHandler): void; + /** + * Detatch a handler from an event. + * + * @param eventName The event name. + * @param handler The handler to detach. + */ + detachEvent(eventName: string, handler: IEventHandler): void; + /** + * Invoke the specified event passing the specified arguments. + * + * @param eventName The event to invoke. + * @param sender The sender of the event. + * @param args The arguments to pass through to the specified event. + */ + private _fireEvent(eventName, sender?, args?); +} +export function getService(): EventService; +} +declare module "VSS/ExtensionManagement/Contracts" { +import VSS_Identities_Contracts = require("VSS/Identities/Contracts"); +/** + * An individual contribution made by an extension + */ +export interface Contribution extends ContributionBase { + /** + * List of constraints (filters) that should be applied to the availability of this contribution + */ + constraints: ContributionConstraint[]; + /** + * Properties/attributes of this contribution + */ + properties: any; + /** + * The ids of the contribution(s) that this contribution targets. (parent contributions) + */ + targets: string[]; + /** + * Id of the Contribution Type + */ + type: string; +} +/** + * Base class shared by contributions and contribution types + */ +export interface ContributionBase { + /** + * Description of the contribution/type + */ + description: string; + /** + * Extension-relative identifier of the contribution/type + */ + id: string; +} +/** + * Specifies a constraint that can be used to dynamically include/exclude a given contribution + */ +export interface ContributionConstraint { + /** + * An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included). + */ + group: number; + /** + * If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true) + */ + inverse: boolean; + /** + * Name of the IContributionFilter class + */ + name: string; + /** + * Properties that are fed to the contribution filter class + */ + properties: any; +} +/** + * Identifier for contributions and contribution types + */ +export interface ContributionIdentifier { + /** + * The extension id + */ + extensionId: string; + /** + * The full/unique identifier of the contribution/contributionType + */ + id: string; + /** + * The publisher id + */ + publisherId: string; + /** + * The extension-relative contribution id + */ + relativeId: string; +} +/** + * Description about a property of a contribution type + */ +export interface ContributionPropertyDescription { + /** + * Description of the property + */ + description: string; + /** + * Name of the property + */ + name: string; + /** + * True if this property is required + */ + required: boolean; + /** + * The type of value used for this property + */ + type: ContributionPropertyType; +} +export enum ContributionPropertyType { + /** + * Contribution type is unknown (value may be anything) + */ + Unknown = 0, + /** + * Value is a string + */ + String = 1, + /** + * Value is a Uri + */ + Uri = 2, + /** + * Value is a GUID + */ + Guid = 4, + /** + * Value is True or False + */ + Boolean = 8, + /** + * Value is an integer + */ + Integer = 16, + /** + * Value is a double + */ + Double = 32, + /** + * Value is a DateTime object + */ + DateTime = 64, + /** + * Value is a generic Dictionary/JObject/property bag + */ + Dictionary = 128, + /** + * Value is an array + */ + Array = 256, + /** + * Value is an arbitrary/custom object + */ + Object = 512, +} +/** + * A contribution type, given by a json schema + */ +export interface ContributionType extends ContributionBase { + /** + * Controls whether or not contributions of this type have the type indexed for queries. This allows clients to find all extensions that have a contribution of this type. NOTE: Only TrustedPartners are allowed to specify indexed contribution types. + */ + indexed: boolean; + /** + * Friendly name of the contribution/type + */ + name: string; + /** + * Describes the allowed properties for this contribution type + */ + properties: { + [key: string]: ContributionPropertyDescription; + }; +} +/** + * Represents a VSO "extension" which is a container for contributions and contribution types + */ +export interface Extension extends ExtensionManifest { + /** + * The friendly extension id for this extension - unique for a given publisher. + */ + extensionId: string; + /** + * The display name of the extension. + */ + extensionName: string; + /** + * Extension flags relevant to contribution consumers + */ + flags: ExtensionFlags; + /** + * Globally unique id for this extension (the same id is used for all versions of a single extension) + */ + id: string; + /** + * Unique id of the publisher of this extension + */ + publisherId: string; + /** + * The display name of the publisher + */ + publisherName: string; + /** + * Unique id for this extension (the same id is used for all versions of a single extension) + */ + registrationId: string; + /** + * Version of this extension + */ + version: string; +} +/** + * Represents a single collection for extension data documents + */ +export interface ExtensionDataCollection { + /** + * The name of the collection + */ + collectionName: string; + /** + * A list of documents belonging to the collection + */ + documents: any[]; + /** + * The type of the collection's scope, such as Default or User + */ + scopeType: string; + /** + * The value of the collection's scope, such as Current or Me + */ + scopeValue: string; +} +/** + * Represents a query to receive a set of extension data collections + */ +export interface ExtensionDataCollectionQuery { + /** + * A list of collections to query + */ + collections: ExtensionDataCollection[]; +} +/** + * Base class for an event callback for an extension + */ +export interface ExtensionEventCallback { + /** + * The uri of the endpoint that is hit when an event occurs + */ + uri: string; +} +/** + * Collection of event callbacks - endpoints called when particular extension events occur. + */ +export interface ExtensionEventCallbackCollection { + /** + * For multi-version extensions, defines an endpoint that gets called via an OPTIONS request to determine the particular version of the extension to be used + */ + versionCheck: ExtensionEventCallback; +} +export enum ExtensionFlags { + /** + * A built-in extension is installed for all VSO accounts by default + */ + BuiltIn = 1, + /** + * The extension comes from a fully-trusted publisher + */ + Trusted = 2, +} +export interface ExtensionIdentifier { + extensionName: string; + publisherName: string; +} +/** + * Base class for extension properties which are shared by the extension manifest and the extension model + */ +export interface ExtensionManifest { + /** + * Uri used as base for other relative uri's defined in extension + */ + baseUri: string; + /** + * List of contributions made by this extension + */ + contributions: Contribution[]; + /** + * List of contribution types defined by this extension + */ + contributionTypes: ContributionType[]; + /** + * Collection of endpoints that get called when particular extension events occur + */ + eventCallbacks: ExtensionEventCallbackCollection; + /** + * Language Culture Name set by the Gallery + */ + language: string; + /** + * Version of the extension manifest format/content + */ + manifestVersion: number; + /** + * List of all oauth scopes required by this extension + */ + scopes: string[]; +} +/** + * Policy with a set of permissions on extension operations + */ +export interface ExtensionPolicy { + /** + * Permissions on 'Install' operation + */ + install: ExtensionPolicyFlags; + /** + * Permission on 'Request' operation + */ + request: ExtensionPolicyFlags; +} +export enum ExtensionPolicyFlags { + /** + * No permission + */ + None = 0, + /** + * Permission on private extensions + */ + Private = 1, + /** + * Permission on public extensions + */ + Public = 2, + /** + * Premission in extensions that are in preview + */ + Preview = 4, + /** + * Premission in relased extensions + */ + Released = 8, + /** + * Permission in 1st party extensions + */ + FirstParty = 16, + /** + * Mask that defines all permissions + */ + All = 31, +} +/** + * A request for an extension (to be installed or have a license assigned) + */ +export interface ExtensionRequest { + /** + * Required message supplied if the request is rejected + */ + rejectMessage: string; + /** + * Date at which the request was made + */ + requestDate: Date; + /** + * Represents the user who made the request + */ + requestedBy: VSS_Identities_Contracts.Identity; + /** + * Optional message supplied by the requester justifying the request + */ + requestMessage: string; + /** + * Represents the state of the request + */ + requestState: ExtensionRequestState; + /** + * Date at which the request was resolved + */ + resolveDate: Date; + /** + * Represents the user who resolved the request + */ + resolvedBy: VSS_Identities_Contracts.Identity; +} +export enum ExtensionRequestState { + /** + * The request has been opened, but not yet responded to + */ + Open = 0, + /** + * The request was accepted (extension installed or license assigned) + */ + Accepted = 1, + /** + * The request was rejected (extension not installed or license not assigned) + */ + Rejected = 2, +} +/** + * The state of an extension + */ +export interface ExtensionState extends InstalledExtensionState { + extensionId: string; + extensionName: string; + /** + * The time at which the version was last checked + */ + lastVersionCheck: Date; + publisherName: string; + /** + * Version of this extension + */ + version: string; +} +export enum ExtensionStateFlags { + /** + * No flags set + */ + None = 0, + /** + * Extension is disabled + */ + Disabled = 1, + /** + * Extension is a built in + */ + BuiltIn = 2, + /** + * Extension has multiple versions + */ + MultiVersion = 4, + /** + * Extension is not installed. This is for builtin extensions only and can not otherwise be set. + */ + UnInstalled = 8, + /** + * Error performing version check + */ + VersionCheckError = 16, + /** + * Trusted extensions are ones that are given special capabilities. These tend to come from Microsoft and can't be published by the general public. Note: BuiltIn extensions are always trusted. + */ + Trusted = 32, +} +/** + * Represents a VSO extension along with its installation state + */ +export interface InstalledExtension extends Extension { + /** + * Information about this particular installation of the extension + */ + installState: InstalledExtensionState; +} +export interface InstalledExtensionQuery { + monikers: ExtensionIdentifier[]; +} +/** + * The state of an installed extension + */ +export interface InstalledExtensionState { + /** + * States of an installed extension + */ + flags: ExtensionStateFlags; + /** + * The time at which this installation was last updated + */ + lastUpdated: Date; +} +/** + * Represents a the Publisher of an extension in ExtensionManagement + */ +export interface Publisher { + /** + * The display name for a publisher + */ + displayName: string; + /** + * The unique name for a Publisher + */ + publisherName: string; +} +/** + * A request for an extension (to be installed or have a license assigned) + */ +export interface RequestedExtension { + /** + * THe unique name of the extensions + */ + extensionName: string; + /** + * A list of each request for the extension + */ + extensionRequests: ExtensionRequest[]; + /** + * Represents the Publisher of the requested extension + */ + publisher: Publisher; + /** + * The total number of requests for an extension + */ + requestCount: number; +} +export interface Scope { + description: string; + title: string; + value: string; +} +/** + * Information about the extension + */ +export interface SupportedExtension { + /** + * Unique Identifier for this extension + */ + extension: string; + /** + * Unique Identifier for this publisher + */ + publisher: string; + /** + * Supported version for this extension + */ + version: string; +} +/** + * Represents the extension policy applied to a given user + */ +export interface UserExtensionPolicy { + /** + * User display name that this policy refers to + */ + displayName: string; + /** + * The extension policy applied to the user + */ + permissions: ExtensionPolicy; + /** + * User id that this policy refers to + */ + userId: string; +} +export var TypeInfo: { + Contribution: { + fields: any; + }; + ContributionBase: { + fields: any; + }; + ContributionConstraint: { + fields: any; + }; + ContributionIdentifier: { + fields: any; + }; + ContributionPropertyDescription: { + fields: any; + }; + ContributionPropertyType: { + enumValues: { + "unknown": number; + "string": number; + "uri": number; + "guid": number; + "boolean": number; + "integer": number; + "double": number; + "dateTime": number; + "dictionary": number; + "array": number; + "object": number; + }; + }; + ContributionType: { + fields: any; + }; + Extension: { + fields: any; + }; + ExtensionDataCollection: { + fields: any; + }; + ExtensionDataCollectionQuery: { + fields: any; + }; + ExtensionEventCallback: { + fields: any; + }; + ExtensionEventCallbackCollection: { + fields: any; + }; + ExtensionFlags: { + enumValues: { + "builtIn": number; + "trusted": number; + }; + }; + ExtensionIdentifier: { + fields: any; + }; + ExtensionManifest: { + fields: any; + }; + ExtensionPolicy: { + fields: any; + }; + ExtensionPolicyFlags: { + enumValues: { + "none": number; + "private": number; + "public": number; + "preview": number; + "released": number; + "firstParty": number; + "all": number; + }; + }; + ExtensionRequest: { + fields: any; + }; + ExtensionRequestState: { + enumValues: { + "open": number; + "accepted": number; + "rejected": number; + }; + }; + ExtensionState: { + fields: any; + }; + ExtensionStateFlags: { + enumValues: { + "none": number; + "disabled": number; + "builtIn": number; + "multiVersion": number; + "unInstalled": number; + "versionCheckError": number; + "trusted": number; + }; + }; + InstalledExtension: { + fields: any; + }; + InstalledExtensionQuery: { + fields: any; + }; + InstalledExtensionState: { + fields: any; + }; + Publisher: { + fields: any; + }; + RequestedExtension: { + fields: any; + }; + Scope: { + fields: any; + }; + SupportedExtension: { + fields: any; + }; + UserExtensionPolicy: { + fields: any; + }; +}; +} +declare module "VSS/ExtensionManagement/RestClient" { +import Contracts = require("VSS/ExtensionManagement/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class ExtensionManagementHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} contributionId + * @return IPromise + */ + getContributions(contributionId: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + createDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + deleteDocument(extensionId: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + getDocument(extensionId: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + getDocuments(extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + setDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + updateDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + createDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + deleteDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + getDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + getDocumentsByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + setDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + updateDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionDataCollectionQuery} collectionQuery + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + queryCollectionsByName(collectionQuery: Contracts.ExtensionDataCollectionQuery, publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @return IPromise + */ + getScopes(extensionId: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + getScopesByName(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {boolean} includeDisabled + * @return IPromise + */ + getStates(includeDisabled?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.InstalledExtensionQuery} query + * @return IPromise + */ + queryExtensions(query: Contracts.InstalledExtensionQuery): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + getInstalledExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {string[]} contributionIdFilter + * @param {boolean} includeDisabledExtensions + * @return IPromise + */ + getInstalledExtensions(contributionIdFilter?: string[], includeDisabledExtensions?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.InstalledExtension} extension + * @return IPromise + */ + installExtension(extension: Contracts.InstalledExtension): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + uninstallExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.InstalledExtension} extension + * @param {string} extensionId + * @return IPromise + */ + updateInstalledExtension(extension: Contracts.InstalledExtension, extensionId?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + getInstalledExtensionByName(publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + installExtensionByName(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + uninstallExtensionByName(publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} userId + * @return IPromise + */ + getPolicies(userId: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} requesterId + * @param {Contracts.ExtensionRequestState} state + * @param {string} rejectMessage + * @return IPromise + */ + resolveRequest(publisherName: string, extensionName: string, requesterId: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getRequests(): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {Contracts.ExtensionRequestState} state + * @param {string} rejectMessage + * @return IPromise + */ + resolveAllRequests(publisherName: string, extensionName: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + deleteRequest(publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} requestMessage + * @return IPromise + */ + requestExtension(publisherName: string, extensionName: string, requestMessage?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getToken(): IPromise; +} +export class ExtensionManagementHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} contributionId + * @return IPromise + */ + getContributions(contributionId: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + createDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + deleteDocument(extensionId: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + getDocument(extensionId: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + getDocuments(extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + setDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + updateDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + createDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + deleteDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + getDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + getDocumentsByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + setDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} publisherName + * @param {string} extensionName + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + updateDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @return IPromise + */ + getScopes(extensionId: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + getScopesByName(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {boolean} includeDisabled + * @return IPromise + */ + getStates(includeDisabled?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.InstalledExtensionQuery} query + * @return IPromise + */ + queryExtensions(query: Contracts.InstalledExtensionQuery): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + getInstalledExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {string[]} contributionIdFilter + * @param {boolean} includeDisabledExtensions + * @return IPromise + */ + getInstalledExtensions(contributionIdFilter?: string[], includeDisabledExtensions?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.InstalledExtension} extension + * @return IPromise + */ + installExtension(extension: Contracts.InstalledExtension): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + uninstallExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.InstalledExtension} extension + * @param {string} extensionId + * @return IPromise + */ + updateInstalledExtension(extension: Contracts.InstalledExtension, extensionId?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + getInstalledExtensionByName(publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + installExtensionByName(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + uninstallExtensionByName(publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} requesterId + * @param {Contracts.ExtensionRequestState} state + * @param {string} rejectMessage + * @return IPromise + */ + resolveRequest(publisherName: string, extensionName: string, requesterId: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getRequests(): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {Contracts.ExtensionRequestState} state + * @param {string} rejectMessage + * @return IPromise + */ + resolveAllRequests(publisherName: string, extensionName: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + deleteRequest(publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} requestMessage + * @return IPromise + */ + requestExtension(publisherName: string, extensionName: string, requestMessage?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getToken(): IPromise; +} +export class ExtensionManagementHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} contributionId + * @return IPromise + */ + getContributions(contributionId: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + createDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + deleteDocument(extensionId: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @param {string} documentId + * @return IPromise + */ + getDocument(extensionId: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + getDocuments(extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + setDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {any} doc + * @param {string} extensionId + * @param {string} scopeType + * @param {string} scopeValue + * @param {string} collectionName + * @return IPromise + */ + updateDocument(doc: any, extensionId: string, scopeType: string, scopeValue: string, collectionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @return IPromise + */ + getScopes(extensionId: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + getInstalledExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {string[]} contributionIdFilter + * @param {boolean} includeDisabledExtensions + * @return IPromise + */ + getInstalledExtensions(contributionIdFilter?: string[], includeDisabledExtensions?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.InstalledExtension} extension + * @return IPromise + */ + installExtension(extension: Contracts.InstalledExtension): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @return IPromise + */ + uninstallExtension(extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.InstalledExtension} extension + * @param {string} extensionId + * @return IPromise + */ + updateInstalledExtension(extension: Contracts.InstalledExtension, extensionId?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} requesterId + * @param {Contracts.ExtensionRequestState} state + * @param {string} rejectMessage + * @return IPromise + */ + resolveRequest(publisherName: string, extensionName: string, requesterId: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getRequests(): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {Contracts.ExtensionRequestState} state + * @param {string} rejectMessage + * @return IPromise + */ + resolveAllRequests(publisherName: string, extensionName: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + deleteRequest(publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} requestMessage + * @return IPromise + */ + requestExtension(publisherName: string, extensionName: string, requestMessage?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getToken(): IPromise; +} +export class ExtensionManagementHttpClient extends ExtensionManagementHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return ExtensionManagementHttpClient2_1 + */ +export function getClient(): ExtensionManagementHttpClient2_1; +} +declare module "VSS/FeatureAvailability/Contracts" { +export interface FeatureFlag { + description: string; + effectiveState: string; + explicitState: string; + name: string; + uri: string; +} +/** + * This is passed to the FeatureFlagController to edit the status of a feature flag + */ +export interface FeatureFlagPatch { + state: string; +} +export var TypeInfo: { + FeatureFlag: { + fields: any; + }; + FeatureFlagPatch: { + fields: any; + }; +}; +} +declare module "VSS/FeatureAvailability/RestClient" { +import Contracts = require("VSS/FeatureAvailability/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class FeatureAvailabilityHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] Retrieve a listing of all feature flags and their current states for a user + * + * @param {string} userEmail - The email of the user to check + * @return IPromise + */ + getAllFeatureFlags(userEmail?: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states + * + * @param {string} name - The name of the feature to retrieve + * @return IPromise + */ + getFeatureFlagByName(name: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states for a user + * + * @param {string} name - The name of the feature to retrieve + * @param {string} userEmail - The email of the user to check + * @return IPromise + */ + getFeatureFlagByNameAndUserEmail(name: string, userEmail: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states for a user + * + * @param {string} name - The name of the feature to retrieve + * @param {string} userId - The id of the user to check + * @return IPromise + */ + getFeatureFlagByNameAndUserId(name: string, userId: string): IPromise; + /** + * [Preview API] Change the state of an individual feature flag for a name + * + * @param {Contracts.FeatureFlagPatch} state - State that should be set + * @param {string} name - The name of the feature to change + * @param {string} userEmail + * @return IPromise + */ + updateFeatureFlag(state: Contracts.FeatureFlagPatch, name: string, userEmail?: string): IPromise; +} +export class FeatureAvailabilityHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] Retrieve a listing of all feature flags and their current states for a user + * + * @param {string} userEmail - The email of the user to check + * @return IPromise + */ + getAllFeatureFlags(userEmail?: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states + * + * @param {string} name - The name of the feature to retrieve + * @return IPromise + */ + getFeatureFlagByName(name: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states for a user + * + * @param {string} name - The name of the feature to retrieve + * @param {string} userEmail - The email of the user to check + * @return IPromise + */ + getFeatureFlagByNameAndUserEmail(name: string, userEmail: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states for a user + * + * @param {string} name - The name of the feature to retrieve + * @param {string} userId - The id of the user to check + * @return IPromise + */ + getFeatureFlagByNameAndUserId(name: string, userId: string): IPromise; + /** + * [Preview API] Change the state of an individual feature flag for a name + * + * @param {Contracts.FeatureFlagPatch} state - State that should be set + * @param {string} name - The name of the feature to change + * @param {string} userEmail + * @return IPromise + */ + updateFeatureFlag(state: Contracts.FeatureFlagPatch, name: string, userEmail?: string): IPromise; +} +export class FeatureAvailabilityHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] Retrieve a listing of all feature flags and their current states for a user + * + * @param {string} userEmail - The email of the user to check + * @return IPromise + */ + getAllFeatureFlags(userEmail?: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states + * + * @param {string} name - The name of the feature to retrieve + * @return IPromise + */ + getFeatureFlagByName(name: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states for a user + * + * @param {string} name - The name of the feature to retrieve + * @param {string} userEmail - The email of the user to check + * @return IPromise + */ + getFeatureFlagByNameAndUserEmail(name: string, userEmail: string): IPromise; + /** + * [Preview API] Retrieve information on a single feature flag and its current states for a user + * + * @param {string} name - The name of the feature to retrieve + * @param {string} userId - The id of the user to check + * @return IPromise + */ + getFeatureFlagByNameAndUserId(name: string, userId: string): IPromise; + /** + * [Preview API] Change the state of an individual feature flag for a name + * + * @param {Contracts.FeatureFlagPatch} state - State that should be set + * @param {string} name - The name of the feature to change + * @param {string} userEmail + * @return IPromise + */ + updateFeatureFlag(state: Contracts.FeatureFlagPatch, name: string, userEmail?: string): IPromise; +} +export class FeatureAvailabilityHttpClient extends FeatureAvailabilityHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return FeatureAvailabilityHttpClient2_1 + */ +export function getClient(): FeatureAvailabilityHttpClient2_1; +} +declare module "VSS/FeatureAvailability/Services" { +import Service = require("VSS/Service"); +/** +* Service to manage feature availability data +*/ +export class FeatureAvailabilityService extends Service.VssService { + private _featureStatesCache; + private _httpClient; + constructor(); + /** + * Uses the default service to perform a local-only check to determine if the feature is enabled. + * This requires the feature to be present on the the page scope feature-availability-data island. + * + * @param featureName Feature name + * @param defaultValue Value to return if the feature is not present in page context data. + */ + static isFeatureEnabled(featureName: string, defaultValue?: boolean): boolean; + /** + * Returns whether or not a feature is enabled. + * + * @param featureName Feature name + * @param callback + * Success callback, taking one parameter (boolean) - the feature availability state + * + * @param errorCallback Error callback + */ + beginIsFeatureEnabled(featureName: string, callback: IResultCallback, errorCallback?: IErrorCallback): void; + /** + * Performs a local-only check to determine if the feature is enabled. This requires the feature to be present on the the page scope feature-availability-data island. + * + * @param featureName Feature name + * @param defaultValue Value to return if the feature is not present in page context data. + */ + isFeatureEnabledLocal(featureName: string, defaultValue?: boolean): boolean; + /** + * Returns the cache state for the supplied feature after ensuring the data island has been read. + */ + private _readLocalState(featureName); +} +} +declare module "VSS/FileContainer/Contracts" { +export enum ContainerItemStatus { + /** + * Item is created. + */ + Created = 1, + /** + * Item is a file pending for upload. + */ + PendingUpload = 2, +} +export enum ContainerItemType { + /** + * Any item type. + */ + Any = 0, + /** + * Item is a folder which can have child items. + */ + Folder = 1, + /** + * Item is a file which is stored in the file service. + */ + File = 2, +} +export enum ContainerOptions { + /** + * No option. + */ + None = 0, +} +/** + * Represents a container that encapsulates a hierarchical file system. + */ +export interface FileContainer { + /** + * Uri of the artifact associated with the container. + */ + artifactUri: string; + contentLocation: string; + /** + * Owner. + */ + createdBy: string; + /** + * Creation date. + */ + dateCreated: Date; + /** + * Description. + */ + description: string; + /** + * Id. + */ + id: number; + /** + * Location of the item resource. + */ + itemLocation: string; + /** + * Name. + */ + name: string; + /** + * Options the container can have. + */ + options: ContainerOptions; + /** + * Project Id. + */ + scopeIdentifier: string; + /** + * Security token of the artifact associated with the container. + */ + securityToken: string; + /** + * Identifier of the optional encryption key. + */ + signingKeyId: string; + /** + * Total size of the files in bytes. + */ + size: number; +} +/** + * Represents an item in a container. + */ +export interface FileContainerItem { + /** + * Container Id. + */ + containerId: number; + contentId: number[]; + contentLocation: string; + /** + * Creator. + */ + createdBy: string; + /** + * Creation date. + */ + dateCreated: Date; + /** + * Last modified date. + */ + dateLastModified: Date; + /** + * Encoding of the file. Zero if not a file. + */ + fileEncoding: number; + /** + * Hash value of the file. Null if not a file. + */ + fileHash: number[]; + /** + * Length of the file. Zero if not of a file. + */ + fileLength: number; + /** + * Type of the file. Zero if not a file. + */ + fileType: number; + /** + * Location of the item resource. + */ + itemLocation: string; + /** + * Type of the item: Folder, File or String. + */ + itemType: ContainerItemType; + /** + * Modifier. + */ + lastModifiedBy: string; + /** + * Unique path that identifies the item. + */ + path: string; + /** + * Project Id. + */ + scopeIdentifier: string; + /** + * Status of the item: Created or Pending Upload. + */ + status: ContainerItemStatus; + ticket: string; +} +export var TypeInfo: { + ContainerItemStatus: { + enumValues: { + "created": number; + "pendingUpload": number; + }; + }; + ContainerItemType: { + enumValues: { + "any": number; + "folder": number; + "file": number; + }; + }; + ContainerOptions: { + enumValues: { + "none": number; + }; + }; + FileContainer: { + fields: any; + }; + FileContainerItem: { + fields: any; + }; +}; +} +declare module "VSS/FileContainer/RestClient" { +import Contracts = require("VSS/FileContainer/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class FileContainerHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] Creates the specified item in the container referenced container. + * + * @param {string} content - Content to upload + * @param {number} containerId + * @param {string} itemPath + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + createItem(content: string, containerId: number, itemPath: string, scope?: string): IPromise; + /** + * [Preview API] Creates the specified items in in the referenced container. + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} items + * @param {number} containerId + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + createItems(items: VSS_Common_Contracts.VssJsonCollectionWrapperV, containerId: number, scope?: string): IPromise; + /** + * [Preview API] Deletes the specified items in a container. + * + * @param {number} containerId - Container Id. + * @param {string} itemPath - Path to delete. + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + deleteItem(containerId: number, itemPath: string, scope?: string): IPromise; + /** + * [Preview API] Gets containers filtered by a comma separated list of artifact uris within the same scope, if not specified returns all containers + * + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @param {string} artifactUris + * @return IPromise + */ + getContainers(scope?: string, artifactUris?: string): IPromise; + /** + * [Preview API] + * + * @param {number} containerId + * @param {string} scope + * @param {string} itemPath + * @param {boolean} metadata + * @param {string} format + * @param {string} downloadFileName + * @param {boolean} includeDownloadTickets + * @param {boolean} isShallow + * @return IPromise + */ + getItems(containerId: number, scope?: string, itemPath?: string, metadata?: boolean, format?: string, downloadFileName?: string, includeDownloadTickets?: boolean, isShallow?: boolean): IPromise; + /** + * [Preview API] Allow browsing of file ,the contentDisposition is inline and Content-Type is determined by FileExtension + * + * @param {number} container + * @param {string} itemPath - The path to the item of interest + * @return IPromise + */ + browseItems(container: number, itemPath?: string): IPromise; +} +export class FileContainerHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] Creates the specified item in the container referenced container. + * + * @param {string} content - Content to upload + * @param {number} containerId + * @param {string} itemPath + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + createItem(content: string, containerId: number, itemPath: string, scope?: string): IPromise; + /** + * [Preview API] Creates the specified items in in the referenced container. + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} items + * @param {number} containerId + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + createItems(items: VSS_Common_Contracts.VssJsonCollectionWrapperV, containerId: number, scope?: string): IPromise; + /** + * [Preview API] Deletes the specified items in a container. + * + * @param {number} containerId - Container Id. + * @param {string} itemPath - Path to delete. + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + deleteItem(containerId: number, itemPath: string, scope?: string): IPromise; + /** + * [Preview API] Gets containers filtered by a comma separated list of artifact uris within the same scope, if not specified returns all containers + * + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @param {string} artifactUris + * @return IPromise + */ + getContainers(scope?: string, artifactUris?: string): IPromise; + /** + * [Preview API] + * + * @param {number} containerId + * @param {string} scope + * @param {string} itemPath + * @param {boolean} metadata + * @param {string} format + * @param {string} downloadFileName + * @param {boolean} includeDownloadTickets + * @param {boolean} isShallow + * @return IPromise + */ + getItems(containerId: number, scope?: string, itemPath?: string, metadata?: boolean, format?: string, downloadFileName?: string, includeDownloadTickets?: boolean, isShallow?: boolean): IPromise; + /** + * [Preview API] Allow browsing of file ,the contentDisposition is inline and Content-Type is determined by FileExtension + * + * @param {number} container + * @param {string} itemPath - The path to the item of interest + * @return IPromise + */ + browseItems(container: number, itemPath?: string): IPromise; +} +export class FileContainerHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] Creates the specified item in the container referenced container. + * + * @param {string} content - Content to upload + * @param {number} containerId + * @param {string} itemPath + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + createItem(content: string, containerId: number, itemPath: string, scope?: string): IPromise; + /** + * [Preview API] Creates the specified items in in the referenced container. + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} items + * @param {number} containerId + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + createItems(items: VSS_Common_Contracts.VssJsonCollectionWrapperV, containerId: number, scope?: string): IPromise; + /** + * [Preview API] Deletes the specified items in a container. + * + * @param {number} containerId - Container Id. + * @param {string} itemPath - Path to delete. + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @return IPromise + */ + deleteItem(containerId: number, itemPath: string, scope?: string): IPromise; + /** + * [Preview API] Gets containers filtered by a comma separated list of artifact uris within the same scope, if not specified returns all containers + * + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @param {string} artifactUris + * @return IPromise + */ + getContainers(scope?: string, artifactUris?: string): IPromise; + /** + * [Preview API] + * + * @param {number} containerId + * @param {string} scope + * @param {string} itemPath + * @param {boolean} metadata + * @param {string} format + * @param {string} downloadFileName + * @param {boolean} includeDownloadTickets + * @param {boolean} isShallow + * @return IPromise + */ + getItems(containerId: number, scope?: string, itemPath?: string, metadata?: boolean, format?: string, downloadFileName?: string, includeDownloadTickets?: boolean, isShallow?: boolean): IPromise; +} +export class FileContainerHttpClient extends FileContainerHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return FileContainerHttpClient2_1 + */ +export function getClient(): FileContainerHttpClient2_1; +} +declare module "VSS/FileContainer/Services" { +import FileContainer_Contracts = require("VSS/FileContainer/Contracts"); +import Service = require("VSS/Service"); +export interface FileContainerPathInfo { + containerId: number; + path: string; +} +/** +* Service to manage file container data +*/ +export class FileContainerService extends Service.VssService { + private _httpClient; + /** + * Returns a list of file container items + * + * @param containerId The id of the container + * @param scope The scope of the items + * @param itemPath The path of the item within the container + */ + beginGetItems(containerId: number, scope: string, itemPath: string): IPromise; + /** + * Returns the file container info + * + * @param fileContainerPath The path of the container. For example, "#/12/drop". + */ + parseContainerPath(fileContainerPath: string): FileContainerPathInfo; +} +} +declare module "VSS/Gallery/Contracts" { +export enum AcquisitionAssignmentType { + None = 0, + /** + * Just assign for me + */ + Me = 1, + /** + * Assign for all users in the account + */ + All = 2, +} +export enum AcquisitionOperationType { + /** + * Not yet used + */ + Get = 0, + /** + * Install this extension into the host provided + */ + Install = 1, + /** + * Buy licenses for this extension and install into the host provided + */ + Buy = 2, + /** + * Not yet used + */ + Try = 3, + /** + * Not yet used + */ + Request = 4, +} +/** + * Market item acquisition options (install, buy, etc) for an installation target. + */ +export interface AcquisitionOptions { + /** + * The installation target that this options refer to + */ + installationTarget: string; + /** + * The item id that this options refer to + */ + itemId: string; + /** + * Operations allowed for the ItemId in this InstallationTarget + */ + operations: AcquisitionOperationType[]; +} +/** + * Contract for handling the extension acquisition process + */ +export interface ExtensionAcquisitionRequest { + /** + * How the item is being assigned + */ + assignmentType: AcquisitionAssignmentType; + /** + * The id of the subscription used for purchase + */ + billingId: string; + /** + * A list of installation target guids where the item should be installed + */ + installationTargets: string[]; + /** + * The marketplace id (publisherName.extensionName) for the item + */ + itemId: string; + /** + * The type of operation, such as install, request, purchase + */ + operationType: AcquisitionOperationType; + /** + * Additional properties which can be added to the request. + */ + properties: any; + /** + * How many licenses should be purchased + */ + quantity: number; +} +export interface ExtensionFile { + assetType: string; + contentType: string; + fileId: number; + isDefault: boolean; + isPublic: boolean; + language: string; + shortDescription: string; + source: string; + version: string; +} +/** + * The FilterResult is the set of extensions that matched a particular query filter. + */ +export interface ExtensionFilterResult { + /** + * This is the set of appplications that matched the query filter supplied. + */ + extensions: PublishedExtension[]; + /** + * The PagingToken is returned from a request when more records exist that match the result than were requested or could be returned. A follow-up query with this paging token can be used to retrieve more results. + */ + pagingToken: string; +} +/** + * Package that will be used to create or update a published extension + */ +export interface ExtensionPackage { + /** + * Base 64 encoded extension package + */ + extensionManifest: string; +} +/** + * An ExtensionQuery is used to search the gallery for a set of extensions that match one of many filter values. + */ +export interface ExtensionQuery { + /** + * Each filter is a unique query and will have matching set of extensions returned from the request. Each result will have the same index in the resulting array that the filter had in the incoming query. + */ + filters: QueryFilter[]; + /** + * The Flags are used to deterine which set of information the caller would like returned for the matched extensions. + */ + flags: ExtensionQueryFlags; +} +export enum ExtensionQueryFilterType { + /** + * The values are used as tags. All tags are treated as "OR" conditions with each other. There may be some value put on the number of matched tags from the query. + */ + Tag = 1, + /** + * The Values are an ExtensionName or fragment that is used to match other extension names. + */ + DisplayName = 2, + /** + * The Filter is one or more tokens that define what scope to return private extensions for. + */ + Private = 3, + /** + * Retrieve a set of extensions based on their id's. The values should be the extension id's encoded as strings. + */ + Id = 4, + /** + * The catgeory is unlike other filters. It is AND'd with the other filters instead of being a seperate query. + */ + Category = 5, + /** + * Certain contribution types may be indexed to allow for query by type. User defined types can't be indexed at the moment. + */ + ContributionType = 6, + /** + * Retrieve an set extension based on the name based identifier. This differs from the internal id (which is being deprecated). + */ + Name = 7, + /** + * The InstallationTarget for an extension defines the target consumer for the extension. This may be something like VS, VSOnline, or VSCode + */ + InstallationTarget = 8, +} +export enum ExtensionQueryFlags { + /** + * None is used to retrieve only the basic extension details. + */ + None = 0, + /** + * IncludeVersions will return version information for extensions returned + */ + IncludeVersions = 1, + /** + * IncludeFiles will return information about which files were found within the extension that were stored independant of the manifest. When asking for files, versions will be included as well since files are returned as a property of the versions. These files can be retrieved using the path to the file without requiring the entire manifest be downloaded. + */ + IncludeFiles = 2, + /** + * Include the Categories and Tags that were added to the extension definition. + */ + IncludeCategoryAndTags = 4, + /** + * Include the details about which accounts the extension has been shared with if the extesion is a private extension. + */ + IncludeSharedAccounts = 8, + /** + * Include properties associated with versions of the extension + */ + IncludeVersionProperties = 16, + /** + * Excluding non-validated extensions will remove any extension versions that either are in the process of being validated or have failed validation. + */ + ExcludeNonValidated = 32, + /** + * Include the set of installation targets the extension has requested. + */ + IncludeInstallationTargets = 64, + /** + * AllAttributes is designed to be a mask that defines all sub-elements of the extension should be returned. + */ + AllAttributes = 95, +} +/** + * This is the set of extensions that matched a supplied query through the filters given. + */ +export interface ExtensionQueryResult { + /** + * For each filter supplied in the query, a filter result will be returned in the query result. + */ + results: ExtensionFilterResult[]; +} +export interface ExtensionShare { + id: string; + name: string; + type: string; +} +export interface ExtensionVersion { + files: ExtensionFile[]; + flags: ExtensionVersionFlags; + lastUpdated: Date; + properties: { + key: string; + value: string; + }[]; + validationResultMessage: string; + version: string; + versionDescription: string; +} +export enum ExtensionVersionFlags { + /** + * No flags exist for this version. + */ + None = 0, + /** + * The Validated flag for a version means the extension version has passed validation and can be used.. + */ + Validated = 1, +} +/** + * One condition in a QueryFilter. + */ +export interface FilterCriteria { + filterType: number; + /** + * The value used in the match based on the filter type. + */ + value: string; +} +export interface InstallationTarget { + target: string; +} +export enum PagingDirection { + /** + * Backward will return results from earlier in the resultset. + */ + Backward = 1, + /** + * Forward will return results from later in the resultset. + */ + Forward = 2, +} +export interface PublishedExtension { + categories: string[]; + displayName: string; + extensionId: string; + extensionName: string; + flags: PublishedExtensionFlags; + installationTargets: InstallationTarget[]; + lastUpdated: Date; + longDescription: string; + publisher: PublisherFacts; + sharedWith: ExtensionShare[]; + shortDescription: string; + tags: string[]; + versions: ExtensionVersion[]; +} +export enum PublishedExtensionFlags { + /** + * No flags exist for this extension. + */ + None = 0, + /** + * The Disabled flag for an extension means the extension can't be changed and won't be used by consumers. The disabled flag is managed by the service and can't be supplied by the Extension Developers. + */ + Disabled = 1, + /** + * BuiltIn Extension are available to all Tenants. An explicit registration is not required. This attribute is reserved and can't be supplied by Extension Developers. BuiltIn extensions are by definition Public. There is no need to set the public flag for extensions marked BuiltIn. + */ + BuiltIn = 2, + /** + * This extension has been validated by the service. The extension meets the requirements specified. This attribute is reserved and can't be supplied by the Extension Developers. Validation is a process that ensures that all contributions are well formed. They meet the requirements defined by the contribution type they are extending. Note this attribute will be updated asynchronously as the extension is validated by the developer of the contribution type. There will be restricted access to the extension while this process is performed. + */ + Validated = 4, + /** + * Trusted extensions are ones that are given special capabilities. These tend to come from Microsoft and can't be published by the general public. Note: BuiltIn extensions are always trusted. + */ + Trusted = 8, + /** + * This extension registration is public, making its visibilty open to the public. This means all tenants have the ability to install this extension. Without this flag the extension will be private and will need to be shared with the tenants that can install it. + */ + Public = 256, + /** + * This extension has multiple versions active at one time and version discovery should be done usig the defined "Version Discovery" protocol to determine the version available to a specific user or tenant. @TODO: Link to Version Discovery Protocol. + */ + MultiVersion = 512, + /** + * The system flag is reserved, and cant be used by publishers. + */ + System = 1024, + /** + * The Preview flag indicates that the extension is still under preview (not yet of "release" quality). These extensions may be decorated differently in the gallery and may have different policies applied to them. + */ + Preview = 2048, +} +export interface Publisher { + displayName: string; + extensions: PublishedExtension[]; + flags: PublisherFlags; + lastUpdated: Date; + longDescription: string; + publisherId: string; + publisherName: string; + shortDescription: string; +} +/** + * High-level information about the publisher, like id's and names + */ +export interface PublisherFacts { + displayName: string; + publisherId: string; + publisherName: string; +} +/** + * The FilterResult is the set of publishers that matched a particular query filter. + */ +export interface PublisherFilterResult { + /** + * This is the set of appplications that matched the query filter supplied. + */ + publishers: Publisher[]; +} +export enum PublisherFlags { + /** + * This should never be returned, it is used to represent a publisher who's flags havent changed during update calls. + */ + UnChanged = 1073741824, + /** + * No flags exist for this publisher. + */ + None = 0, + /** + * The Disabled flag for a publisher means the publisher can't be changed and won't be used by consumers, this extends to extensions owned by the publisher as well. The disabled flag is managed by the service and can't be supplied by the Extension Developers. + */ + Disabled = 1, + /** + * A verified publisher is one that Microsoft has done some review of and ensured the publisher meets a set of requirements. The requirements to become a verified publisher are not listed here. They can be found in public documentation (TBD). + */ + Verified = 2, + /** + * This is the set of flags that can't be supplied by the developer and is managed by the service itself. + */ + ServiceFlags = 3, +} +export enum PublisherPermissions { + /** + * This gives the bearer the rights to read Publishers and Extensions. + */ + Read = 1, + /** + * This gives the bearer the rights to update Publishers and Extensions (but not the ability to Create them). + */ + Write = 2, + /** + * This gives the bearer the rights to create new Publishers at the root of the namespace. + */ + Create = 4, + /** + * This gives the bearer the rights to create new Extensions within a publisher. + */ + Publish = 8, + /** + * Admin gives the bearer the rights to manage restricted attributes of Publishers and Extensions. + */ + Admin = 16, + /** + * TrustedPartner gives the bearer the rights to publish a extensions with restricted capabilities. + */ + TrustedPartner = 32, + /** + * PrivateRead is another form of read designed to allow higher privilege accessors the ability to read private extensions. + */ + PrivateRead = 64, +} +/** + * An PublisherQuery is used to search the gallery for a set of publishers that match one of many filter values. + */ +export interface PublisherQuery { + /** + * Each filter is a unique query and will have matching set of publishers returned from the request. Each result will have the same index in the resulting array that the filter had in the incoming query. + */ + filters: QueryFilter[]; + /** + * The Flags are used to deterine which set of information the caller would like returned for the matched publishers. + */ + flags: PublisherQueryFlags; +} +export enum PublisherQueryFilterType { + /** + * The values are used as tags. All tags are treated as "OR" conditions with each other. There may be some value put on the number of matched tags from the query. + */ + Tag = 1, + /** + * The Values are an PublisherName or fragment that is used to match other extension names. + */ + DisplayName = 2, + /** + * The My Query filter is used to retrieve the set of publishers that I have access to publish extesions into. All Values are ignored and the calling user is used as the filter in this case. + */ + My = 3, +} +export enum PublisherQueryFlags { + /** + * None is used to retrieve only the basic publisher details. + */ + None = 0, + /** + * Is used to include a list of basic extension details for all extensions published by the requested publisher. + */ + IncludeExtensions = 1, +} +/** + * This is the set of publishers that matched a supplied query through the filters given. + */ +export interface PublisherQueryResult { + /** + * For each filter supplied in the query, a filter result will be returned in the query result. + */ + results: PublisherFilterResult[]; +} +/** + * A filter used to define a set of extensions to return during a query. + */ +export interface QueryFilter { + /** + * The filter values define the set of values in this query. They are applied based on the QueryFilterType. + */ + criteria: FilterCriteria[]; + /** + * The PagingDirection is applied to a paging token if one exists. If not the direction is ignored, and Forward from the start of the resultset is used. Direction should be left out of the request unless a paging token is used to help prevent future issues. + */ + direction: PagingDirection; + /** + * The page size defines the number of results the caller wants for this filter. The count can't exceed the overall query size limits. + */ + pageSize: number; + /** + * The paging token is a distinct type of filter and the other filter fields are ignored. The paging token represents the continuation of a previously executed query. The information about where in the result and what fields are being filtered are embeded in the token. + */ + pagingToken: string; +} +export enum SigningKeyPermissions { + Read = 1, + Write = 2, +} +export var TypeInfo: { + AcquisitionAssignmentType: { + enumValues: { + "none": number; + "me": number; + "all": number; + }; + }; + AcquisitionOperationType: { + enumValues: { + "get": number; + "install": number; + "buy": number; + "try": number; + "request": number; + }; + }; + AcquisitionOptions: { + fields: any; + }; + ExtensionAcquisitionRequest: { + fields: any; + }; + ExtensionFile: { + fields: any; + }; + ExtensionFilterResult: { + fields: any; + }; + ExtensionPackage: { + fields: any; + }; + ExtensionQuery: { + fields: any; + }; + ExtensionQueryFilterType: { + enumValues: { + "tag": number; + "displayName": number; + "private": number; + "id": number; + "category": number; + "contributionType": number; + "name": number; + "installationTarget": number; + }; + }; + ExtensionQueryFlags: { + enumValues: { + "none": number; + "includeVersions": number; + "includeFiles": number; + "includeCategoryAndTags": number; + "includeSharedAccounts": number; + "includeVersionProperties": number; + "excludeNonValidated": number; + "includeInstallationTargets": number; + "allAttributes": number; + }; + }; + ExtensionQueryResult: { + fields: any; + }; + ExtensionShare: { + fields: any; + }; + ExtensionVersion: { + fields: any; + }; + ExtensionVersionFlags: { + enumValues: { + "none": number; + "validated": number; + }; + }; + FilterCriteria: { + fields: any; + }; + InstallationTarget: { + fields: any; + }; + PagingDirection: { + enumValues: { + "backward": number; + "forward": number; + }; + }; + PublishedExtension: { + fields: any; + }; + PublishedExtensionFlags: { + enumValues: { + "none": number; + "disabled": number; + "builtIn": number; + "validated": number; + "trusted": number; + "public": number; + "multiVersion": number; + "system": number; + "preview": number; + }; + }; + Publisher: { + fields: any; + }; + PublisherFacts: { + fields: any; + }; + PublisherFilterResult: { + fields: any; + }; + PublisherFlags: { + enumValues: { + "unChanged": number; + "none": number; + "disabled": number; + "verified": number; + "serviceFlags": number; + }; + }; + PublisherPermissions: { + enumValues: { + "read": number; + "write": number; + "create": number; + "publish": number; + "admin": number; + "trustedPartner": number; + "privateRead": number; + }; + }; + PublisherQuery: { + fields: any; + }; + PublisherQueryFilterType: { + enumValues: { + "tag": number; + "displayName": number; + "my": number; + }; + }; + PublisherQueryFlags: { + enumValues: { + "none": number; + "includeExtensions": number; + }; + }; + PublisherQueryResult: { + fields: any; + }; + QueryFilter: { + fields: any; + }; + SigningKeyPermissions: { + enumValues: { + "read": number; + "write": number; + }; + }; +}; +} +declare module "VSS/Gallery/RestClient" { +import Contracts = require("VSS/Gallery/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class GalleryHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} accountName + * @return IPromise + */ + shareExtensionById(extensionId: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} accountName + * @return IPromise + */ + unshareExtensionById(extensionId: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} accountName + * @return IPromise + */ + shareExtension(publisherName: string, extensionName: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} accountName + * @return IPromise + */ + unshareExtension(publisherName: string, extensionName: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} itemId + * @param {string} installationTarget + * @return IPromise + */ + getAcquisitionOptions(itemId: string, installationTarget: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionAcquisitionRequest} acquisitionRequest + * @return IPromise + */ + requestAcquisition(acquisitionRequest: Contracts.ExtensionAcquisitionRequest): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {string} assetType + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAssetByName(publisherName: string, extensionName: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @param {string} assetType + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAsset(extensionId: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} languages + * @return IPromise + */ + getCategories(languages?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + getCertificate(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionQuery} extensionQuery + * @param {string} accountToken + * @return IPromise + */ + queryExtensions(extensionQuery: Contracts.ExtensionQuery, accountToken?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @return IPromise + */ + createExtension(extensionPackage: Contracts.ExtensionPackage): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @return IPromise + */ + deleteExtensionById(extensionId: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @param {Contracts.ExtensionQueryFlags} flags + * @return IPromise + */ + getExtensionById(extensionId: string, version?: string, flags?: Contracts.ExtensionQueryFlags): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} extensionId + * @return IPromise + */ + updateExtensionById(extensionPackage: Contracts.ExtensionPackage, extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} publisherName + * @return IPromise + */ + createExtensionWithPublisher(extensionPackage: Contracts.ExtensionPackage, publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + deleteExtension(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {Contracts.ExtensionQueryFlags} flags + * @param {string} accountToken + * @return IPromise + */ + getExtension(publisherName: string, extensionName: string, version?: string, flags?: Contracts.ExtensionQueryFlags, accountToken?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + updateExtension(extensionPackage: Contracts.ExtensionPackage, publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {string} assetType + * @param {string} assetToken + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAssetWithToken(publisherName: string, extensionName: string, version: string, assetType: string, assetToken?: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.PublisherQuery} publisherQuery + * @return IPromise + */ + queryPublishers(publisherQuery: Contracts.PublisherQuery): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Publisher} publisher + * @return IPromise + */ + createPublisher(publisher: Contracts.Publisher): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @return IPromise + */ + deletePublisher(publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {number} flags + * @return IPromise + */ + getPublisher(publisherName: string, flags?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Publisher} publisher + * @param {string} publisherName + * @return IPromise + */ + updatePublisher(publisher: Contracts.Publisher, publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} keyType + * @param {number} expireCurrentSeconds + * @return IPromise + */ + generateKey(keyType: string, expireCurrentSeconds?: number): IPromise; + /** + * [Preview API] + * + * @param {string} keyType + * @return IPromise + */ + getSigningKey(keyType: string): IPromise; +} +export class GalleryHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} accountName + * @return IPromise + */ + shareExtensionById(extensionId: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} accountName + * @return IPromise + */ + unshareExtensionById(extensionId: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} accountName + * @return IPromise + */ + shareExtension(publisherName: string, extensionName: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} accountName + * @return IPromise + */ + unshareExtension(publisherName: string, extensionName: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionAcquisitionRequest} acquisitionRequest + * @return IPromise + */ + requestAcquisition(acquisitionRequest: Contracts.ExtensionAcquisitionRequest): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {string} assetType + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAssetByName(publisherName: string, extensionName: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @param {string} assetType + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAsset(extensionId: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} languages + * @return IPromise + */ + getCategories(languages?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + getCertificate(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionQuery} extensionQuery + * @param {string} accountToken + * @return IPromise + */ + queryExtensions(extensionQuery: Contracts.ExtensionQuery, accountToken?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @return IPromise + */ + createExtension(extensionPackage: Contracts.ExtensionPackage): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @return IPromise + */ + deleteExtensionById(extensionId: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @param {Contracts.ExtensionQueryFlags} flags + * @return IPromise + */ + getExtensionById(extensionId: string, version?: string, flags?: Contracts.ExtensionQueryFlags): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} extensionId + * @return IPromise + */ + updateExtensionById(extensionPackage: Contracts.ExtensionPackage, extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} publisherName + * @return IPromise + */ + createExtensionWithPublisher(extensionPackage: Contracts.ExtensionPackage, publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + deleteExtension(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {Contracts.ExtensionQueryFlags} flags + * @param {string} accountToken + * @return IPromise + */ + getExtension(publisherName: string, extensionName: string, version?: string, flags?: Contracts.ExtensionQueryFlags, accountToken?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + updateExtension(extensionPackage: Contracts.ExtensionPackage, publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {string} assetType + * @param {string} assetToken + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAssetWithToken(publisherName: string, extensionName: string, version: string, assetType: string, assetToken?: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.PublisherQuery} publisherQuery + * @return IPromise + */ + queryPublishers(publisherQuery: Contracts.PublisherQuery): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Publisher} publisher + * @return IPromise + */ + createPublisher(publisher: Contracts.Publisher): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @return IPromise + */ + deletePublisher(publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {number} flags + * @return IPromise + */ + getPublisher(publisherName: string, flags?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Publisher} publisher + * @param {string} publisherName + * @return IPromise + */ + updatePublisher(publisher: Contracts.Publisher, publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} keyType + * @param {number} expireCurrentSeconds + * @return IPromise + */ + generateKey(keyType: string, expireCurrentSeconds?: number): IPromise; + /** + * [Preview API] + * + * @param {string} keyType + * @return IPromise + */ + getSigningKey(keyType: string): IPromise; +} +export class GalleryHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} accountName + * @return IPromise + */ + shareExtensionById(extensionId: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} accountName + * @return IPromise + */ + unshareExtensionById(extensionId: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} accountName + * @return IPromise + */ + shareExtension(publisherName: string, extensionName: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} accountName + * @return IPromise + */ + unshareExtension(publisherName: string, extensionName: string, accountName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {string} assetType + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAssetByName(publisherName: string, extensionName: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @param {string} assetType + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAsset(extensionId: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} languages + * @return IPromise + */ + getCategories(languages?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + getCertificate(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionQuery} extensionQuery + * @param {string} accountToken + * @return IPromise + */ + queryExtensions(extensionQuery: Contracts.ExtensionQuery, accountToken?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @return IPromise + */ + createExtension(extensionPackage: Contracts.ExtensionPackage): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @return IPromise + */ + deleteExtensionById(extensionId: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} extensionId + * @param {string} version + * @param {Contracts.ExtensionQueryFlags} flags + * @return IPromise + */ + getExtensionById(extensionId: string, version?: string, flags?: Contracts.ExtensionQueryFlags): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} extensionId + * @return IPromise + */ + updateExtensionById(extensionPackage: Contracts.ExtensionPackage, extensionId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} publisherName + * @return IPromise + */ + createExtensionWithPublisher(extensionPackage: Contracts.ExtensionPackage, publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @return IPromise + */ + deleteExtension(publisherName: string, extensionName: string, version?: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {Contracts.ExtensionQueryFlags} flags + * @param {string} accountToken + * @return IPromise + */ + getExtension(publisherName: string, extensionName: string, version?: string, flags?: Contracts.ExtensionQueryFlags, accountToken?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ExtensionPackage} extensionPackage + * @param {string} publisherName + * @param {string} extensionName + * @return IPromise + */ + updateExtension(extensionPackage: Contracts.ExtensionPackage, publisherName: string, extensionName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {string} extensionName + * @param {string} version + * @param {string} assetType + * @param {string} assetToken + * @param {string} accountToken + * @param {boolean} acceptDefault + * @return IPromise + */ + getAssetWithToken(publisherName: string, extensionName: string, version: string, assetType: string, assetToken?: string, accountToken?: string, acceptDefault?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.PublisherQuery} publisherQuery + * @return IPromise + */ + queryPublishers(publisherQuery: Contracts.PublisherQuery): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Publisher} publisher + * @return IPromise + */ + createPublisher(publisher: Contracts.Publisher): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @return IPromise + */ + deletePublisher(publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} publisherName + * @param {number} flags + * @return IPromise + */ + getPublisher(publisherName: string, flags?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Publisher} publisher + * @param {string} publisherName + * @return IPromise + */ + updatePublisher(publisher: Contracts.Publisher, publisherName: string): IPromise; + /** + * [Preview API] + * + * @param {string} keyType + * @param {number} expireCurrentSeconds + * @return IPromise + */ + generateKey(keyType: string, expireCurrentSeconds?: number): IPromise; + /** + * [Preview API] + * + * @param {string} keyType + * @return IPromise + */ + getSigningKey(keyType: string): IPromise; +} +export class GalleryHttpClient extends GalleryHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return GalleryHttpClient2_1 + */ +export function getClient(): GalleryHttpClient2_1; +} +declare module "VSS/Host" { +import Events_Action = require("VSS/Events/Action"); +import Events_Document = require("VSS/Events/Document"); +import Events_Services = require("VSS/Navigation/Services"); +export var history: Events_Services.HistoryService; +export var notificationService: Events_Services.HistoryService; +export var runningDocumentsTable: Events_Document.RunningDocumentsTable; +export var ActionManager: { + MaxOrder: any; + registerActionWorker: (action: string, actionWorker: Events_Action.IActionWorker, order?: number) => void; + clearActionWorkers: () => void; + performAction: (action: string, actionArgs?: any) => any; + unregisterActionWorker: (action: string, actionWorker: Events_Action.IActionWorker) => void; +}; +export var CommonActions: { + ACTION_WINDOW_OPEN: string; + ACTION_WINDOW_NAVIGATE: string; + ACTION_WINDOW_RELOAD: string; + ACTION_WINDOW_UNLOAD: string; +}; +export var urlHelper: { + getFragmentActionLink: (action: string, data?: any) => string; + replaceUrlParam: (url: string, paramName: string, paramValue: string) => string; + isUrlWithinConstraints: (url: string) => boolean; + isSafeProtocol: (url: string) => boolean; +}; +export var hostServiceManager: { + getService(t: any): any; +}; +export enum NavigationContextLevels { + None = 0, + Deployment = 1, + Application = 2, + Collection = 4, + Project = 8, + Team = 16, + ApplicationAll = 15, + All = 31, +} +export enum TeamFoundationHostType { + Parent = -1, + Unknown = 0, + Deployment = 1, + Application = 2, + ProjectCollection = 4, +} +} +declare module "VSS/Identities/Contracts" { +/** + * Container class for changed identities + */ +export interface ChangedIdentities { + /** + * Changed Identities + */ + identities: Identity[]; + /** + * Last Identity SequenceId + */ + sequenceContext: ChangedIdentitiesContext; +} +/** + * Context class for changed identities + */ +export interface ChangedIdentitiesContext { + /** + * Last Group SequenceId + */ + groupSequenceId: number; + /** + * Last Identity SequenceId + */ + identitySequenceId: number; +} +export interface CreateGroupsInfo { + groups: Identity[]; + scopeId: string; +} +export interface CreateScopeInfo { + adminGroupDescription: string; + adminGroupName: string; + creatorId: string; + parentScopeId: string; + scopeName: string; + scopeType: GroupScopeType; +} +export interface FrameworkIdentityInfo { + displayName: string; + identifier: string; + identityType: FrameworkIdentityType; + role: string; +} +export enum FrameworkIdentityType { + None = 0, + ServiceIdentity = 1, + AggregateIdentity = 2, +} +export interface GroupMembership { + active: boolean; + descriptor: IdentityDescriptor; + id: string; + queriedId: string; +} +export enum GroupScopeType { + Generic = 0, + ServiceHost = 1, + TeamProject = 2, +} +export interface Identity { + /** + * The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database) + */ + customDisplayName: string; + descriptor: IdentityDescriptor; + id: string; + isActive: boolean; + isContainer: boolean; + masterId: string; + memberIds: string[]; + memberOf: IdentityDescriptor[]; + members: IdentityDescriptor[]; + metaTypeId: number; + properties: any; + /** + * The display name for the identity as specified by the source identity provider. + */ + providerDisplayName: string; + resourceVersion: number; + uniqueUserId: number; +} +export interface IdentityBatchInfo { + descriptors: IdentityDescriptor[]; + identityIds: string[]; + includeRestrictedVisibility: boolean; + propertyNames: string[]; + queryMembership: QueryMembership; +} +/** + * An Identity descriptor is a wrapper for the identity type (Windows SID, Passport) along with a unique identifier such as the SID or PUID. + */ +export interface IdentityDescriptor { + /** + * The unique identifier for this identity, not exceeding 256 chars, which will be persisted. + */ + identifier: string; + /** + * Type of descriptor (for example, Windows, Passport, etc.). + */ + identityType: string; +} +export enum IdentityMetaType { + Member = 0, + Guest = 1, + Unknown = 255, +} +export interface IdentityScope { + administrators: IdentityDescriptor; + id: string; + isActive: boolean; + isGlobal: boolean; + localScopeId: string; + name: string; + parentId: string; + scopeType: GroupScopeType; + securingHostId: string; +} +export enum IdentitySearchFilter { + /** + * NT account name (domain\alias) + */ + AccountName = 0, + /** + * Display name + */ + DisplayName = 1, + /** + * Find project admin group + */ + AdministratorsGroup = 2, + /** + * Find the identity using the identifier + */ + Identifier = 3, + /** + * Email address + */ + MailAddress = 4, + /** + * A general search for an identity. + */ + General = 5, + /** + * Alternate login username + */ + Alias = 6, + /** + * Find identity using Domain/TenantId + */ + Domain = 7, +} +export interface IdentitySelf { + accountName: string; + displayName: string; + id: string; + tenants: TenantInfo[]; +} +export enum IdentityServiceBehavior { + Default = 0, + NoMapping = 1, +} +export interface IdentitySnapshot { + groups: Identity[]; + identityIds: string[]; + memberships: GroupMembership[]; + scopeId: string; + scopes: IdentityScope[]; +} +export enum IdentityTypeId { + WindowsIdentity = 3, + TeamFoundationIdentity = 4, + ClaimsIdentity = 5, + BindPendingIdentity = 6, + UnauthenticatedIdentity = 7, + ServiceIdentity = 8, + AggregateIdentity = 9, + ServerTestIdentity = 100, +} +export interface IdentityUpdateData { + id: string; + index: number; + updated: boolean; +} +export interface JsonPatchOperationData { + op: string; + path: string; + value: T; +} +export interface MruIdentitiesUpdateData extends JsonPatchOperationData { +} +export enum QueryMembership { + /** + * Query will not return any membership data + */ + None = 0, + /** + * Query will return only direct membership data + */ + Direct = 1, + /** + * Query will return expanded membership data + */ + Expanded = 2, + /** + * Query will return expanded up membership data (parents only) + */ + ExpandedUp = 3, + /** + * Query will return expanded down membership data (children only) + */ + ExpandedDown = 4, +} +export enum ReadIdentitiesOptions { + None = 0, + FilterIllegalMemberships = 1, +} +export interface ReadOnlyIdentityDescriptor extends IdentityDescriptor { + identifier: string; + identityType: string; +} +export enum SpecialGroupType { + Generic = 0, + AdministrativeApplicationGroup = 1, + ServiceApplicationGroup = 2, + EveryoneApplicationGroup = 3, + LicenseesApplicationGroup = 4, + AzureActiveDirectoryApplicationGroup = 5, +} +export interface TenantInfo { + homeTenant: boolean; + tenantId: string; + tenantName: string; +} +export var TypeInfo: { + ChangedIdentities: { + fields: any; + }; + ChangedIdentitiesContext: { + fields: any; + }; + CreateGroupsInfo: { + fields: any; + }; + CreateScopeInfo: { + fields: any; + }; + FrameworkIdentityInfo: { + fields: any; + }; + FrameworkIdentityType: { + enumValues: { + "none": number; + "serviceIdentity": number; + "aggregateIdentity": number; + }; + }; + GroupMembership: { + fields: any; + }; + GroupScopeType: { + enumValues: { + "generic": number; + "serviceHost": number; + "teamProject": number; + }; + }; + Identity: { + fields: any; + }; + IdentityBatchInfo: { + fields: any; + }; + IdentityDescriptor: { + fields: any; + }; + IdentityMetaType: { + enumValues: { + "member": number; + "guest": number; + "unknown": number; + }; + }; + IdentityScope: { + fields: any; + }; + IdentitySearchFilter: { + enumValues: { + "accountName": number; + "displayName": number; + "administratorsGroup": number; + "identifier": number; + "mailAddress": number; + "general": number; + "alias": number; + "domain": number; + }; + }; + IdentitySelf: { + fields: any; + }; + IdentityServiceBehavior: { + enumValues: { + "default": number; + "noMapping": number; + }; + }; + IdentitySnapshot: { + fields: any; + }; + IdentityTypeId: { + enumValues: { + "windowsIdentity": number; + "teamFoundationIdentity": number; + "claimsIdentity": number; + "bindPendingIdentity": number; + "unauthenticatedIdentity": number; + "serviceIdentity": number; + "aggregateIdentity": number; + "serverTestIdentity": number; + }; + }; + IdentityUpdateData: { + fields: any; + }; + JsonPatchOperationData: { + fields: any; + }; + MruIdentitiesUpdateData: { + fields: any; + }; + QueryMembership: { + enumValues: { + "none": number; + "direct": number; + "expanded": number; + "expandedUp": number; + "expandedDown": number; + }; + }; + ReadIdentitiesOptions: { + enumValues: { + "none": number; + "filterIllegalMemberships": number; + }; + }; + ReadOnlyIdentityDescriptor: { + fields: any; + }; + SpecialGroupType: { + enumValues: { + "generic": number; + "administrativeApplicationGroup": number; + "serviceApplicationGroup": number; + "everyoneApplicationGroup": number; + "licenseesApplicationGroup": number; + "azureActiveDirectoryApplicationGroup": number; + }; + }; + TenantInfo: { + fields: any; + }; +}; +} +declare module "VSS/Identities/Picker/Controls" { +import Controls = require("VSS/Controls"); +import Dialogs = require("VSS/Controls/Dialogs"); +import Identities_Picker_RestClient = require("VSS/Identities/Picker/RestClient"); +import Identities_Picker_Services = require("VSS/Identities/Picker/Services"); +export interface IIdentityPickerDropdownOptions extends Identities_Picker_Services.IIdentityServiceOptions, Identities_Picker_Services.IIdentityPickerExtensionOptions { + /** + * type of identities - one or more of User or Group + **/ + identityType?: Identities_Picker_Services.IEntityType; + /** + * scope - one or more of AAD, IMS, Source + **/ + operationScope?: Identities_Picker_Services.IOperationScope; + /** + * restrict displayed identities in dropdown + **/ + pageSize?: number; + /** + * what action (usually in parent) should execute when an item in this dropdown is selected + **/ + onItemSelect?: (identity: Identities_Picker_RestClient.IEntity) => any; + /** + * a pre-render hook that takes in the list of identities that would otherwise have been displayed and rearranges or adds to them prior to returning the new list + **/ + preDropdownRender?: (entityList: Identities_Picker_RestClient.IEntity[]) => Identities_Picker_RestClient.IEntity[]; + /** + * the minimum length of the prefix to start searching the directories - in the absence of an MRU - default 3 + **/ + minimumPrefixSize?: number; + /** + * whether to display the contact card icon for each identity in the dropdown. Default false. + **/ + showContactCard?: boolean; + /** + * whether to display the MRU with the search button or just search directories directly. Default false. + **/ + showMru?: boolean; + /** + * whether to preload (e.g. the MRU identities) on control creation. + **/ + loadOnCreate?: boolean; + /** + * the width of the dropdown control. Default is max(positioningElement width, 300px) + **/ + width?: number; + /** + * the vertex of the dropdown which coincides with the baseAlign (horizontal-vertical). See UI.Positioning for details. Default is "left-top" + **/ + elementAlign?: string; + /** + * the vertex of the base element used as a reference for positioning (horizontal-vertical). See UI.Positioning for details. Default is "left-bottom" + **/ + baseAlign?: string; + coreCssClass?: string; + /** + * an element, or a function which returns an element, to be used for determining the alignment and width of the dropdown control. + * Refer to the width, elementAlign, and baseAlign options. Default is the container + **/ + positioningElement?: JQuery | (() => JQuery); + /** + * the size of the control elements (Medium - most elements are 24px, Large - 32px). Default: Large + **/ + size?: IdentityPickerControlSize; +} +export class IdentityPickerDropdownControl extends Controls.Control { + static UPDATE_THUMBNAILS_EVENT: string; + private static MIN_RESULTS; + private static MAX_RESULTS; + private static MIN_WIDTH; + private static MAX_HEIGHT; + private static IMAGE_MARGINS_PX; + private static DELETE_ICON_SIZE_PX; + private static CONTACT_CARD_ICON_SIZE_PX; + private static DROPDOWN_BORDER_PX; + private static IP_AUTHORIZATION_EXCEPTION_DETAILS_LINK; + private static CSS_AVATAR; + private static CSS_DROPDOWN_BASE; + private static EVENT_MOUSEDOWN; + private _displayedEntities; + private _mruEntities; + private _isSearchActive; + private _isDirectorySearchEnabled; + private _showOnlyMruIdentities; + private _$itemsContainer; + private _$searchResultStatus; + private _selectedIndex; + private _numItemsDisplayed; + private _scrollTimeout; + private _minimumPrefixSize; + private _indexedEntityMap; + private _prefix; + private _isVisible; + private _identityType; + private _operationScope; + private _preDropdownRender; + private _mruEntitiesPromise; + private _mruEntitiesLoadComplete; + private _controlLoaded; + private _loadOnCreate; + private _size; + constructor(options?: IIdentityPickerDropdownOptions); + initializeOptions(options?: IIdentityPickerDropdownOptions): void; + initialize(): void; + load(): IPromise; + /** + * Adds the identity to the querying identity's MRU + **/ + addIdentitiesToMru(objectIds: string[]): void; + /** + * Returns true if the dropdown is currently being shown + **/ + isVisible(): boolean; + showAllMruIdentities(): IPromise; + /** + * Get Identities + */ + getIdentities(prefix: string): IPromise; + /** + * Show the dropdown + **/ + show(): void; + /** + * Hide the dropdown + **/ + hide(): void; + getSelectedIndex(): number; + getSelectedItem(): Identities_Picker_RestClient.IEntity; + handleKeyEvent(e: JQueryEventObject): boolean; + getPrefix(): string; + /** + * Set the prefix but does not update the list + **/ + updatePrefix(prefix: string): void; + private static getClassSelector(className); + private _loadMruEntitiesAsync(); + private _getUserMruEntitiesPostLoad(); + private _enableDirectorySearch(); + private _disableDirectorySearch(); + private _resetSearchStatuses(); + private _getIdentitiesPostLoad(prefix); + private _getDirectoryEntities(prefix, deferred, quickSearch?); + private _getImagesForDisplayedEntities(); + private _showPostLoad(); + private _displayEntities(entitiesToSet, keepIndex?, render?); + /** + * Return only the MRU users or groups that have the prefix + **/ + private static _filterIdentities(identities, prefix); + /** + * Removes the identity to the querying identity's MRU + **/ + private _removeIdentityFromMru(objectId); + /** + * Get the querying identity's MRU + **/ + private _getMruIdentities(); + /** + * keepIndex: Keep the index of the selected identity at the current location + **/ + private _alterDisplayState(showDropDown?, keepIndex?); + /** + * Scroll to selected item + **/ + private _setSelectedIndex(newSelectedIndex, scrollIntoView, position?); + private _scrollItemIntoView(index, position); + /** + * Set the position of this control with respect to its parent + **/ + private _setPosition(); + private _getPositioningElement(); + /** + * Show the status indicator till all users are loaded + **/ + private _showLoading(); + /** + * Show error message in case of non-2xx response + **/ + private _showError(errorMsg); + private _nextPage(); + private _prevPage(); + private _nextItem(); + private _prevItem(); + private _highlightPrefix(textValue); + /** + * Create the li that shall represent an user item + **/ + private _createItem(index); + private _render(); + private _renderEntities(); + private _constructSearchResultStatus(); + private _constructSearchButton(); + private _constructInformativeMessage(errorMessageText); + private _loadNextPage(force?); +} +export interface IIdentityPickerIdCardDialogOptions extends Identities_Picker_Services.IIdentityServiceOptions { + /** + * type of identities - one or more of User or Group + **/ + identityType?: Identities_Picker_Services.IEntityType; + /** + * scope - one or more of AAD, IMS, Source + **/ + operationScope?: Identities_Picker_Services.IOperationScope; + /** + * an identity to initialize with (and to avoid a call to the identity picker service API) + **/ + identity?: Identities_Picker_RestClient.IEntity; + /** + * the signInAddress of the identity which shall be displayed in the IdCardDialog + **/ + signInAddress?: string; + /** + * The left positioning offset of the dialog + **/ + leftValue?: number; + /** + * A base element which shall be used as reference for positioning the dialog + **/ + anchor?: JQuery; + /** + * An optional container of the anchor to be considered. Passing an iframe allows for positioning over an anchor in an other frame. + **/ + anchorContainer?: JQuery; +} +export class IdCardDialog extends Dialogs.DialogO { + static IDCARD_LOADED_EVENT: string; + private static MAX_HEIGHT; + private static IMAGE_MARGINS_PX; + private static MEMBERS_TAB_LEFT_PADDING_PX; + private static MEMBERS_TAB_BUFFER_WIDTH_PX; + private _identityType; + private _operationScope; + private _$idCardDialog; + private _scrollTimeout; + private _numItemsDisplayed; + private _groupMembers; + private _$groupMembersContainer; + private _pageSize; + private _$loading; + constructor(options?: IIdentityPickerIdCardDialogOptions); + initializeOptions(options?: IIdentityPickerIdCardDialogOptions): void; + initialize(): void; + private _repositionDialog(); + private _getIdentitiesFailure(data); + private _getIdentitiesSuccess(data); + private _getThumbnailFailure(data); + private _getThumbnailSuccess(thumbnails); + private _orderAttributes(identity); + private _displayIdCard(identity, attributes); + private _onCloseClick(e?); + private _onCancelClick(e?); + private _onIdCardBlur(e?); + private _createItem(item); + private _renderMembersList(); + private _loadNextPage(); +} +export interface IIdentityPickerSearchOptions extends Identities_Picker_Services.IIdentityServiceOptions, Identities_Picker_Services.IIdentityPickerExtensionOptions { + /** + * type of identities - one or more of User or Group + **/ + identityType?: Identities_Picker_Services.IEntityType; + /** + * scope - one or more of AAD, IMS, Source + **/ + operationScope?: Identities_Picker_Services.IOperationScope; + /** + * default identities to initialise the dropdown with - if you are constructing the IEntity objects, their identifiers (such as entityId, localId etc.) have to be valid; + * alternatively the input can be a semi-colon separated sequence of unique identifiers (such as sign-in addresses or aliases) + **/ + items?: string | Identities_Picker_RestClient.IEntity[]; + /** + * restrict displayed identities in dropdown + **/ + pageSize?: number; + /** + * the minimum length of the prefix to start searching the directories - in the absence of an MRU - default 3 + **/ + minimumPrefixSize?: number; + /** + * whether the search and dropdown controls should handle multiple identities + **/ + multiIdentitySearch?: boolean; + /** + * action that should execute when an item in this dropdown is selected. This action, if supplied, shall be called after the dropdown's default onItemSelect action has executed + **/ + onItemSelect?: (item: Identities_Picker_RestClient.IEntity) => any; + /** + * action that should execute when the input field loses focus. This action, if supplied, shall be called after the control's default onInputBlur action has executed + **/ + onInputBlur?: () => any; + /** + * action that should execute when a key is pressed. This action, if supplied, shall be called before the dropdown's default onKeyPress action has executed to allow for overrides + **/ + onKeyPress?: (keyCode: number) => any; + /** + * a pre-render hook that takes in the list of identities that would otherwise have been displayed and rearranges or adds to them prior to returning the new list + **/ + preDropdownRender?: (entityList: Identities_Picker_RestClient.IEntity[]) => Identities_Picker_RestClient.IEntity[]; + /** + * whether to display the contact card icon for each identity in the dropdown. Default false. + **/ + showContactCard?: boolean; + /** + * whether to style the search control with a triangle that displays the MRU on click or not. Default false. + **/ + showMruTriangle?: boolean; + /** + * whether the dropdown should display the MRU with the search button or just search directories directly. Setting this will also enable the MRU on the dropdown. + * Default false. + **/ + showMru?: boolean; + /** + * whether to preload (e.g. the MRU identities) on control creation. + **/ + loadOnCreate?: boolean; + /** + * whether for a single-select control a click on the resolved item highlights the text (true) or opens the contact card (false - default) + **/ + highlightResolved?: boolean; + /** + * the size of the search control elements (Small - most elements are 16px in height, Medium - 24px, Large - 32px). Default: Medium + **/ + size?: IdentityPickerControlSize; + /** + * the size of the dropdown control elements (Medium - most elements are 24px, Large - 32px). Default: Large + **/ + dropdownSize?: IdentityPickerControlSize; + /** + * the value of the placeholder attribute for the search text box. + **/ + placeholderText?: string; + /** + * a custom id for the input element + **/ + elementId?: string; + /** + * an IEntity to be displayed by default instead of the empty input element + **/ + watermark?: Identities_Picker_RestClient.IEntity; +} +export class IdentityPickerSearchControl extends Controls.Control { + static INVALID_INPUT_EVENT: string; + static VALID_INPUT_EVENT: string; + static DATA_SOURCE_FALLBACK_EVENT: string; + static DATA_SOURCE_REEVALUATE_EVENT: string; + static SEARCH_STARTED_EVENT: string; + static SEARCH_FINISHED_EVENT: string; + static CSS_SEARCH_MRU_TRIANGLE: string; + private static DEFAULT_WIDTH; + private static OUTER_PADDING_PX; + private static SCROLL_BAR_WIDTH_PX; + private static TRIANGLE_WIDTH_PX; + private static NAME_PADDING_PX; + private _identityPickerDropdown; + private _identityType; + private _operationScope; + private _selectedItems; + private _unresolvedItems; + private _$input; + private _$container; + private _$mruTriangle; + private _searchTerm; + private _$focusedOn; + private _typingTimer; + private _doneTypingInterval; + private _controlWidth; + private _resolvedIEntity; + private _minimumPrefixSize; + private _preDropdownRender; + private _placeholderText; + private _controlLoaded; + private _loadOnCreate; + private _size; + constructor(options?: IIdentityPickerSearchOptions); + initialize(): void; + load(): IPromise; + getIdentitySearchResult(): IdentitySearchResult; + clear(): void; + isDropdownVisible(): boolean; + addIdentitiesToMru(identities: Identities_Picker_RestClient.IEntity[]): void; + /** + * Appends to the search control's entities - this expects valid IEntity objects or valid query tokens - such as unique email addresses - entity objects must have been retrieved at some point from the control or DDS, or created using EntityFactory + **/ + setEntities(entities: Identities_Picker_RestClient.IEntity[], queryTokens: string[]): void; + getDropdownPrefix(): string; + private _showProgressCursor(); + private _stopProgressCursor(); + private _fireInvalidInput(); + private _fireValidInput(); + private _fireDataSourceFallback(); + private _fireDataSourceReevaluate(); + private _onInputChange(e?); + private _onInputClick(e?); + private _onMruTriangleMousedown(e); + private _onMruTriangleClick(e); + private _onInputBlur(e?); + private _onInputKeyDown(e?); + private _onInputKeyUp(e?); + private _removeFromUnresolved(item); + private _removeFromResolved(item); + private _getInputText(); + private _resolveInputToIdentities(input); + private _getIdentities(searchTerm); + private _updateThumbnail(data); + private _recalculateInputWidth(); + private _replaceAndCleanup(email); + private _findInSelectedItems(object); + private _showIdCardDialog(args); + private _showWatermark(); + private _resolveItem(item, clearInput?, prefix?); + private _getSearchPrefix(input); + private _unresolveItem(token); +} +export interface IdentitySearchResult { + resolvedEntities: Identities_Picker_RestClient.IEntity[]; + unresolvedQueryTokens: string[]; +} +export enum IdentityPickerControlSize { + Small = 0, + Medium = 1, + Large = 2, +} +export interface IIdentityDisplayOptions extends Identities_Picker_Services.IIdentityServiceOptions, Identities_Picker_Services.IIdentityPickerExtensionOptions { + /** + * type of identity - one or more of User or Group + **/ + identityType?: Identities_Picker_Services.IEntityType; + /** + * scope - one or more of AAD, IMS, Source + **/ + operationScope?: Identities_Picker_Services.IOperationScope; + /** + * the identity to be displayed - if you are constructing the IEntity object, its identifiers (such as entityId, localId etc.) have to be valid; + * alternatively the input can be a unique identifier (such as a sign-in address or alias) + **/ + item: string | Identities_Picker_RestClient.IEntity; + /** + * the size of the control elements (Small - most elements are 16px in height, Medium - 24px, Large - 32px). Default: Medium + **/ + size?: IdentityPickerControlSize; + /** + * Determines what is shown in the control + **/ + displayType?: EDisplayControlType; + /** + * the string to be shown before the IEntity gets resolved + **/ + friendlyDisplayName?: string; +} +export enum EDisplayControlType { + AvatarText = 0, + AvatarOnly = 1, + TextOnly = 2, +} +export class IdentityDisplayControl extends Controls.Control { + private static DEFAULT_HOVER_WAIT_ENTER_INTERVAL; + private static DEFAULT_HOVER_WAIT_EXIT_INTERVAL; + private static MIN_WIDTH; + private static OUTER_PADDING_PX; + private _identityType; + private _operationScope; + private _size; + private _displayType; + private _hoverIdCardEnterTimer; + private _hoverIdCardExitTimer; + private _displayedEntity; + constructor(options?: IIdentityDisplayOptions); + initialize(): void; + getDisplayedEntity(): Identities_Picker_RestClient.IEntity; + private _resolveStringToEntity(input); + private _updateThumbnail(data); + private _showIdCardDialog(args); + private _displayString(item); + private _displayEntity(entity, prefix); +} +/** +* Contruct an IEntity from a string. +* Creation is only intended to be called by the controls here, public due to lack of internal-like keywords in ts. +* isStringEntity and isStringEntityId are publicly supported. +**/ +export class EntityFactory { + static STRING_ENTITY_TYPE: string; + private static STRING_ENTITY_ID_PREFIX; + private static STRING_DIRECTORY; + private static STRING_ORIGIN_ID_PREFIX; + private static STRING_LOCAL_ID_PREFIX; + static createStringEntity(displayName: string): Identities_Picker_RestClient.IEntity; + static isStringEntityId(entityId: string): boolean; +} +export class EntityMergeOptions { + static PreferFirst: string; + static PreferSecond: string; +} +export class EntityHelpers { + /** + * This is the default way the controls internally merge MRU and DDS entities entities. + * Assumes that list1 and list2 are lists of distinct entities. + * Use-cases apart from calls by the controls here are not supported; provided as a example of merging logic. + **/ + static mergeEntities(list1: Identities_Picker_RestClient.IEntity[], list2: Identities_Picker_RestClient.IEntity[], mergePreference?: string): Identities_Picker_RestClient.IEntity[]; + /** + * This is the default way the controls internally fetch the key for disambiguating entities. + * Use-cases apart from calls by the controls here are not supported; provided as a example of merging logic. + **/ + static getMergingKeyFromEntity(entity: Identities_Picker_RestClient.IEntity): string; + private static _mergeSimilarEntities(x, y, mergePreference?); + private static _computeValue(key, x, y, mergePreference?); +} +} +declare module "VSS/Identities/Picker/RestClient" { +import WebApi_RestClient = require("VSS/WebApi/RestClient"); +export class AbstractIdentityPickerHttpClient extends WebApi_RestClient.VssHttpClient { + beginGetIdentities(identitiesRequest: IdentitiesSearchRequestModel): IPromise; + beginGetIdentityImageLocation(objectId: string): IPromise; + beginGetConnections(objectId: string, getRequestParams: IdentitiesGetConnectionsRequestModel): IPromise; + beginGetIdentityFeatureMru(identityId: string, featureId: string, getRequestParams: IdentitiesGetMruRequestModel): IPromise; + beginPatchIdentityFeatureMru(identityId: string, featureId: string, patchRequestBody: IdentitiesPatchMruAction[]): IPromise; +} +export class CommonIdentityPickerHttpClient extends AbstractIdentityPickerHttpClient { + private static _identityImageLocation; + beginGetIdentities(identitiesRequest: IdentitiesSearchRequestModel): IPromise; + beginGetIdentityImageLocation(objectId: string): IPromise; + beginGetConnections(objectId: string, getRequestParams: IdentitiesGetConnectionsRequestModel): IPromise; + beginGetIdentityFeatureMru(identityId: string, featureId: string, getRequestParams: IdentitiesGetMruRequestModel): IPromise; + beginPatchIdentityFeatureMru(identityId: string, featureId: string, patchRequestBody: IdentitiesPatchMruAction[]): IPromise; +} +/** + * Identity Picker Models +**/ +export interface IEntity { + /** + * Always set. Not to be parsed as any non-string type. + **/ + entityId: string; + /** + * Always set. e.g. user or group + **/ + entityType: string; + /** + * Always set. e.g. vsd or aad - aad for AAD-backed/linked accounts, vsd otherwise + **/ + originDirectory: string; + /** + * Always set. e.g. the objectId in case of AAD sourced entities (AAD-backed/linked accounts). + **/ + originId: string; + /** + * Set to the IMS vsid in case of non-AAD-backed/linked entities. + **/ + localDirectory?: string; + localId?: string; + /** + * Always set. + **/ + displayName?: string; + scopeName?: string; + department?: string; + jobTitle?: string; + mail?: string; + mailNickname?: string; + physicalDeliveryOfficeName?: string; + signInAddress?: string; + surname?: string; + guest?: boolean; + description?: string; + image?: string; + manager?: string; + /** + * The isMru field denotes whether this identity was loaded via a MruService operation or an IdentityService operation. + * Furthermore, this should not be set for identities that were constructed (for constants etc.) + **/ + isMru?: boolean; +} +export interface QueryTokenResultModel { + queryToken: string; + identities: IEntity[]; + pagingToken?: string; +} +export interface IdentitiesSearchRequestModel { + query: string; + identityTypes: string[]; + operationScopes: string[]; + pagingToken?: string; + properties?: string[]; + options?: any; +} +export interface IdentitiesSearchResponseModel { + results: QueryTokenResultModel[]; +} +export interface IdentitiesGetAvatarResponseModel { + avatar: string; +} +export interface IdentitiesGetConnectionsRequestModel { + connectionTypes: string[]; + identityTypes: string[]; + operationScopes: string[]; + depth?: number; + options?: any; + pagingToken?: string; + properties?: string[]; +} +export interface IdentitiesGetConnectionsResponseModel { + successors?: IEntity[]; +} +export interface IdentitiesGetMruRequestModel { + operationScopes: string[]; + properties?: string[]; +} +export interface IdentitiesGetMruResponseModel { + mruIdentities: IEntity[]; +} +export interface IdentitiesPatchMruAction { + op: string; + value: string[]; + operationScopes: string[]; +} +export interface IdentitiesPatchMruResponseModel { + result: boolean; +} +} +declare module "VSS/Identities/Picker/Services" { +import Identities_Picker_RestClient = require("VSS/Identities/Picker/RestClient"); +import Service = require("VSS/Service"); +/** +* Maps to static Directory in the DirectoryDiscoveryService +**/ +export interface IOperationScope { + /** + * Search the applicable source directory - AAD tenant-level for AAD-backed accounts or IMS account-level for MSA accounts/on-premise TFS + **/ + Source?: boolean; + /** + * Search IMS (Identity service) + **/ + IMS?: boolean; + /** + * Search AAD + **/ + AAD?: boolean; +} +/** +* Maps to static DirectoryObjectType in the DirectoryDiscoveryService +**/ +export interface IEntityType { + User?: boolean; + Group?: boolean; +} +/** +* The kinds of edges in the identity directed graph that you want to traverse +**/ +export interface IConnectionType { + successors?: boolean; +} +/** +* These client service helpers are meant to be used only by the framework identity picker controls and services and should not be used elsewhere. +**/ +export class ServiceHelpers { + static _defaultProperties: string[]; + static _defaultUserProperties: string[]; + static _defaultGroupProperties: string[]; + static DefaultUserImage: string; + static DefaultVsoGroupImage: string; + static DefaultAadGroupImage: string; + static VisualStudioDirectory: string; + static AzureActiveDirectory: string; + static SourceDirectory: string; + static UserEntity: string; + static GroupEntity: string; + static ExtensionData_ExtensionIdKey: string; + static ExtensionData_ProjectScopeNameKey: string; + static ExtensionData_CollectionScopeNameKey: string; + static ExtensionData_ConstraintListKey: string; + static ExtensionData_NoServiceIdentities: string; + static ExtensionData_MaterializedAadGroupsOnlyItem: string; + /** + * Currently supports only AAD and Source (AAD for AAD-backed accounts, and IMS for MSA accounts/on-premise TFS) + **/ + static getOperationScopeList(operationScope: IOperationScope): string[]; + /** + * Currently supports only Users and Groups + **/ + static getIdentityTypeList(identityType: IEntityType): string[]; + /** + * Currently supports only Successors + **/ + static getConnectionTypeList(connectionType: IConnectionType): string[]; + static getDefaultIdentityImage(identity: Identities_Picker_RestClient.IEntity): string; +} +/** +* These interfaces are provided without any server-side guarantees +**/ +export interface IExtensionData { + extensionId: string; + projectScopeName?: string; + collectionScopeName?: string; + constraints?: string[]; +} +export interface IIdentityPickerExtensionOptions { + /** + * Options that might help an IEntityOperationsExtension in modifying requests. + **/ + extensionData?: IExtensionData; +} +export interface IIdentityServiceOptions { + /** + * The httpClient that should be used instead of the CommonIdentityPickerHttpClient + **/ + httpClient?: Identities_Picker_RestClient.AbstractIdentityPickerHttpClient; + /** + * The minimum results that need to be fetched + **/ + minResults?: number; + /** + * The maximum results that need to be fetched + **/ + maxResults?: number; + /** + * Details about the control's current environment that might help an IEntityOperationsExtension in modifying requests. + **/ + extensionData?: IExtensionData; +} +export interface IIdentityService { + getIdentities(prefix: string, operationScope: IOperationScope, identityType: IEntityType, successCallback: (queryTokenResult: Identities_Picker_RestClient.QueryTokenResultModel) => void, errorCallback?: (errorData?: any) => void, options?: IIdentityServiceOptions): void; + getIdentityImages(identities: Identities_Picker_RestClient.IEntity[], operationScope: IOperationScope, identityType: IEntityType, successCallback: (images: IDictionaryStringTo) => void, errorCallback?: (errorData?: any) => void, options?: IIdentityServiceOptions): void; + getIdentityConnections(identity: Identities_Picker_RestClient.IEntity, operationScope: IOperationScope, identityType: IEntityType, connectionType: IConnectionType, options?: IIdentityServiceOptions): IPromise; +} +/** +* This client service is meant to be used only by the framework identity picker controls and should not be used elsewhere. +**/ +export class IdentityService extends Service.VssService implements IIdentityService { + /** + * Get all users with specific properties starting with the prefix. + * @param successCallback: This is called independently for each valid semicolon separated queryToken that was parsed by the service and resolved to 0 or more identities. + * @param errorCallback: This is called for each error received from either the controller or one of the federated services + **/ + getIdentities(prefix: string, operationScope: IOperationScope, identityType: IEntityType, successCallback: (queryTokenResult: Identities_Picker_RestClient.QueryTokenResultModel) => void, errorCallback?: (errorData?: any) => void, options?: IIdentityServiceOptions): void; + /** + * Get images of identities asynchronously, if available. Currently only supports AAD and profile images. + * @param successCallback: This is called once all the images have been loaded for the identities supplied + * @param errorCallback: This is called for each error received from either the controller or one of the federated services + **/ + getIdentityImages(identities: Identities_Picker_RestClient.IEntity[], successCallback: (images: IDictionaryStringTo) => void, errorCallback?: (errorData?: any) => void, options?: IIdentityServiceOptions): void; + /** + * Get an identity's connections in the overlay of the AD graph on the VSO Identity graph + **/ + getIdentityConnections(identity: Identities_Picker_RestClient.IEntity, operationScope: IOperationScope, identityType: IEntityType, connectionType: IConnectionType, options?: IIdentityServiceOptions): IPromise; + private static getQueryTokensForIdentitesWithImages(identities); +} +export interface IMruServiceOptions { + /** + * The httpClient that should be used instead of the CommonIdentityPickerHttpClient + **/ + httpClient?: Identities_Picker_RestClient.AbstractIdentityPickerHttpClient; +} +/** +* Operations on the account-bound MRU identities (across all IdentityTypeFilters) of the querying user in its account +**/ +export interface IMruService { + getMruIdentities(operationScope: IOperationScope, identityId?: string, featureId?: string, options?: IMruServiceOptions): IPromise; + removeMruIdentities(objectIds: string[], operationScope: IOperationScope, identityId?: string, featureId?: string, options?: IMruServiceOptions): IPromise; + addMruIdentities(objectIds: string[], operationScope: IOperationScope, identityId?: string, featureId?: string, options?: IMruServiceOptions): IPromise; +} +/** +* This client service is meant to be used only by the framework identity picker controls and should not be used elsewhere. +**/ +export class MruService extends Service.VssService implements IMruService { + static DEFAULT_IDENTITY_ID: string; + static DEFAULT_FEATURE_ID: string; + getMruIdentities(operationScope: IOperationScope, identityId?: string, featureId?: string, options?: IMruServiceOptions): IPromise; + removeMruIdentities(objectIds: string[], operationScope: IOperationScope, identityId?: string, featureId?: string, options?: IMruServiceOptions): IPromise; + addMruIdentities(objectIds: string[], operationScope: IOperationScope, identityId?: string, featureId?: string, options?: IMruServiceOptions): IPromise; +} +} +declare module "VSS/Identities/RestClient" { +import Contracts = require("VSS/Identities/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_DelegatedAuthorization_Contracts = require("VSS/DelegatedAuthorization/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class IdentitiesHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {any} container + * @return IPromise + */ + createGroups(container: any): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @return IPromise + */ + deleteGroup(groupId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIds + * @param {boolean} recurse + * @param {boolean} deleted + * @param {string} properties + * @return IPromise + */ + listGroups(scopeIds?: string, recurse?: boolean, deleted?: boolean, properties?: string): IPromise; + /** + * [Preview API] + * + * @param {number} identitySequenceId + * @param {number} groupSequenceId + * @param {string} scopeId + * @return IPromise + */ + getIdentityChanges(identitySequenceId: number, groupSequenceId: number, scopeId?: string): IPromise; + /** + * [Preview API] + * + * @param {string} descriptors + * @param {string} identityIds + * @param {string} searchFilter + * @param {string} filterValue + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @param {boolean} includeRestrictedVisibility + * @param {Contracts.ReadIdentitiesOptions} options + * @return IPromise + */ + readIdentities(descriptors?: string, identityIds?: string, searchFilter?: string, filterValue?: string, queryMembership?: Contracts.QueryMembership, properties?: string, includeRestrictedVisibility?: boolean, options?: Contracts.ReadIdentitiesOptions): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @return IPromise + */ + readIdentitiesByScope(scopeId: string, queryMembership?: Contracts.QueryMembership, properties?: string): IPromise; + /** + * [Preview API] + * + * @param {string} identityId + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @return IPromise + */ + readIdentity(identityId: string, queryMembership?: Contracts.QueryMembership, properties?: string): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} identities + * @return IPromise + */ + updateIdentities(identities: VSS_Common_Contracts.VssJsonCollectionWrapperV): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Identity} identity + * @param {string} identityId + * @return IPromise + */ + updateIdentity(identity: Contracts.Identity, identityId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.FrameworkIdentityInfo} frameworkIdentityInfo + * @return IPromise + */ + createIdentity(frameworkIdentityInfo: Contracts.FrameworkIdentityInfo): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityBatchInfo} batchInfo + * @return IPromise + */ + readIdentityBatch(batchInfo: Contracts.IdentityBatchInfo): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + getIdentitySnapshot(scopeId: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getSelf(): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @return IPromise + */ + addMember(containerId: string, memberId: string): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMember(containerId: string, memberId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMembers(containerId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @return IPromise + */ + removeMember(containerId: string, memberId: string): IPromise; + /** + * [Preview API] + * + * @param {string} memberId + * @param {string} containerId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMemberOf(memberId: string, containerId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} memberId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMembersOf(memberId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {Contracts.CreateScopeInfo} info + * @param {string} scopeId + * @return IPromise + */ + createScope(info: Contracts.CreateScopeInfo, scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + deleteScope(scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + getScopeById(scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeName + * @return IPromise + */ + getScopeByName(scopeName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityScope} renameScope + * @param {string} scopeId + * @return IPromise + */ + renameScope(renameScope: Contracts.IdentityScope, scopeId: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getSignoutToken(): IPromise; + /** + * [Preview API] + * + * @param {string} tenantId + * @return IPromise + */ + getTenant(tenantId: string): IPromise; +} +export class IdentitiesHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @param {any} container + * @return IPromise + */ + createGroups(container: any): IPromise; + /** + * @param {string} groupId + * @return IPromise + */ + deleteGroup(groupId: string): IPromise; + /** + * @param {string} scopeIds + * @param {boolean} recurse + * @param {boolean} deleted + * @param {string} properties + * @return IPromise + */ + listGroups(scopeIds?: string, recurse?: boolean, deleted?: boolean, properties?: string): IPromise; + /** + * @param {number} identitySequenceId + * @param {number} groupSequenceId + * @param {string} scopeId + * @return IPromise + */ + getIdentityChanges(identitySequenceId: number, groupSequenceId: number, scopeId?: string): IPromise; + /** + * @param {string} descriptors + * @param {string} identityIds + * @param {string} searchFilter + * @param {string} filterValue + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @param {boolean} includeRestrictedVisibility + * @param {Contracts.ReadIdentitiesOptions} options + * @return IPromise + */ + readIdentities(descriptors?: string, identityIds?: string, searchFilter?: string, filterValue?: string, queryMembership?: Contracts.QueryMembership, properties?: string, includeRestrictedVisibility?: boolean, options?: Contracts.ReadIdentitiesOptions): IPromise; + /** + * @param {string} scopeId + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @return IPromise + */ + readIdentitiesByScope(scopeId: string, queryMembership?: Contracts.QueryMembership, properties?: string): IPromise; + /** + * @param {string} identityId + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @return IPromise + */ + readIdentity(identityId: string, queryMembership?: Contracts.QueryMembership, properties?: string): IPromise; + /** + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} identities + * @return IPromise + */ + updateIdentities(identities: VSS_Common_Contracts.VssJsonCollectionWrapperV): IPromise; + /** + * @param {Contracts.Identity} identity + * @param {string} identityId + * @return IPromise + */ + updateIdentity(identity: Contracts.Identity, identityId: string): IPromise; + /** + * @param {Contracts.FrameworkIdentityInfo} frameworkIdentityInfo + * @return IPromise + */ + createIdentity(frameworkIdentityInfo: Contracts.FrameworkIdentityInfo): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityBatchInfo} batchInfo + * @return IPromise + */ + readIdentityBatch(batchInfo: Contracts.IdentityBatchInfo): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + getIdentitySnapshot(scopeId: string): IPromise; + /** + * @return IPromise + */ + getSelf(): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @return IPromise + */ + addMember(containerId: string, memberId: string): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMember(containerId: string, memberId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMembers(containerId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @return IPromise + */ + removeMember(containerId: string, memberId: string): IPromise; + /** + * [Preview API] + * + * @param {string} memberId + * @param {string} containerId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMemberOf(memberId: string, containerId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} memberId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMembersOf(memberId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {Contracts.CreateScopeInfo} info + * @param {string} scopeId + * @return IPromise + */ + createScope(info: Contracts.CreateScopeInfo, scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + deleteScope(scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + getScopeById(scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeName + * @return IPromise + */ + getScopeByName(scopeName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityScope} renameScope + * @param {string} scopeId + * @return IPromise + */ + renameScope(renameScope: Contracts.IdentityScope, scopeId: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getSignoutToken(): IPromise; + /** + * [Preview API] + * + * @param {string} tenantId + * @return IPromise + */ + getTenant(tenantId: string): IPromise; +} +export class IdentitiesHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @param {any} container + * @return IPromise + */ + createGroups(container: any): IPromise; + /** + * @param {string} groupId + * @return IPromise + */ + deleteGroup(groupId: string): IPromise; + /** + * @param {string} scopeIds + * @param {boolean} recurse + * @param {boolean} deleted + * @param {string} properties + * @return IPromise + */ + listGroups(scopeIds?: string, recurse?: boolean, deleted?: boolean, properties?: string): IPromise; + /** + * @param {number} identitySequenceId + * @param {number} groupSequenceId + * @param {string} scopeId + * @return IPromise + */ + getIdentityChanges(identitySequenceId: number, groupSequenceId: number, scopeId?: string): IPromise; + /** + * @param {string} descriptors + * @param {string} identityIds + * @param {string} searchFilter + * @param {string} filterValue + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @param {boolean} includeRestrictedVisibility + * @param {Contracts.ReadIdentitiesOptions} options + * @return IPromise + */ + readIdentities(descriptors?: string, identityIds?: string, searchFilter?: string, filterValue?: string, queryMembership?: Contracts.QueryMembership, properties?: string, includeRestrictedVisibility?: boolean, options?: Contracts.ReadIdentitiesOptions): IPromise; + /** + * @param {string} scopeId + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @return IPromise + */ + readIdentitiesByScope(scopeId: string, queryMembership?: Contracts.QueryMembership, properties?: string): IPromise; + /** + * @param {string} identityId + * @param {Contracts.QueryMembership} queryMembership + * @param {string} properties + * @return IPromise + */ + readIdentity(identityId: string, queryMembership?: Contracts.QueryMembership, properties?: string): IPromise; + /** + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} identities + * @return IPromise + */ + updateIdentities(identities: VSS_Common_Contracts.VssJsonCollectionWrapperV): IPromise; + /** + * @param {Contracts.Identity} identity + * @param {string} identityId + * @return IPromise + */ + updateIdentity(identity: Contracts.Identity, identityId: string): IPromise; + /** + * @param {Contracts.FrameworkIdentityInfo} frameworkIdentityInfo + * @return IPromise + */ + createIdentity(frameworkIdentityInfo: Contracts.FrameworkIdentityInfo): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityBatchInfo} batchInfo + * @return IPromise + */ + readIdentityBatch(batchInfo: Contracts.IdentityBatchInfo): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + getIdentitySnapshot(scopeId: string): IPromise; + /** + * @return IPromise + */ + getSelf(): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @return IPromise + */ + addMember(containerId: string, memberId: string): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMember(containerId: string, memberId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMembers(containerId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} containerId + * @param {string} memberId + * @return IPromise + */ + removeMember(containerId: string, memberId: string): IPromise; + /** + * [Preview API] + * + * @param {string} memberId + * @param {string} containerId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMemberOf(memberId: string, containerId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {string} memberId + * @param {Contracts.QueryMembership} queryMembership + * @return IPromise + */ + readMembersOf(memberId: string, queryMembership?: Contracts.QueryMembership): IPromise; + /** + * [Preview API] + * + * @param {Contracts.CreateScopeInfo} info + * @param {string} scopeId + * @return IPromise + */ + createScope(info: Contracts.CreateScopeInfo, scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + deleteScope(scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeId + * @return IPromise + */ + getScopeById(scopeId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeName + * @return IPromise + */ + getScopeByName(scopeName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityScope} renameScope + * @param {string} scopeId + * @return IPromise + */ + renameScope(renameScope: Contracts.IdentityScope, scopeId: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getSignoutToken(): IPromise; + /** + * [Preview API] + * + * @param {string} tenantId + * @return IPromise + */ + getTenant(tenantId: string): IPromise; +} +export class IdentitiesHttpClient extends IdentitiesHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return IdentitiesHttpClient2_1 + */ +export function getClient(): IdentitiesHttpClient2_1; +} +declare module "VSS/Licensing/Contracts" { +export enum AccountLicenseType { + None = 0, + EarlyAdopter = 1, + Express = 2, + Professional = 3, + Advanced = 4, + Stakeholder = 5, +} +export interface ClientRightsContainer { + certificateBytes: number[]; + token: string; +} +export enum ExtensionFilterOptions { + None = 1, + Bundle = 2, + AccountAssignment = 4, + All = 7, +} +export enum ExtensionOperation { + Assign = 0, + Unassign = 1, +} +export enum LicensingSource { + None = 0, + Account = 1, + Msdn = 2, + Profile = 3, + Auto = 4, +} +export enum MsdnLicenseType { + None = 0, + Eligible = 1, + Professional = 2, + Platforms = 3, + TestProfessional = 4, + Premium = 5, + Ultimate = 6, + Enterprise = 7, +} +export enum OperationResult { + Success = 0, + Warning = 1, + Error = 2, +} +export enum VisualStudioOnlineServiceLevel { + /** + * No service rights. The user cannot access the account + */ + None = 0, + /** + * Default or minimum service level + */ + Express = 1, + /** + * Premium service level - either by purchasing on the Azure portal or by purchasing the appropriate MSDN subscription + */ + Advanced = 2, + /** + * Only available to a specific set of MSDN Subscribers + */ + AdvancedPlus = 3, + /** + * Stakeholder service level + */ + Stakeholder = 4, +} +export var TypeInfo: { + AccountLicenseType: { + enumValues: { + "none": number; + "earlyAdopter": number; + "express": number; + "professional": number; + "advanced": number; + "stakeholder": number; + }; + }; + ClientRightsContainer: { + fields: any; + }; + ExtensionFilterOptions: { + enumValues: { + "none": number; + "bundle": number; + "accountAssignment": number; + "all": number; + }; + }; + ExtensionOperation: { + enumValues: { + "assign": number; + "unassign": number; + }; + }; + LicensingSource: { + enumValues: { + "none": number; + "account": number; + "msdn": number; + "profile": number; + "auto": number; + }; + }; + MsdnLicenseType: { + enumValues: { + "none": number; + "eligible": number; + "professional": number; + "platforms": number; + "testProfessional": number; + "premium": number; + "ultimate": number; + "enterprise": number; + }; + }; + OperationResult: { + enumValues: { + "success": number; + "warning": number; + "error": number; + }; + }; + VisualStudioOnlineServiceLevel: { + enumValues: { + "none": number; + "express": number; + "advanced": number; + "advancedPlus": number; + "stakeholder": number; + }; + }; +}; +} +declare module "VSS/Locations" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +/** +* Options for generating content urls +*/ +export interface ContentLocationOptions { + /** + * Unique id of the service to generate the url for + */ + serviceInstanceId?: string; + /** + * Specific web context to use when generating the url + */ + webContext?: Contracts_Platform.WebContext; + /** + * Host level to get the url of + */ + hostType?: Contracts_Platform.ContextHostType; + /** + * Relative path to append to the url. This needs to be properly encoded by the consumer. + */ + relativePath?: string; + /** + * Query parameters to add to the url + */ + queryParams?: IDictionaryStringTo; +} +/** +* Options for generating MVC urls +*/ +export interface MvcRouteOptions { + /** + * Unique id of the service to generate the url for + */ + serviceInstanceId?: string; + /** + * Specific web context to use when generating the url + */ + webContext?: Contracts_Platform.WebContext; + /** + * Navigation level at which to generate the url (Deployment, Account, Collection, Project, Team) + */ + level?: Contracts_Platform.NavigationContextLevels; + /** + * Route Area (e.g. "admin") or null/undefined for the default + */ + area?: string; + /** + * MVC controller name + */ + controller?: string; + /** + * Controller action + */ + action?: string; + /** + * Array of parameters (path parts) to append to the path (after controller and action) + */ + parameters?: string[]; + /** + * Override the project in the web context + */ + project?: string; + /** + * Override the team in the web context + */ + team?: string; + /** + * Query parameters to add to the url + */ + queryParams?: IDictionaryStringTo; +} +/** +* Helper class for generating urls +*/ +export class UrlHelper { + private _areaPrefix; + private _controllerPrefix; + constructor(areaPrefix?: string, controllerPrefix?: string); + /** + * Get the url of particular content. If a service id is specified, its url needs to already be in the cached locations. + * + * @param options Url generation options + * @return The generated url string + */ + getContentUrl(options: ContentLocationOptions): string; + /** + * Get the url of a versioned _content file from the hosting page's service. + * + * @param contentFileName filename relative to "/_static/tfs/{Version}/_content/" + * @param serviceInstanceTypeId The id of the service instance to generate the content url of + * @return The generated url string + */ + getVersionedContentUrl(contentFileName: string, serviceInstanceTypeId?: string): string; + /** + * Get the url of an MVC endpoint. + * + * @param options Url generation options + * @return Promise which returns the generated url string + */ + beginGetMvcUrl(options: MvcRouteOptions): IPromise; + /** + * Get the url of an MVC endpoint. If a service id is specified, its url needs to already be in the cached locations. + * + * @param options Url generation options + * @return The generated url string + */ + getMvcUrl(options: MvcRouteOptions): string; +} +/** +* Url helper which provides methods for generating urls +*/ +export var urlHelper: UrlHelper; +/** +* Get the url for the given service if its location has already been cached +* +* @param serviceInstanceId Unique id for the service +* @param hostType The host level to get the url for +* @param webContext The original context to get the url for +* @return Url if the location could be resolved +*/ +export function getCachedServiceLocation(serviceInstanceId: string, hostType: Contracts_Platform.ContextHostType, webContext?: Contracts_Platform.WebContext): string; +/** +* Set the url for the given service and host type +* +* @param url The Url of the location to add +* @param serviceInstanceId Unique id for the service +* @param hostType The host level of the url +*/ +export function addServiceLocation(url: string, serviceInstanceId: string, hostType: Contracts_Platform.ContextHostType): void; +/** +* Get the url for the given service +* @param serviceInstanceId Unique id for the service +* @param hostType The host level to get the url for +* @param webContext The original context to get the url for +* @return Promise that resolves to the location string +*/ +export function beginGetServiceLocation(serviceInstanceId: string, hostType: Contracts_Platform.ContextHostType, webContext?: Contracts_Platform.WebContext): IPromise; +} +declare module "VSS/Locations/Contracts" { +import VSS_Identities_Contracts = require("VSS/Identities/Contracts"); +export interface AccessMapping { + accessPoint: string; + displayName: string; + moniker: string; +} +/** + * Data transfer class that holds information needed to set up a connection with a VSS server. + */ +export interface ConnectionData { + /** + * The Id of the authenticated user who made this request. More information about the user can be obtained by passing this Id to the Identity service + */ + authenticatedUser: VSS_Identities_Contracts.Identity; + /** + * The Id of the authorized user who made this request. More information about the user can be obtained by passing this Id to the Identity service + */ + authorizedUser: VSS_Identities_Contracts.Identity; + /** + * The instance id for this server. + */ + instanceId: string; + /** + * Data that the location service holds. + */ + locationServiceData: LocationServiceData; + /** + * The virtual directory of the host we are talking to. + */ + webApplicationRelativeDirectory: string; +} +export enum InheritLevel { + None = 0, + Deployment = 1, + Account = 2, + Collection = 4, + All = 7, +} +export interface LocationMapping { + accessMappingMoniker: string; + location: string; +} +/** + * Data transfer class used to transfer data about the location service data over the web service. + */ +export interface LocationServiceData { + /** + * Data about the access mappings contained by this location service. + */ + accessMappings: AccessMapping[]; + /** + * Data that the location service holds. + */ + clientCacheFresh: boolean; + /** + * The time to live on the location service cache. + */ + clientCacheTimeToLive: number; + /** + * The default access mapping moniker for the server. + */ + defaultAccessMappingMoniker: string; + /** + * The obsolete id for the last change that took place on the server (use LastChangeId64). + */ + lastChangeId: number; + /** + * The non-truncated 64-bit id for the last change that took place on the server. + */ + lastChangeId64: number; + /** + * Data about the service definitions contained by this location service. + */ + serviceDefinitions: ServiceDefinition[]; + /** + * The identifier of the deployment which is hosting this location data (e.g. SPS, TFS, ELS, Napa, etc.) + */ + serviceOwner: string; +} +export enum RelativeToSetting { + Context = 0, + WebApplication = 2, + FullyQualified = 3, +} +export interface ServiceDefinition { + description: string; + displayName: string; + identifier: string; + inheritLevel: InheritLevel; + locationMappings: LocationMapping[]; + /** + * Maximum api version that this resource supports (current server version for this resource). Copied from ApiResourceLocation. + */ + maxVersion: string; + /** + * Minimum api version that this resource supports. Copied from ApiResourceLocation. + */ + minVersion: string; + parentIdentifier: string; + parentServiceType: string; + properties: any; + relativePath: string; + relativeToSetting: RelativeToSetting; + /** + * The latest version of this resource location that is in "Release" (non-preview) mode. Copied from ApiResourceLocation. + */ + releasedVersion: string; + /** + * The current resource version supported by this resource location. Copied from ApiResourceLocation. + */ + resourceVersion: number; + serviceType: string; + status: ServiceStatus; +} +export enum ServiceStatus { + Assigned = 0, + Active = 1, + Moving = 2, +} +export var TypeInfo: { + AccessMapping: { + fields: any; + }; + ConnectionData: { + fields: any; + }; + InheritLevel: { + enumValues: { + "none": number; + "deployment": number; + "account": number; + "collection": number; + "all": number; + }; + }; + LocationMapping: { + fields: any; + }; + LocationServiceData: { + fields: any; + }; + RelativeToSetting: { + enumValues: { + "context": number; + "webApplication": number; + "fullyQualified": number; + }; + }; + ServiceDefinition: { + fields: any; + }; + ServiceStatus: { + enumValues: { + "assigned": number; + "active": number; + "moving": number; + }; + }; +}; +} +declare module "VSS/Locations/RestClient" { +import Contracts = require("VSS/Locations/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class LocationsHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] This was copied and adapted from TeamFoundationConnectionService.Connect() + * + * @param {VSS_Common_Contracts.ConnectOptions} connectOptions + * @param {number} lastChangeId - Obsolete 32-bit LastChangeId + * @param {number} lastChangeId64 - Non-truncated 64-bit LastChangeId + * @return IPromise + */ + getConnectionData(connectOptions?: VSS_Common_Contracts.ConnectOptions, lastChangeId?: number, lastChangeId64?: number): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @param {string} identifier + * @return IPromise + */ + deleteServiceDefinition(serviceType: string, identifier: string): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @param {string} identifier + * @return IPromise + */ + getServiceDefinition(serviceType: string, identifier: string): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @return IPromise + */ + getServiceDefinitions(serviceType?: string): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} serviceDefinitions + * @return IPromise + */ + updateServiceDefinitions(serviceDefinitions: VSS_Common_Contracts.VssJsonCollectionWrapperV): IPromise; +} +export class LocationsHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] This was copied and adapted from TeamFoundationConnectionService.Connect() + * + * @param {VSS_Common_Contracts.ConnectOptions} connectOptions + * @param {number} lastChangeId - Obsolete 32-bit LastChangeId + * @param {number} lastChangeId64 - Non-truncated 64-bit LastChangeId + * @return IPromise + */ + getConnectionData(connectOptions?: VSS_Common_Contracts.ConnectOptions, lastChangeId?: number, lastChangeId64?: number): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @param {string} identifier + * @return IPromise + */ + deleteServiceDefinition(serviceType: string, identifier: string): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @param {string} identifier + * @return IPromise + */ + getServiceDefinition(serviceType: string, identifier: string): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @return IPromise + */ + getServiceDefinitions(serviceType?: string): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} serviceDefinitions + * @return IPromise + */ + updateServiceDefinitions(serviceDefinitions: VSS_Common_Contracts.VssJsonCollectionWrapperV): IPromise; +} +export class LocationsHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] This was copied and adapted from TeamFoundationConnectionService.Connect() + * + * @param {VSS_Common_Contracts.ConnectOptions} connectOptions + * @param {number} lastChangeId - Obsolete 32-bit LastChangeId + * @param {number} lastChangeId64 - Non-truncated 64-bit LastChangeId + * @return IPromise + */ + getConnectionData(connectOptions?: VSS_Common_Contracts.ConnectOptions, lastChangeId?: number, lastChangeId64?: number): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @param {string} identifier + * @return IPromise + */ + deleteServiceDefinition(serviceType: string, identifier: string): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @param {string} identifier + * @return IPromise + */ + getServiceDefinition(serviceType: string, identifier: string): IPromise; + /** + * [Preview API] + * + * @param {string} serviceType + * @return IPromise + */ + getServiceDefinitions(serviceType?: string): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} serviceDefinitions + * @return IPromise + */ + updateServiceDefinitions(serviceDefinitions: VSS_Common_Contracts.VssJsonCollectionWrapperV): IPromise; +} +export class LocationsHttpClient extends LocationsHttpClient2_2 { + constructor(rootRequestPath: string); +} +} +declare module "VSS/Navigation/Services" { +import Service = require("VSS/Service"); +export class HistoryService implements Service.ILocalService { + private _events; + private _suppressNavigate; + private _initialized; + _currentHashString: string; + constructor(); + /** + * Creates a fragment url to be used in flight navigation. + * + * @param action The action name + * @param data Action parameters + * @return fragment URL in the form of #_a=[action]&routevalue1=routevalue2... + */ + getFragmentActionLink(action: string, data?: any): string; + getCurrentFragment(): string; + deSerializeState(state: string): any; + getCurrentState(): any; + checkCurrentState(): boolean; + replaceHistoryPoint(action: string, data: any, windowTitle?: string, suppressNavigate?: boolean): void; + addHistoryPoint(action: string, data?: any, windowTitle?: string, suppressNavigate?: boolean): void; + attachNavigate(action: IFunctionPPR, handler?: IFunctionPPR, checkCurrentState?: boolean): void; + attachNavigate(action: string, handler: IFunctionPPR, checkCurrentState?: boolean): void; + detachNavigate(action: IFunctionPPR): void; + detachNavigate(action: string, handler?: IFunctionPPR): void; + private _ensureInitialized(); + private _onNavigate(); +} +export function getHistoryService(): HistoryService; +} +declare module "VSS/Operations/Contracts" { +/** + * Represents an async operation and its progress or result information. + */ +export interface Operation extends OperationReference { + /** + * The links to other objects related to this object. + */ + _links: any; + /** + * The result message which is generally not set. + */ + resultMessage: string; +} +/** + * Reference for an async operation. + */ +export interface OperationReference { + /** + * The identifier for this operation. + */ + id: string; + /** + * The current status of the operation. + */ + status: OperationStatus; + /** + * Url to get the full object. + */ + url: string; +} +export enum OperationStatus { + /** + * The operation object does not have the status set. + */ + NotSet = 0, + /** + * The operation has been queued. + */ + Queued = 1, + /** + * The operation is in progress. + */ + InProgress = 2, + /** + * The operation was cancelled by the user. + */ + Cancelled = 3, + /** + * The operation completed successfully. + */ + Succeeded = 4, + /** + * The operation completed with a failure. + */ + Failed = 5, +} +export var TypeInfo: { + Operation: { + fields: any; + }; + OperationReference: { + fields: any; + }; + OperationStatus: { + enumValues: { + "notSet": number; + "queued": number; + "inProgress": number; + "cancelled": number; + "succeeded": number; + "failed": number; + }; + }; +}; +} +declare module "VSS/Operations/RestClient" { +import Contracts = require("VSS/Operations/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class OperationsHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] Gets an operation from the the Id. + * + * @param {string} operationId - The id for the operation. + * @return IPromise + */ + getOperation(operationId: string): IPromise; +} +export class OperationsHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * Gets an operation from the the Id. + * + * @param {string} operationId - The id for the operation. + * @return IPromise + */ + getOperation(operationId: string): IPromise; +} +export class OperationsHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * Gets an operation from the the Id. + * + * @param {string} operationId - The id for the operation. + * @return IPromise + */ + getOperation(operationId: string): IPromise; +} +export class OperationsHttpClient extends OperationsHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return OperationsHttpClient2_1 + */ +export function getClient(): OperationsHttpClient2_1; +} +declare module "VSS/Performance" { +/** Gets scenario manager instance */ +export function getScenarioManager(): IScenarioManager; +/** DO NOT USE: Only exported for unit testing */ +export function _createScenarioManagerForTesting(): IScenarioManager; +/** Scenario management */ +export interface IScenarioManager { + /** + * Start new scenario + * @param area Feature area of scenario. + * @param name Name of scenario. + * @param startTime Optional: Scenario start time. IMPORTANT: Has to be obtained using getTimestamp + * + * @returns Scenario descriptor + */ + startScenario(featureArea: string, name: string, startTime?: number): IScenarioDescriptor; + /** + * End scenario if it's currently active + * @param area Feature area of scenario. + * @param name Name of scenario. + */ + endScenario(featureArea: string, name: string): void; + /** + * Abort scenario if it's currently active. Use this when a scenario that has started hit an error condition and you want to abort performance tracking for the scenario. + * @param area Feature area of scenario. + * @param name Name of scenario. + */ + abortScenario(featureArea: string, name: string): void; + /** + * Start new scenario beginning at the browser's navigationStart event + * @param area Feature area name for CI event. + * @param name Name of scenario. + * + * @returns Scenario descriptor + */ + startScenarioFromNavigation(featureArea: string, name: string): IScenarioDescriptor; + /** + * Get active scenarios with given area/name + * @param area Feature area of scenario. + * @param name Name of scenario. + */ + getScenarios(featureArea: string, name: string): IScenarioDescriptor[]; + /** + * Insert split timing for all currently active scenarios + * @param splitName Name of split timing + */ + split(splitName: string): void; +} +/** Describes split timing within scenarios */ +export interface ISplitTiming { + /** Name of split timing */ + name: string; + /** Time relative to scenario start */ + timestamp: number; + /** Deprecated: Elapsed time for split timing. */ + elapsedTime?: number; +} +/** Describes single scenario */ +export interface IScenarioDescriptor { + /** Returns a value indicating whether the scenario is active */ + isActive(): boolean; + /** Returns scenario area */ + getFeatureArea(): string; + /** Returns scenario name */ + getName(): string; + /** Returns scenario's correlation id */ + getCorrelationId(): string; + /** Return split timings */ + getSplitTimings(): ISplitTiming[]; + /** Ends this scenario + * @param endTime Optional Scenario End Time. IMPORTANT: Has to be obtained using getTimestamp + */ + end(endTime?: number): void; + /** Aborts this scenario */ + abort(): void; + /** + * Add split timing at current timestamp + * @param name Name of split timing + * @param elapsedTime Optional: Deprecated: Store elapsed time in addition to split + */ + addSplitTiming(name: string, elapsedTime?: number): any; + /** + * Add additional data to the scenario. + * @param data Property bag of additional data + */ + addData(data: any): void; + /** + * Logs scenario data to the browser's console + */ + log(): void; +} +export function getTimestamp(): number; +} +declare module "VSS/SDK/Services/Dialogs" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +import Dialogs = require("VSS/Controls/Dialogs"); +/** +* Class which manages showing dialogs in the parent frame +* @serviceId "vss.dialogs" +*/ +export class HostDialogService implements IHostDialogService { + /** + * Open a modal dialog in the host frame which will get its content from a contributed control. + * + * @param contributionId The id of the control contribution to host in the dialog + * @param dialogOptions options.title - title of dialog + * @param contributionConfig Initial configuration to pass to the contribution control. + * @param postContent Optional data to post to the contribution endpoint. If not specified, a GET request will be performed. + */ + openDialog(contributionId: string, dialogOptions: IHostDialogOptions, contributionConfig?: Object, postContent?: Object): IPromise; +} +export interface ExternalDialogOptions extends Dialogs.IModalDialogOptions { + contributionId: string; + webContext?: Contracts_Platform.WebContext; + urlReplacementObject?: any; + contributionConfig?: any; + getDialogResult: () => IPromise; + postContent?: any; +} +/** +* Represents a dialog which hosts an ExternalPart. +*/ +export class ExternalDialog extends Dialogs.ModalDialogO implements IExternalDialog { + private _loadingPromise; + initializeOptions(options?: any): void; + initialize(): void; + /** + * Gets an object registered in the dialog's contribution control. + * + * @param instanceId Id of the instance to get + * @param contextData Optional data to pass to the extension for it to use when creating the instance + * @return Promise that is resolved to the instance (a proxy object that talks to the instance) + */ + getContributionInstance(instanceId: string, contextData?: any): IPromise; + onOkClick(e?: JQueryEventObject): any; +} +} +declare module "VSS/SDK/Services/ExtensionData" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +import ExtensionManagement_Contracts = require("VSS/ExtensionManagement/Contracts"); +/** +* Provides a wrapper around the REST client for getting and saving extension setting values +* @serviceId "vss.extensionSettings" +*/ +export class ExtensionDataService implements IExtensionDataService { + private _extensionManagementClient; + private _publisherName; + private _extensionName; + private static DEFAULT_SCOPE_TYPE; + private static CURRENT_DEFAULT_SCOPE_VALUE; + private static USER_SCOPE_TYPE; + private static CURRENT_USER_SCOPE_VALUE; + private static SETTINGS_COLLECTION_NAME; + private static _serviceInstances; + constructor(publisherName: string, extensionName: string, webContext: Contracts_Platform.WebContext); + /** + * Factory method for creating/getting an instance of the extension settings service. + * + * @param extensionId The extension id to get or save settings for + */ + static getServiceInstance(publisherName: string, extensionName: string, webContext?: Contracts_Platform.WebContext): ExtensionDataService; + /** + * Returns a promise for retrieving a setting at the provided key and scope + * + * @param key The key to retrieve a value for + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + getValue(key: string, documentOptions?: IDocumentOptions): IPromise; + /** + * Returns a promise for saving a setting at the provided key and scope + * + * @param key The key to save a value for + * @param value The value to save + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + setValue(key: string, value: T, documentOptions?: IDocumentOptions): IPromise; + /** + * Returns a promise for getting a document with the provided id in the provided collection + * + * @param collectionName The name of the collection where the document lives + * @param id The id of the document in the collection + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + getDocument(collectionName: string, id: string, documentOptions?: IDocumentOptions): IPromise; + /** + * Returns a promise for getting all of the documents in the provided collection + * + * @param collectionName The name of the collection where the document lives + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + getDocuments(collectionName: string, documentOptions?: IDocumentOptions): IPromise; + /** + * Returns a promise for creating a document in the provided collection + * + * @param collectionName The name of the collection where the document lives + * @param doc The document to store + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + createDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise; + /** + * Returns a promise for setting a document in the provided collection + * Creates the document if it does not exist, otherwise updates the existing document with the id provided + * + * @param collectionName The name of the collection where the document lives + * @param doc The document to store + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + setDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise; + /** + * Returns a promise for updating a document in the provided collection + * A document with the id provided must exist + * + * @param collectionName The name of the collection where the document lives + * @param doc The document to store + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + updateDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise; + /** + * Returns a promise for deleting the document at the provided scope, collection and id + * + * @param collectionName The name of the collection where the document lives + * @param id The id of the document in the collection + * @param documentOptions The scope in which the value is stored - default value is account-wide + */ + deleteDocument(collectionName: string, id: string, documentOptions?: IDocumentOptions): IPromise; + /** + * Returns a promise for querying a set of collections + * + * @param collections The list of collections to query. Assumes Default Scope Type and Current Scope Value + */ + queryCollectionNames(collectionNames: string[]): IPromise; + /** + * Returns a promise for querying a set of collections + * + * @param collections The list of collections to query. Each collection will contain its collectionName, scopeType, and scopeValue + */ + queryCollections(collections: ExtensionManagement_Contracts.ExtensionDataCollection[]): IPromise; + private _checkDocument(document); + private _checkDocumentOptions(documentOptions); +} +} +declare module "VSS/SDK/Services/Navigation" { +import Q = require("q"); +/** +* Service which allows interaction with the browser location and navigation of the host frame +* @serviceId "ms.vss-web.navigation-service" +*/ +export class HostNavigationService implements IHostNavigationService { + /** + * Add a callback to be invoked each time the hash navigation has changed + * + * @param callback Method invoked on each navigation hash change + */ + onHashChanged(callback: (hash: string) => void): void; + private _getHash(); + /** + * Gets the current hash. + */ + getHash(): Q.Promise; + /** + * Reloads the parent frame + */ + reload(): void; + /** + * Sets the provided hash from the hosted content. + */ + setHash(hash: string): void; + /** + * Replace existing hash with the provided hash from the hosted content. + */ + replaceHash(hash: string): void; + /** + * Update the host document's title (appears as the browser tab title). + * + * @param title The new title of the window + */ + setWindowTitle(title: string): void; +} +} +declare module "VSS/Search" { +export class SearchCore { + private _strategy; + private _adapter; + /** + * The search core, allows users to perform searches on data using a custom strategy. + * + * @param strategy The search strategy to use. + * @param adapter The search adapter to use. + */ + constructor(strategy: SearchStrategy, adapter: SearchAdapter); + /** + * Add items to the search strategy + * + * @param items Items to add + */ + addItems(items: any[]): void; + /** + * Performs a search using the Indexer and then runs the adapter's resultHandler on the results + * + * @param query Query to run search on + */ + beginSearch(query: string): void; + /** + * Returns the search strategy currently being used. + * + * @return The strategy in use + */ + getStrategy(): SearchStrategy; + /** + * Clears the stored items in the strategy + */ + clearStrategyStore(): void; +} +export interface ISearchStrategyOptions { + specialCharacters?: string[]; + delimiter?: string | RegExp; +} +export class SearchStrategy { + /** + * Tokenizes the searchText into separate words using a regex. + * + * @param searchText The searchText to split up. + * @param delimiter The string or regex delimiter to use to split up the search terms + * @return An array of strings, the separate words. + */ + static getTerms(searchText: string[], delimiter?: string | RegExp): any[]; + private _options; + private _specialCharactersHashSet; + /** + * Abstract Class to inherit from in order to implement the methods needed to store items and search on them. + */ + constructor(options?: ISearchStrategyOptions); + private _buildSpecialCharacterHashSet(specialCharacters); + _getTerms(searchTerms: string[]): string[]; + /** + * Stores items and terms for each item in order to later retrieve + * and search upon. + * + * @param searchableObjects SearchableObjects to add + */ + processItems(searchableObjects: any[]): void; + /** + * Clears the items stored in the strategy. + */ + clearStrategyStore(): void; + /** + * Searches the item store for the query given to it. Returns an + * array of documents representing the documents which match the query. + * + * @param query The query to search for + * @return The list of items which match the query + */ + search(query: string): any[]; + /** + * Checks whether data exists in the search strategy + * + * @return True if data exists in the strategy, false if it doesn't. + */ + dataExists(): boolean; + /** + * Return the total count of item indexed. + */ + getIndexedItemsCount(): number; + /** + * Return the total size of the indexed store. + */ + getIndexTotalSize(): number; +} +export class IndexedSearchStrategy extends SearchStrategy { + private _searchStore; + private _dataExists; + private _indexedItems; + constructor(store?: IndexedSearchStore, options?: ISearchStrategyOptions); + getIndexTotalSize(): number; + /** + * Clears the items stored in the strategy. + */ + clearStrategyStore(): void; + /** + * Return the total count of item indexed. + */ + getIndexedItemsCount(): any; + /** + * Processes all SearchableObjects and adds them to the index + * + * @param searchableObjects SearchableObjects to add + */ + processItems(searchableObjects: any[]): void; + /** + * Performs a search using the Indexer and then runs the resultHandler on the results. + * + * @param query Query to run search on + * @return The search results + */ + search(query: string): any[]; + /** + * Checks whether data exists in the search strategy + * + * @return True if data exists in the strategy, false if it doesn't. + */ + dataExists(): boolean; +} +export interface IndexedSearchStoreOptions { + delimiter?: string | RegExp; +} +export class IndexedSearchStore { + protected _options: IndexedSearchStoreOptions; + /** + * Abstract function allowing for additional stores for an IndexedSearchStrategy + */ + constructor(options?: IndexedSearchStoreOptions); + /** + * Runs a query on the index. + * + * @param query The query to run. + * @return An array of items, representing the results. + */ + search(query: string): any[]; + /** + * Adds an item to the index, under its token and its subparts. + * + * @param item The item to add to the index. + * @param tokens The tokens to add the item under. + */ + addToIndex(item: any, tokens: any[]): void; + /** + * Clears the items stored in the strategy. + */ + clearStrategyStore(): void; + /** + * totalsize of the index store + */ + getStoreTotalSize(): number; +} +export class TrieStore extends IndexedSearchStore { + private _trie; + constructor(options?: IndexedSearchStoreOptions); + search(query: string): any[]; + /** + * Adds an item to the index, under its token and its subparts. + * + * @param item The item to add to the index. + * @param tokens The tokens to add the item under. + */ + addToIndex(item: any, tokens: any[]): void; + clearStrategyStore(): void; + getStoreTotalSize(): number; +} +export class InvertedIndexStore extends IndexedSearchStore { + private _index; + private _tokenCache; + constructor(options?: IndexedSearchStoreOptions); + /** + * Runs a query on the index. + * + * @param query The query to run. + * @return An array of items, representing the results. + */ + search(query: string): any[]; + /** + * Adds an item to the index, under its token and its subparts. + * + * @param item The item to add to the index. + * @param tokens The tokens to add the item under. + */ + addToIndex(item: any, tokens: any[]): void; + /** + * Clears the items stored in the strategy. + */ + clearStrategyStore(): void; + /** + * Adds a item to the index, under a single key's location. + * + * @param item The item to add. + * @param key The key to add the item under + */ + private _addItemToIndex(item, key); +} +export class SearchAdapter { + /** + * Abstract Class to inherit from in order to implement the UI methods for search. + */ + constructor(); + /** + * Adds additional items to the search strategy + * + * @param addItemsCallback The function which adds items to the search strategy. + * @param searchCallback The function which searches the newly updated strategy. + */ + addMoreItems(addItemsCallback: Function, searchCallback: () => any): void; + /** + * Creates SearchableObjects for all available work items + * + * @return An array of SearchableObjects. + */ + createSearchableObjects(): any[]; + /** + * Handles the results in the UI by filtering through all available items to the ones + * provided in the results array. + * + * @param results An array of items + * @param finished Represents whether or not the search is finished + */ + handleResults(results: any[], finished: boolean): void; + /** + * Handles an error being thrown in the search process. + * + * @param message Specific error message if provided. + */ + handleError(message: string): void; + /** + * Handles the search results being cleared and the view resetting to normal. + */ + handleClear(): void; + /** + * Returns whether or not there is more data to be loaded. + * + * @return True if no more data needs to be loaded, false otherwise + */ + isDataSetComplete(): boolean; +} +export class SearchableObject { + item: any; + terms: any; + /** + * Represents a single item to be placed in the index. + * + * @param item The item to be added + * @param terms The terms associated to the item. + */ + constructor(item: any, terms: any[]); + /** + * Set the terms for this item + * + * @param terms The new terms + */ + setTerms(terms: any[]): void; + /** + * Add a term to the item + * + * @param term The additional term + */ + addTerm(term: string): void; +} +} +declare module "VSS/Security/Contracts" { +import VSS_Identities_Contracts = require("VSS/Identities/Contracts"); +/** + * Class for encapsulating the allowed and denied permissions for a given IdentityDescriptor. + */ +export interface AccessControlEntry { + /** + * The set of permission bits that represent the actions that the associated descriptor is allowed to perform. + */ + allow: number; + /** + * The set of permission bits that represent the actions that the associated descriptor is not allowed to perform. + */ + deny: number; + /** + * The descriptor for the user this AccessControlEntry applies to. + */ + descriptor: VSS_Identities_Contracts.IdentityDescriptor; + /** + * This value, when set, reports the inherited and effective information for the associated descriptor. This value is only set on AccessControlEntries returned by the QueryAccessControlList(s) call when its includeExtendedInfo parameter is set to true. + */ + extendedInfo: AceExtendedInformation; +} +/** + * The AccessControlList class is meant to associate a set of AccessControlEntries with a security token and its inheritance settings. + */ +export interface AccessControlList { + /** + * Storage of permissions keyed on the identity the permission is for. + */ + acesDictionary: { + [key: number]: AccessControlEntry; + }; + /** + * True if this ACL holds ACEs that have extended information. + */ + includeExtendedInfo: boolean; + /** + * True if the given token inherits permissions from parents. + */ + inheritPermissions: boolean; + /** + * The token that this AccessControlList is for. + */ + token: string; +} +export interface AccessControlListsCollection { +} +/** + * Holds the inherited and effective permission information for a given AccessControlEntry. + */ +export interface AceExtendedInformation { + /** + * This is the combination of all of the explicit and inherited permissions for this identity on this token. These are the permissions used when determining if a given user has permission to perform an action. + */ + effectiveAllow: number; + /** + * This is the combination of all of the explicit and inherited permissions for this identity on this token. These are the permissions used when determining if a given user has permission to perform an action. + */ + effectiveDeny: number; + /** + * These are the permissions that are inherited for this identity on this token. If the token does not inherit permissions this will be 0. Note that any permissions that have been explicitly set on this token for this identity, or any groups that this identity is a part of, are not included here. + */ + inheritedAllow: number; + /** + * These are the permissions that are inherited for this identity on this token. If the token does not inherit permissions this will be 0. Note that any permissions that have been explicitly set on this token for this identity, or any groups that this identity is a part of, are not included here. + */ + inheritedDeny: number; +} +export interface ActionDefinition { + /** + * The bit mask integer for this action. Must be a power of 2. + */ + bit: number; + /** + * The localized display name for this action. + */ + displayName: string; + /** + * The non-localized name for this action. + */ + name: string; + /** + * The namespace that this action belongs to. This will only be used for reading from the database. + */ + namespaceId: string; +} +/** + * Represents a raw access control entry from a remote backing store. + */ +export interface RemoteBackingStoreAccessControlEntry { + /** + * The set of permission bits that represent the actions that the associated descriptor is allowed to perform. + */ + allow: number; + /** + * The set of permission bits that represent the actions that the associated descriptor is not allowed to perform. + */ + deny: number; + /** + * The identity for which the access control entry is allowing / denying permission. + */ + identityId: string; + /** + * The token of the access control list in which this access control entry belongs. + */ + token: string; +} +export interface RemoveAccessControlListsRequest { + recurse: boolean; + tokens: string[]; +} +export interface RemovePermissionsRequest { + identityIds: string[]; + token: string; +} +export interface RenameTokensRequest { + renames: TokenRename[]; +} +/** + * Encapsulates the result of a QuerySecurityData call to the backing store. + */ +export interface SecurityNamespaceData { + /** + * The access control entries in this snapshot of the security namespace data. + */ + accessControlEntries: RemoteBackingStoreAccessControlEntry[]; + /** + * Indicates the ACL store whose data is persisted in this SecurityNamespaceData object. + */ + aclStoreId: string; + /** + * The identity domain for the service host on which this security namespace resides. + */ + identityDomain: string; + /** + * The sequence ID for this snapshot of or incremental update to the security namespace data. + */ + newSequenceId: number; + /** + * The list of tokens in the security namespace which have inheritance disabled. + */ + noInheritTokens: string[]; + /** + * If this is a full snapshot of the security namespace data, this value is -1. Otherwise, this instance represents the delta from OldSequenceId to NewSequenceId. + */ + oldSequenceId: number; +} +/** + * Class for describing the details of a TeamFoundationSecurityNamespace. + */ +export interface SecurityNamespaceDescription { + /** + * The list of actions that this Security Namespace is responsible for securing. + */ + actions: ActionDefinition[]; + /** + * This is the dataspace category that describes where the security information for this SecurityNamespace should be stored. + */ + dataspaceCategory: string; + /** + * This localized name for this namespace. + */ + displayName: string; + elementLength: number; + /** + * This is the type of the extension that should be loaded from the plugins directory for extending this security namespace. + */ + extensionType: string; + /** + * If true, the security namespace is remotable, allowing another service to proxy the namespace. + */ + isRemotable: boolean; + /** + * This non-localized for this namespace. + */ + name: string; + /** + * The unique identifier for this namespace. + */ + namespaceId: string; + /** + * The permission bits needed by a user in order to read security data on the Security Namespace. + */ + readPermission: number; + /** + * If the security tokens this namespace will be operating on need to be split on certain characters to determine its elements that character should be specified here. If not, this value will be the null character. + */ + separatorValue: string; + /** + * Used to send information about the structure of the security namespace over the web service. + */ + structureValue: number; + /** + * If true, the security service will expect an ISecurityDataspaceTokenTranslator plugin to exist for this namespace + */ + useTokenTranslator: boolean; + /** + * The permission bits needed by a user in order to modify security data on the Security Namespace. + */ + writePermission: number; +} +export interface SetAccessControlEntriesInfo { + accessControlEntries: AccessControlEntry[]; + merge: boolean; + token: string; +} +export interface SetAccessControlListsRequest { + accessControlEntries: AccessControlEntry[]; + accessControlLists: AccessControlList[]; + throwOnInvalidIdentity: boolean; +} +export interface SetInheritFlagInfo { + inherit: boolean; + token: string; +} +export interface SetPermissionsRequest { + accessControlEntries: AccessControlEntry[]; + merge: boolean; + throwOnInvalidIdentity: boolean; + token: string; +} +/** + * Represents a request to rename a token in a security namespace. + */ +export interface TokenRename { + /** + * True if the existing token should be preserved; false if it should be deleted. + */ + copy: boolean; + /** + * The desired new name of the token. + */ + newToken: string; + /** + * The current name of the token. + */ + oldToken: string; + /** + * True if the scope of the operation should be extended to all child tokens of OldToken; false otherwise. + */ + recurse: boolean; +} +export var TypeInfo: { + AccessControlEntry: { + fields: any; + }; + AccessControlList: { + fields: any; + }; + AccessControlListsCollection: { + fields: any; + }; + AceExtendedInformation: { + fields: any; + }; + ActionDefinition: { + fields: any; + }; + RemoteBackingStoreAccessControlEntry: { + fields: any; + }; + RemoveAccessControlListsRequest: { + fields: any; + }; + RemovePermissionsRequest: { + fields: any; + }; + RenameTokensRequest: { + fields: any; + }; + SecurityNamespaceData: { + fields: any; + }; + SecurityNamespaceDescription: { + fields: any; + }; + SetAccessControlEntriesInfo: { + fields: any; + }; + SetAccessControlListsRequest: { + fields: any; + }; + SetInheritFlagInfo: { + fields: any; + }; + SetPermissionsRequest: { + fields: any; + }; + TokenRename: { + fields: any; + }; +}; +} +declare module "VSS/Security/RestClient" { +import Contracts = require("VSS/Security/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class SecurityHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} securityNamespaceId + * @param {string} token + * @param {string} descriptors + * @return IPromise + */ + removeAccessControlEntries(securityNamespaceId: string, token?: string, descriptors?: string): IPromise; + /** + * [Preview API] + * + * @param {any} container + * @param {string} securityNamespaceId + * @return IPromise + */ + setAccessControlEntries(container: any, securityNamespaceId: string): IPromise; + /** + * [Preview API] + * + * @param {string} securityNamespaceId + * @param {string} token + * @param {string} descriptors + * @param {boolean} includeExtendedInfo + * @param {boolean} recurse + * @return IPromise + */ + queryAccessControlLists(securityNamespaceId: string, token?: string, descriptors?: string, includeExtendedInfo?: boolean, recurse?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} securityNamespaceId + * @param {string} tokens + * @param {boolean} recurse + * @return IPromise + */ + removeAccessControlLists(securityNamespaceId: string, tokens?: string, recurse?: boolean): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} accessControlLists + * @param {string} securityNamespaceId + * @return IPromise + */ + setAccessControlLists(accessControlLists: VSS_Common_Contracts.VssJsonCollectionWrapperV, securityNamespaceId: string): IPromise; + /** + * [Preview API] + * + * @param {string} securityNamespaceId + * @param {number} permissions + * @param {string} token + * @param {boolean} alwaysAllowAdministrators + * @return IPromise + */ + hasPermission(securityNamespaceId: string, permissions?: number, token?: string, alwaysAllowAdministrators?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} securityNamespaceId + * @param {number} permissions + * @param {string} token + * @param {string} descriptor + * @return IPromise + */ + removePermission(securityNamespaceId: string, permissions?: number, token?: string, descriptor?: string): IPromise; + /** + * [Preview API] + * + * @param {string} securityNamespaceId + * @param {boolean} localOnly + * @return IPromise + */ + querySecurityNamespaces(securityNamespaceId: string, localOnly?: boolean): IPromise; + /** + * [Preview API] + * + * @param {any} container + * @param {string} securityNamespaceId + * @return IPromise + */ + setInheritFlag(container: any, securityNamespaceId: string): IPromise; +} +export class SecurityHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @param {string} securityNamespaceId + * @param {string} token + * @param {string} descriptors + * @return IPromise + */ + removeAccessControlEntries(securityNamespaceId: string, token?: string, descriptors?: string): IPromise; + /** + * @param {any} container + * @param {string} securityNamespaceId + * @return IPromise + */ + setAccessControlEntries(container: any, securityNamespaceId: string): IPromise; + /** + * @param {string} securityNamespaceId + * @param {string} token + * @param {string} descriptors + * @param {boolean} includeExtendedInfo + * @param {boolean} recurse + * @return IPromise + */ + queryAccessControlLists(securityNamespaceId: string, token?: string, descriptors?: string, includeExtendedInfo?: boolean, recurse?: boolean): IPromise; + /** + * @param {string} securityNamespaceId + * @param {string} tokens + * @param {boolean} recurse + * @return IPromise + */ + removeAccessControlLists(securityNamespaceId: string, tokens?: string, recurse?: boolean): IPromise; + /** + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} accessControlLists + * @param {string} securityNamespaceId + * @return IPromise + */ + setAccessControlLists(accessControlLists: VSS_Common_Contracts.VssJsonCollectionWrapperV, securityNamespaceId: string): IPromise; + /** + * @param {string} securityNamespaceId + * @param {number} permissions + * @param {string} token + * @param {boolean} alwaysAllowAdministrators + * @return IPromise + */ + hasPermission(securityNamespaceId: string, permissions?: number, token?: string, alwaysAllowAdministrators?: boolean): IPromise; + /** + * @param {string} securityNamespaceId + * @param {number} permissions + * @param {string} token + * @param {string} descriptor + * @return IPromise + */ + removePermission(securityNamespaceId: string, permissions?: number, token?: string, descriptor?: string): IPromise; + /** + * @param {string} securityNamespaceId + * @param {boolean} localOnly + * @return IPromise + */ + querySecurityNamespaces(securityNamespaceId: string, localOnly?: boolean): IPromise; + /** + * @param {any} container + * @param {string} securityNamespaceId + * @return IPromise + */ + setInheritFlag(container: any, securityNamespaceId: string): IPromise; +} +export class SecurityHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @param {string} securityNamespaceId + * @param {string} token + * @param {string} descriptors + * @return IPromise + */ + removeAccessControlEntries(securityNamespaceId: string, token?: string, descriptors?: string): IPromise; + /** + * @param {any} container + * @param {string} securityNamespaceId + * @return IPromise + */ + setAccessControlEntries(container: any, securityNamespaceId: string): IPromise; + /** + * @param {string} securityNamespaceId + * @param {string} token + * @param {string} descriptors + * @param {boolean} includeExtendedInfo + * @param {boolean} recurse + * @return IPromise + */ + queryAccessControlLists(securityNamespaceId: string, token?: string, descriptors?: string, includeExtendedInfo?: boolean, recurse?: boolean): IPromise; + /** + * @param {string} securityNamespaceId + * @param {string} tokens + * @param {boolean} recurse + * @return IPromise + */ + removeAccessControlLists(securityNamespaceId: string, tokens?: string, recurse?: boolean): IPromise; + /** + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} accessControlLists + * @param {string} securityNamespaceId + * @return IPromise + */ + setAccessControlLists(accessControlLists: VSS_Common_Contracts.VssJsonCollectionWrapperV, securityNamespaceId: string): IPromise; + /** + * @param {string} securityNamespaceId + * @param {number} permissions + * @param {string} token + * @param {boolean} alwaysAllowAdministrators + * @return IPromise + */ + hasPermission(securityNamespaceId: string, permissions?: number, token?: string, alwaysAllowAdministrators?: boolean): IPromise; + /** + * @param {string} securityNamespaceId + * @param {number} permissions + * @param {string} token + * @param {string} descriptor + * @return IPromise + */ + removePermission(securityNamespaceId: string, permissions?: number, token?: string, descriptor?: string): IPromise; + /** + * @param {string} securityNamespaceId + * @param {boolean} localOnly + * @return IPromise + */ + querySecurityNamespaces(securityNamespaceId: string, localOnly?: boolean): IPromise; + /** + * @param {any} container + * @param {string} securityNamespaceId + * @return IPromise + */ + setInheritFlag(container: any, securityNamespaceId: string): IPromise; +} +export class SecurityHttpClient extends SecurityHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return SecurityHttpClient2_1 + */ +export function getClient(): SecurityHttpClient2_1; +} +declare module "VSS/Serialization" { +/** + * Metadata for deserializing an enum field on a contract/type + */ +export interface ContractEnumMetadata { + enumValues?: { + [name: string]: number; + }; +} +/** + * Metadata for deserializing a particular field on a contract/type + */ +export interface ContractFieldMetadata { + isArray?: boolean; + isDate?: boolean; + enumType?: ContractEnumMetadata; + typeInfo?: ContractMetadata; + isDictionary?: boolean; + dictionaryKeyIsDate?: boolean; + dictionaryValueIsDate?: boolean; + dictionaryKeyEnumType?: ContractEnumMetadata; + dictionaryValueEnumType?: ContractEnumMetadata; + dictionaryValueTypeInfo?: ContractMetadata; + dictionaryValueFieldInfo?: ContractFieldMetadata; +} +/** + * Metadata required for deserializing a given type + */ +export interface ContractMetadata { + fields?: { + [fieldName: string]: ContractFieldMetadata; + }; +} +/** + * Module for handling serialization and deserialization of data contracts + * (contracts sent from the server using the VSO default REST api serialization settings) + */ +export module ContractSerializer { + /** + * Process a contract in its raw form (e.g. date fields are Dates, and Enums are numbers) and + * return a pure JSON object that can be posted to REST endpoint. + * + * @param data The object to serialize + * @param contractMetadata The type info/metadata for the contract type being serialized + * @param preserveOriginal If true, don't modify the original object. False modifies the original object (the return value points to the data argument). + */ + function serialize(data: any, contractMetadata: ContractMetadata, preserveOriginal?: boolean): any; + /** + * Process a pure JSON object (e.g. that came from a REST call) and transform it into a JS object + * where date strings are converted to Date objects and enum values are converted from strings into + * their numerical value. + * + * @param data The object to deserialize + * @param contractMetadata The type info/metadata for the contract type being deserialize + * @param preserveOriginal If true, don't modify the original object. False modifies the original object (the return value points to the data argument). + * @param unwrapWrappedCollections If true check for wrapped arrays (REST apis will not return arrays directly as the root result but will instead wrap them in a { values: [], count: 0 } object. + */ + function deserialize(data: any, contractMetadata: ContractMetadata, preserveOriginal?: boolean, unwrapWrappedCollections?: boolean): any; +} +/** +* Deserialize the JSON island data that is stored in the given element +* +* @param $element JQuery element containing the JSON to deserialize +* @param contractMetadata The type info/metadata for the contract type being deserialize +* @param removeElement If true remove the element from the DOM after deserializing the content +*/ +export function deserializeJsonIsland($element: JQuery, contractMetadata: ContractMetadata, removeElement?: boolean): T; +} +declare module "VSS/Service" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +import WebApi_RestClient = require("VSS/WebApi/RestClient"); +/** +* A connection to a particular TeamFoundation host +*/ +export class VssConnection { + private static _connectionsCache; + private _webContext; + private _hostType; + private _hostContext; + private _services; + private _httpClients; + /** + * Get a (cached) VssConnection object of the given type + * + * @param webContext Specific web context to get the connection for + * @param hostType Host type to scope the connection to + */ + static getConnection(webContext?: Contracts_Platform.WebContext, hostType?: Contracts_Platform.ContextHostType): VssConnection; + /** + * Get the host context information given a web context and the desired host type + */ + private static getHostContext(webContext, hostType); + /** + * Create a new connection object + * @param webContext Specific web context to get the connection for + * @param hostType Host type to scope the connection to + */ + constructor(webContext: Contracts_Platform.WebContext, hostType?: Contracts_Platform.ContextHostType); + getWebContext(): Contracts_Platform.WebContext; + /** + * Gets the host information that this service is scoped to + */ + getHostContext(): Contracts_Platform.HostContext; + /** + * Gets the host type that this service is scoped to + */ + getHostType(): Contracts_Platform.ContextHostType; + /** + * Gets the service host url for this connection. This is typically + * a relative url, but it can be absolute in child iframes (e.g. extensions) + */ + getHostUrl(): string; + /** + * Gets a (potentially-cached) service associated with this connection + */ + getService(serviceType: { + new (): T; + }, useCached?: boolean): T; + /** + * Returns a new or a cached instance of an httpClient for the given type. + * + * @param httpClientType Type of requeested httpClient. + * @param serviceInstanceId Unique id of the service to scope the http client to + * @return http client of the specified type (clients are cached for this connection) + */ + getHttpClient(httpClientType: { + new (url: string): T; + }, serviceInstanceId?: string): T; + /** + * Get the url for the given service + * + * @param serviceInstanceId Unique identifier of the VSO service to get the url for + * @param hostType The type of host to get the url for + */ + beginGetServiceUrl(serviceInstanceId: string, hostType?: Contracts_Platform.ContextHostType): IPromise; + private _isSameOrigin(serviceUrl); +} +/** +* A client service which can be cached per TFS connection. +*/ +export class VssService { + private _connection; + /** + * Gets the relative location for the service's connection + */ + getConnection(): VssConnection; + getWebContext(): Contracts_Platform.WebContext; + /** + * Sets the VssConnection to use for this service + * @param connection VssConnection used by this service + */ + initializeConnection(connection: VssConnection): void; +} +export interface ILocalService { +} +/** + * Get a local service. + * @param serviceType Type of the local service to get. + * @param webContext optional web context. + * @returns {ILocalService} + */ +export function getLocalService(serviceType: { + new (): T; +}, useCached?: boolean, webContext?: Contracts_Platform.WebContext): T; +/** +* Get a collection-level service +* @param serviceType Type of service to get +* @param webContext optional web context to use for the connection +* @return Collection-level service +*/ +export function getCollectionService(serviceType: { + new (): T; +}, webContext?: Contracts_Platform.WebContext): T; +/** +* Get an application-level (Account) service +* @param serviceType Type of service to get +* @param webContext optional web context to use for the connection +* @return Application-level service +*/ +export function getApplicationService(serviceType: { + new (): T; +}, webContext?: Contracts_Platform.WebContext): T; +/** +* Get a service for the web context's default host type +* @param serviceType Type of service to get +* @param webContext optional web context to use for the connection +* @return Collection-level or Application-level service +*/ +export function getService(serviceType: { + new (): T; +}, webContext?: Contracts_Platform.WebContext): T; +/** +* Get a collection-level HTTP client +* @param httpClientType Type of http client to get +* @param webContext optional web context to use for the connection +* @return collection-level client +*/ +export function getCollectionClient(httpClientType: { + new (url: string): T; +}, webContext?: Contracts_Platform.WebContext): T; +/** +* Get an application-level (Account) HTTP client +* @param httpClientType Type of http client to get +* @param webContext optional web context to use for the connection +* @return application-level client +*/ +export function getApplicationClient(httpClientType: { + new (url: string): T; +}, webContext?: Contracts_Platform.WebContext): T; +/** +* Get an http client for the web context's default host type +* @param serviceType Type of http client to get +* @param webContext optional web context to use for the connection +* @return Collection-level or Application-level http client +*/ +export function getClient(httpClientType: { + new (url: string): T; +}, webContext?: Contracts_Platform.WebContext): T; +} +declare module "VSS/Settings" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +import Service = require("VSS/Service"); +/** +* Scope at which the local user setting applies +*/ +export enum LocalSettingsScope { + /** + * Global (account-specific) settings for a user + */ + Global = 0, + /** + * Project-specific settings for a user + */ + Project = 1, + /** + * Team-specific settings for a user + */ + Team = 2, +} +/** +* Service for reading and writing to local storage +*/ +export class LocalSettingsService implements Service.ILocalService { + private static GLOBAL_SETTING_KEY; + private static PROJECT_SETTING_KEY; + private static TEAM_SETTING_KEY; + private _webContext; + constructor(webContext?: Contracts_Platform.WebContext); + /** + * Write a settings value to browser local storage + * + * @param key Key for the setting to be written. This key will be prefixed with a scope. + * @param value Value for the setting to be written + * @param scope Scope for the setting to apply to. This will determine the prefix to use at the beginning of the setting key. + */ + write(key: string, value: any, scope?: LocalSettingsScope): void; + /** + * Read a setting from browser local storage. + * + * @param key Key for the setting to be written. This key will be prefixed with a scope. + * @param defaultValue The value to return in case no setting exists + * @param scope Scope for the setting to apply to. This will determine the prefix to use at the beginning of the setting key. + * @return Value read from the setting or undefined if no value stored + */ + read(key: string, defaultValue?: T, scope?: LocalSettingsScope): T; + private _getScopedKey(key, scope); +} +} +declare module "VSS/Telemetry/Contracts" { +export interface CustomerIntelligenceEvent { + area: string; + feature: string; + properties: { + [key: string]: any; + }; +} +export enum DelegatedAppTokenType { + Session = 0, + App = 1, +} +export interface WebSessionToken { + appId: string; + force: boolean; + name: string; + namedTokenId: string; + token: string; + tokenType: DelegatedAppTokenType; + validTo: Date; +} +export var TypeInfo: { + CustomerIntelligenceEvent: { + fields: any; + }; + DelegatedAppTokenType: { + enumValues: { + "session": number; + "app": number; + }; + }; + WebSessionToken: { + fields: any; + }; +}; +} +declare module "VSS/Telemetry/RestClient" { +import Contracts = require("VSS/Telemetry/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class CustomerIntelligenceHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.CustomerIntelligenceEvent[]} events + * @return IPromise + */ + publishEvents(events: Contracts.CustomerIntelligenceEvent[]): IPromise; +} +export class CustomerIntelligenceHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.CustomerIntelligenceEvent[]} events + * @return IPromise + */ + publishEvents(events: Contracts.CustomerIntelligenceEvent[]): IPromise; +} +export class CustomerIntelligenceHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.CustomerIntelligenceEvent[]} events + * @return IPromise + */ + publishEvents(events: Contracts.CustomerIntelligenceEvent[]): IPromise; +} +export class CustomerIntelligenceHttpClient extends CustomerIntelligenceHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return CustomerIntelligenceHttpClient2_1 + */ +export function getClient(): CustomerIntelligenceHttpClient2_1; +} +declare module "VSS/Telemetry/Services" { +/** +* Event data that can be published +*/ +export class TelemetryEventData { + area: string; + feature: string; + properties: { + [key: string]: any; + }; + elapsedTime: number; + /** + * Constructor for CIPublishPropertiesOptions. + * + * @param area The Customer Intelligence Area to publish to. + * @param feature The feature name. + * @param properties The key:value list of event properties. + * @param elapsedTime The elapsedTime for the event. Defaults to Date.now() - startTime if startTime is supplied. + * @param startTime The Date.now() at the start of the event process. + */ + constructor(area: string, feature: string, properties: { + [key: string]: any; + }, startTime?: number, elapsedTime?: number); + /** + * Create Telemetry event data from a single property + */ + static fromProperty(area: string, feature: string, property: string, value: any, startTime?: number, elapsedTime?: number): TelemetryEventData; +} +/** +* Publish event data to the CustomerIntelligence service and App insights. +* (events are queued and sent in delayed batches unless immediate = true is supplied) +* +* @param eventData telemetry event to publish +* @param immediate If true, make ajax calls to publish the event immediately. Otherwise queue the event and send in delayed batches. +*/ +export function publishEvent(eventData: TelemetryEventData, immediate?: boolean): void; +} +declare module "VSS/Utils/Array" { +/** +* Returns the first element of an array that matches the predicate. +* +* @param array Array used to perform predicate. +* @param predicate The Predicate function. +* @return The first element that matches the predicate. +*/ +export function first(array: T[], predicate?: (value: T) => boolean): T; +export function arrayContains(value: S, target: T[], comparer?: (s: S, t: T) => boolean): boolean; +export function arrayEquals(source: S[], target: T[], comparer?: (s: S, t: T) => boolean, nullResult?: boolean): boolean; +/** + * Take an array of values and convert it to a dictionary/lookup table. + * @param array Values to convert + * @param getKey Function to get the key for a given item + * @param getValue Optional function to get teh value for a given item (defaults to the item itself) + * @param throwOnDuplicateKeys Optional value indicating to throw an error when duplicate keys are present. Otherwise just overwrite any duplicates + * @return + */ +export function toDictionary(array: TArray[], getKey: (item: TArray, index: number) => string, getValue?: (item: TArray, index: number) => TValue, throwOnDuplicateKeys?: boolean): IDictionaryStringTo; +/** + * @param array + * @param value + * @param comparer + * @return + */ +export function contains(array: T[], value: T, comparer?: IComparer): boolean; +/** + * @param array + * @param predicate + * @return + */ +export function findIndex(array: T[], predicate: IFunctionPR): number; +/** + * @param arrayA + * @param arrayB + * @param comparer + * @return + */ +export function intersect(arrayA: T[], arrayB: T[], comparer?: IComparer): T[]; +/** + * Helper method used to intersect arrays of strings or numbers + * + * @param arrayA + * @param arrayB + * @param caseInsensitive + * @return + */ +export function intersectPrimitives(arrayA: T[], arrayB: T[], caseInsensitive?: boolean): T[]; +/** + * @param arrayA + * @param arrayB + * @param comparer + * @return + */ +export function union(arrayA: T[], arrayB: T[], comparer?: IComparer): T[]; +/** + * Sorts and removes duplicate elements + * + * @param array + * @param comparer + * @return + */ +export function uniqueSort(array: T[], comparer?: IComparer): T[]; +/** + * @param array + * @param comparer + * @return + */ +export function unique(array: T[], comparer?: IComparer): T[]; +/** + * @param arrayA + * @param arrayB + * @param comparer + * @return + */ +export function subtract(arrayA: T[], arrayB: T[], comparer?: IComparer): T[]; +/** + * Reorders an array by moving oldIndex + the "count" next elements to the newIndex in the array + * + * @param array + * @param oldIndex The index of the array element to move + * @param newIndex The index of the array to insert the element at + * @param count The number of subsequent, contiguous elements to take with the oldIndex in the reorder + */ +export function reorder(array: T[], oldIndex: number, newIndex: number, count: number): T[]; +/** + * @param array + * @param comparer + * @return + */ +export function flagSorted(array: T[], comparer: IComparer): void; +/** + * @param toArray + * @param fromArray + * @return + */ +export function copySortFlag(toArray: T[], fromArray: T[]): void; +/** + * @param array + * @param comparer + * @return + */ +export function isSorted(array: T[], comparer: IComparer): boolean; +/** + * @param array + * @param comparer + * @return + */ +export function sortIfNotSorted(array: T[], comparer: IComparer): boolean; +/** + * @param array + * @return + */ +export function clone(array: T[]): T[]; +/** + * @param array + * @param item + * @return + */ +export function indexOf(array: T[], item: T): number; +/** + * @param array + * @param item + */ +export function add(array: T[], item: T): void; +/** + * @param array + * @param items + */ +export function addRange(array: T[], items: T[]): void; +/** + * @param array + * @param item + * @return + */ +export function remove(array: T[], item: T): boolean; +/** + * @param array + */ +export function clear(array: T[]): void; +} +declare module "VSS/Utils/Clipboard" { +/** + * Copies the specified data to the clipboard in the TEXT format using a progressively degrading experience. + * + * @param data The data to copy. + */ +export function copyToClipboard(data: string, options?: any): void; +/** + * Gets a boolean value indicating whether the current browser supports native clipboard access. + */ +export function supportsNativeCopy(): boolean; +/** + * Gets a boolean value indicating whether the current browser supports native clipboard access for HTML content. + */ +export function supportsNativeHtmlCopy(): boolean; +} +declare module "VSS/Utils/Core" { +export var OperationCanceledException: string; +/** + * Wrap a function to ensure that a specific value of 'this' is passed to the function when it is invoked (regardless of the caller). + * + * @param instance The object that will be set to the value of 'this' when the function is invoked. + * @param method The function to wrap. + * @param data Arguments that will be appended to the arguments passed when the delegate is invoked. + * @return The wrapper function + */ +export function delegate(instance: any, method: Function, data?: any): IArgsFunctionR; +/** + * Curries a function with a set of arguments and returns the resulting function. + * When eventually evaluated, the returned function will call the original function + * with the current arguments prepended to the list of arguments. + * + * var add3, result; + * function add(x, y) { + * return x + y; + * } + * add3 = add.curry(3); + * results = add3(4); // result === 7 + * + * See http://en.wikipedia.org/wiki/Curry_function + * + * @param fn + * @param args + */ +export function curry(fn: Function, ...args: any[]): IArgsFunctionR; +export class DelayedFunction { + private _interval; + private _func; + private _timeoutHandle; + private _name; + /** + * Creates an object that can be used to delay-execute the specified method. + * + * @param instance Context to use when calling the provided function + * @param ms Delay in milliseconds to wait before executing the Function + * @param name Name to use when tracing this delayed function + * @param method Method to execute + * @param data Arguments to pass to the method + */ + constructor(instance: any, ms: number, name: string, method: Function, data?: any[]); + /** + * Starts the timer (if not already started) which will invoke the method once expired. + */ + start(): void; + /** + * Resets the timer (cancel, then re-start) which will invoke the method once expired. + */ + reset(): void; + /** + * Cancels any pending operation (stops the timer). + */ + cancel(): void; + /** + * Invokes the method immediately (canceling an existing timer). + */ + invokeNow(): void; + /** + * Modifies the length of the delay timer (for subsequent starts). + * + * @param ms Delay in milliseconds to wait before executing the Function + */ + setDelay(ms: number): void; + /** + * Modify the method being executed. + * + * @param instance Context to use when calling the provided function + * @param method Method to execute + * @param data (Optional) arguments to pass to the method + */ + setMethod(instance: any, method: Function, data?: any[]): void; + /** + * Is the timer currently running (operation in progress) + * + * @return True if this operation is already in progress + */ + isPending(): boolean; +} +/** + * Executes the provided function after the specified amount of time + * + * @param instance Context to use when calling the provided function + * @param ms Delay in milliseconds to wait before executing the Function + * @param method Method to execute + * @param data Arguments to pass to the method + * @return The delayed function that was started + */ +export function delay(instance: any, ms: number, method: Function, data?: any[]): DelayedFunction; +/** + * Creates a delegate that is delayed for the specified interval when invoked. Subsequent calls to the returned delegate reset the timer. + * + * @param instance Context to use when calling the provided function + * @param ms Delay in milliseconds to wait before executing the Function + * @param method Method to execute + * @param data Arguments to pass to the method + * @return The delayed delegate function. + */ +export function throttledDelegate(instance: any, ms: number, method: Function, data?: any[]): IArgsFunctionR; +/** + * Splits a string that contains a list of comma-separated (signed) integer values into an array + * + * @param stringRepresentation String representation of comma-separated integer array + * @return Array of parsed integers + */ +export function parseIntArray(stringRepresentation: string): number[]; +export class Cancelable { + private _callbacks; + canceled: boolean; + context: any; + /** + * Manage cancellable operations. + * + * @param context The context for the cancellable operation. + * The context is passed to actions when they are called. + */ + constructor(context: any); + /** + * Perform the action if not cancelled. + * + * @param action The action to call if the current operation has not been cancelled. + */ + perform(action: Function): void; + /** + * Wrap an action to make it cancellable. + * + * @param action The action to wrap. + * @return The cancellable action. + */ + wrap(action: Function): IFunctionPR; + /** + * Cancel the operation. + */ + cancel(): void; + /** + * Register a callback to be called when the object is cancelled. + * + * @param callback The callback function. + */ + register(callback: Function): void; +} +export class DisposalManager implements IDisposable { + /** + * List of disposables. + */ + private _disposables; + constructor(); + /** + * Add the specified disposable to the list. + * + * @param disposable Disposable to be added to the list. + */ + addDisposable(disposable: TDisposable): TDisposable; + /** + * Disposes all disposables. + */ + dispose(): void; +} +export function tryParseMSJSON(data: any, secure: boolean): any; +export function parseMSJSON(data: any, secure: boolean): any; +export function stringifyMSJSON(object: any): string; +/** + * Parse data from a JSON Island into an object + * + * @param $context The context in which to search for the JSON data + * @param selectionFilter An optional selector that will filter the selection of JSON islands found. + * @param remove . + * @return + */ +export function parseJsonIsland($context: JQuery, selectionFilter?: string, remove?: boolean): any; +/** + * Converts the specified value to a display string. + * + * @param value The value to convert. + * @param format The value to convert. + */ +export function convertValueToDisplayString(value: any, format?: string): string; +export function domToXml(xmlNode: any): string; +export function parseXml(xml: string): any; +export var documentSelection: any; +} +declare module "VSS/Utils/Date" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +export var utcOffset: number; +export var timeZoneMap: Contracts_Platform.DaylightSavingsAdjustmentEntry[]; +export var MILLISECONDS_IN_MINUTE: number; +export var MILLISECONDS_IN_HOUR: number; +export var MILLISECONDS_IN_DAY: number; +export var MILLISECONDS_IN_WEEK: number; +export var DATETIME_MINDATE_UTC_MS: number; +/** + * Checks whether this date object corresponds to a min date or not + * + * @return + */ +export function isMinDate(date: Date): boolean; +/** + * Compares this date object with the given date object + * + * @param date1 Date object to compare + * @param date2 Date object to compare + * @return + */ +export function compare(date1: Date, date2: Date): number; +/** + * Compare two dates to see if they are equal - returning true if they are equal. + * + * @param date1 The first value to compare + * @param date2 The second value to compare + * @return + */ +export function equals(date1: Date, date2: Date): boolean; +/** + * Shifts the date to match the UTC date. This is done by removing the timezone offset which is applied. + * + * @param date The date to be converted. + * @return + */ +export function shiftToUTC(date: Date): Date; +/** + * Shifts the date to match the local date. This is done by adding the timezone offset to the date. + * + * @param date The date to be converted. + * @return + */ +export function shiftToLocal(date: Date): Date; +/** + * Parses the string into a date. + * + * @param dateString Date string to parse. + * @param parseFormat Optional format string to use in parsing the date. May be null or undefined + * @param ignoreTimeZone + * Optional value indicating to ignore the time zone set set in user preferences? + * Should be set to true when a Date string should be parsed irrespective of the user's time zone (e.g. calendar control). + * + * @return + */ +export function parseDateString(dateString: string, parseFormat?: string, ignoreTimeZone?: boolean): Date; +/** + * Returns the number of days between the two dates. Note that any time component is ignored and the dates + * can be supplied in any order + * + * @param startDate The first date + * @param endDate The second date + * @param exclusive If true then the result is exclusive of the second date (Mon->Fri==4). + * Otherwise the date includes the later date (Mon->Fri==5) + */ +export function daysBetweenDates(startDate: Date, endDate: Date, exclusive?: boolean): number; +/** + * @param value Date string + * @param formats Date string formats + * @param ignoreTimeZone + * @return + */ +export function parseLocale(value: string, formats?: string[] | string, ignoreTimeZone?: boolean): Date; +/** + * @param date The Date object to format + * @param format Date string format + * @param ignoreTimeZone + * @return + */ +export function localeFormat(date: Date, format?: string, ignoreTimeZone?: boolean): string; +/** + * Converts a time from the client (e.g. new Date()) to the user's preferred timezone + * + * @param date The Date object to convert + * @param adjustOffset + * If true, consider the date portion when converting (get the timezone offset at that particular date). + * False indicates to use the current (today's) timezone offset regardless of the date given. + * + */ +export function convertClientTimeToUserTimeZone(date: Date, adjustOffset?: boolean): Date; +/** + * Converts a time from the user's preferred timezone to the client (e.g. new Date()) timezone + * + * @param date The Date object to convert + * @param adjustOffset + * If true, consider the date portion when converting (get the timezone offset at that particular date). + * False indicates to use the current (today's) timezone offset regardless of the date given. + * + */ +export function convertUserTimeToClientTimeZone(date: Date, adjustOffset?: boolean): Date; +/** + * Strip the time from the given date (return a new date) such that the new date is of 12:00:00 AM + */ +export function stripTimeFromDate(date: Date): Date; +/** + * Get the equivalent of "Now" in the user's time zone. + */ +export function getNowInUserTimeZone(): Date; +/** + * Get the equivalent of "Today" (date as of midnight) in the user's time zone + */ +export function getTodayInUserTimeZone(): Date; +/** + * @param date The Date object to format + * @param format Date string format + * @return + */ +export function format(date: Date, format?: string): string; +/** + * Generate a string indicating how long ago the date is. + * + * @param date The Date object to format + * @param now + * @return A friendly string + */ +export function ago(date: Date, now?: Date): string; +/** + * Adds days to a given date + * + * @param date The Date object to add to + * @param days Number of days to add + * @param adjustOffset is true then the offset will be adjusted if the offset between the date passed + * and the date obtained after adding days is different. + * + */ +export function addDays(date: Date, days: number, adjustOffset?: boolean): Date; +/** + * Adds hours to a given date + * + * @param date The Date object to add to + * @param hours Number of hours to add + * @param adjustOffset is true then the offset will be adjusted if the offset between the date passed + * and the date obtained after adding hours is different. + * + */ +export function addHours(date: Date, hours: number, adjustOffset?: boolean): Date; +/** + * Adjusts the time zone offset by applying the time difference in the offsets. + * + * @param oldDate The Date object which was used before time zone changed. + * @param newDate The Date object which was used after time zone changed. + */ +export function adjustOffsetForTimes(oldDate: Date, newDate: Date, applicationDate?: Date): Date; +/** + * Gets the offset of the date passed in. + * + * @param date The Date object for which the offset is required. + * @param defaultToUtcOffset A value indicating whether the server side set utc offset should be returned if no offset for date is returned. + */ +export function getOffsetForDate(date: Date): number; +/** + * Checks whether given day is today in user timezone + * + * @param date The Date object to check + */ +export function isGivenDayToday(date: Date): boolean; +/** + * Checks whether given day is a day in past in user timezone + * + * @param date The Date object to check + */ +export function isGivenDayInPast(date: Date): boolean; +/** + * Checks whether given day is a day in future in user timezone + * + * @param date The Date object to check + */ +export function isGivenDayInFuture(date: Date): boolean; +/** + * Get a user friendly string for a date that indicates how long ago the date was. e.g. "4 hours ago", "Tuesday", "7/4/2012". + * + * @param date The Date object to format + * @param now + * @return A string version of the date. + */ +export function friendly(date: Date, now?: Date): string; +} +declare module "VSS/Utils/File" { +/** +* File encoding values. +*/ +export enum FileEncoding { + Unknown = 0, + Binary = 1, + ASCII = 2, + UTF8 = 3, + UTF32_BE = 4, + UTF32_LE = 5, + UTF16_BE = 6, + UTF16_LE = 7, +} +export function tryDetectFileEncoding(base64Content: string): FileEncoding; +/** +* Combine 2 path segments using the given separator ("/" is the default) +* +* @param path1 First path segment +* @param path2 Second path segment +* @param pathSeparator Optional path separator ("/" is the default) +* @return combined string +*/ +export function combinePaths(path1: string, path2: string, pathSeparator?: string): string; +/** +* Ensure that the given path ends with a separator. If not, add the separator to the end. +* +* @param path Path to verify +* @param pathSeparator Optional path separator ("/" is the default) +* @return resulting string that ends with the separator +*/ +export function ensureTrailingSeparator(path: string, pathSeparator?: string): string; +} +declare module "VSS/Utils/Html" { +export module HtmlNormalizer { + /** + * Normalizes the given html by removing the attributes like script and fixing incomplete tags + * + * @param html Html to normalize + * @return normalized Html + */ + function normalize(html: string): string; + /** + * Normalizes the given html by removing the attributes like script and fixing incomplete tags. + * Also allows the caller to specify additional attributes to remove, like 'class' + * + * @param html Html to normalize + * @param additionalInvalidAttributes set of additional attributes to remove + * @return normalized Html + */ + function normalizeStripAttributes(html: string, additionalInvalidAttributes: string[]): string; + /** + * Sanitizes the given html by fixing incomplete tags and encoding unsafe text + * + * @param html Html to sanitize + * @return sanitized Html + */ + function sanitize(html: string): string; +} +export class TemplateEngine { + /** + * Replaces simple tokens, such as ${Foo}, in the input HTML template. + * + * @param template The HTML markup or text to use as a a template. + * @param data The data to render. + * @return The HTML string with template replacements. + */ + private static _replaceSimpleTemplateTokens(template, data); + /** + * Replaces simple tokens which will not be HTML encoded, such as {{html Foo}}, in the input HTML template. + * + * @param template The HTML markup or text to use as a a template. + * @param data The data to render. + * @return The HTML string with template replacements. + */ + private static _replaceUnencodedTemplateTokens(template, data); + /** + * Replaces foreach style tokens, such as {{each Foo}}, in the input HTML template. + * + * @param template The HTML markup or text to use as a a template. + * @param data The data to render. + * @return The HTML string with template replacements. + */ + private static _replaceForEachTemplateTokens(template, data); + /** + * Replaces a Regex match within some text with a replacement. + * + * @param text The original text. + * @param match A regex match within that text. + * @param replacement The replacement string. + * @return The updated string. + */ + private static _replaceMatch(text, match, replacement); + private static _getEncodedTextPropertyValue(data, propertyPath); + private static _getTextPropertyValue(data, propertyPath); + /** + * Obtains a value from a given data object using a string property path. + * + * @param data An object. + * @param propertyPath A dot separrated property path. Undefined or empty string returns the plain data object. + * @return The resolved data property value or undefined if property was not found. + */ + private static _getPropertyValue(data, propertyPath); + /** + * A poor man's implementation of $.tmpl() from jquery templates. Renderes the + * specified HTML content as a template, using the specified data. + * + * @param template The HTML markup or text to use as a a template. + * @param data The data to render. + * @return A jquery element. + */ + static tmpl(template: string, data: any): string; + /** + * A static template engine for applying JS objects to a "jquery-tmpl" like template. + */ + constructor(); +} +} +declare module "VSS/Utils/Number" { +/** + * @param a + * @param b + * @return + */ +export function defaultComparer(a: any, b: any): number; +/** + * Converts this number to a string in the current culture's locale + * without specifying a precision. So, for example, with Spanish culture, + * (3) gets translated to "3", and (3.1416) becomes "3,1416". The jQuery's + * localeFormat requires a precision (the default is "2" if not specified). + * So 3.localeFormat("N") become "3,00". + * + * @param num The Number to format + * @param includeGroupSeparators If true, use locale-specific + * group separators (i.e. 3,000) in the output + * @param cultureInfo Culture info (CurrentCulture if not specified) + * @return + */ +export function toDecimalLocaleString(num: number, includeGroupSeparators?: boolean, cultureInfo?: any): string; +/** + * @param value + * @return + */ +export function parseLocale(value: string): number; +/** + * @param value + * @return + */ +export function isPositiveNumber(value: any): boolean; +/** + * @param value + * @return + */ +export function parseInvariant(value: string): number; +/** + * @param value + * @param format + * @return + */ +export function localeFormat(value: number, format: string): string; +} +declare module "VSS/Utils/String" { +export var EmptyGuidString: string; +export var empty: string; +export var newLine: string; +export var tab: string; +export var lineFeed: string; +/** + * HTML Encodes the string. Use this method to help prevent cross site scripting attacks + * by cleaning text which may contain HTML elements before the string is display in a web page. + * + * + * @param str The string to be encoded + * @return A copy of the current string which has been HTML encoded + */ +export function htmlEncode(str: string): string; +/** + * HTML Encodes the string. Use this method to help prevent cross site scripting attacks + * by cleaning text which may contain HTML elements before the string is display in a web page. + * Does not encode single quotes. + * + * + * @param str The string to be encoded + * @return A copy of the current string which has been HTML encoded + */ +export function htmlEncodeJavascriptAttribute(str: string): string; +/** + * HTML Decodes the string. + * + * + * @param str The string to be decoded + * @return A copy of the current string which has been HTML decoded + */ +export function htmlDecode(str: string): string; +/** + * HTML Decodes the string. + * + * + * @param str The string to be decoded + * @return + * A copy of the current string which has been HTML decoded. + * > < etc are converted back to HTML form(<, > etc) + * + */ +export function decodeHtmlSpecialChars(str: string): string; +/** + * HTML encodes the string and replaces newlines with HTML break tags. + * Use this method to maintain line breaks when displaying strings. + * + * + * @param str The string to be encoded. + * @return A copy of the current string which has been HTML encoded + */ +export function nl2br(str: string): string; +/** +* returns a string with the first letter as UpperCase and the rest lower case +* Assumes the string is trimmed (no leading white-space) and starts with a valid character +* if the first char is not an alphabet, no char will be made upper case +* @param str The string to be converted. +* @return A copy of the current string which has been sentence cased +*/ +export function toSentenceCase(str: string): string; +/** + * @param a + * @param b + * @return + */ +export function defaultComparer(a: string, b: string): number; +/** + * @param a + * @param b + * @return + */ +export function ignoreCaseComparer(a: string, b: string): number; +/** + * @param a + * @param b + * @return + */ +export function localeComparer(a: string, b: string): number; +/** + * @param a + * @param b + * @return + */ +export function localeIgnoreCaseComparer(a: string, b: string): number; +/** +* Compares 2 strings for equality. +* +* @param a First string to compare +* @param b Second string to compare +* @param ignoreCase If true, do a case-insensitive comparison. +*/ +export function equals(a: string, b: string, ignoreCase?: boolean): boolean; +/** + * @param str + * @param prefix + * @param comparer + * @return + */ +export function startsWith(str: string, prefix: string, comparer?: IComparer): boolean; +/** + * @param str + * @param suffix + * @param comparer + * @return + */ +export function endsWith(str: string, suffix: string, comparer?: IComparer): boolean; +/** + * @param str + * @param subStr + * @return + */ +export function caseInsensitiveContains(str: string, subStr: string): boolean; +/** + * @param format + * @param args + * @return + */ +export function format(format: string, ...args: any[]): string; +/** + * @param format + * @param args + * @return + */ +export function localeFormat(format: string, ...args: any[]): string; +export function containsControlChars(str: string): boolean; +export function containsMismatchedSurrogateChars(str: string): boolean; +/** + * Base64 encodes the string. Uses the native version if available. + * @param s The string that should be encoded. + * @return The string in base64 encoding. + */ +export function base64Encode(s: string): string; +export function isGuid(str: string): boolean; +export function isEmptyGuid(str: string): boolean; +/** Returns a new, pseudo-random uid */ +export function generateUID(): string; +export class StringBuilder { + private _textBuilder; + /** + * Utility class for building strings - similar to the System.Text.StringBuilder .NET class. + */ + constructor(); + /** + * Appends the specified text to the end of the string buffer. + * + * @param text The text to append. + */ + append(text: string): void; + /** + * Appends a new-line to the current text buffer. + */ + appendNewLine(): void; + /** + * Concatenates all text in the string buffer into a single string value. + * + * @return The string version of the accumulated text. + */ + toString(): string; +} +} +declare module "VSS/Utils/UI" { +export function getWheelDelta(e?: any): number; +/** + * @param element + * @param enable + */ +export function enableElement(element: any, enable: boolean): void; +export function makeElementUnselectable(element: any): void; +/** + * Best-effort attempt to set focus on the specified element. Exceptions will be caught and logged to console. + * + * @param element Element to set focus on (DomElement or jQuery element) + * @param delay Optional delay in ms before calling focus + */ +export function tryFocus(element: any, delay?: number): void; +export function alignWidth(element: any, baseWidth: any): void; +/** +* Is the given element in the DOM hierarchy +* +* @param element Element to check if it exists somewhere in the current document +*/ +export function isInDomTree(element: any): boolean; +export function getCustomData(element: any, key: any): any; +export enum KeyCode { + ALT = 18, + BACKSPACE = 8, + CAPS_LOCK = 20, + COMMA = 188, + CONTROL = 17, + DELETE = 46, + DOWN = 40, + END = 35, + ENTER = 13, + ESCAPE = 27, + HOME = 36, + INSERT = 45, + LEFT = 37, + PAGE_DOWN = 34, + PAGE_UP = 33, + PERIOD = 190, + RIGHT = 39, + SEMI_COLON = 186, + FIREFOX_SEMI_COLON = 59, + SHIFT = 16, + SPACE = 32, + TAB = 9, + UP = 38, + F1 = 112, + F2 = 113, + F10 = 121, + IME_INPUT = 229, + N = 78, + P = 80, + Q = 81, + S = 83, + A = 65, + C = 67, + H = 72, + T = 84, + QUESTION_MARK = 191, +} +/** + * Check if only the ctrl key modifier was pressed. + * + * @param e The event object. + */ +export module KeyUtils { + function isExclusivelyCtrl(e: JQueryKeyEventObject): boolean; +} +export module Constants { + var HtmlNewLine: string; + var BlurTimeout: any; +} +export module Measurement { + var _PROBE_ID: string; + function _createProbe($parent: any): JQuery; + /** + * Get a probe element to use to measure + * + * @param $parent Parent element to create a probe under (null for document body) + * @return + */ + function _getProbe($parent?: JQuery): JQuery; + /** + * Get the pixel equivalent for em's + * + * @return + */ + function getUnitEm(): number; + /** + * Get the pixel equivalent for ex's + * + * @return + */ + function getUnitEx(): number; + /** + * Get the pixel equivalent for inches + * + * @return + */ + function getUnitIn(): number; + /** + * Get the scrollbar width in pixels + * + * @param $parent The element to measure + * @return + */ + function getScrollbarWidth($parent: JQuery): number; + /** + * Get the scrollbar height in pixels + * + * @param $parent The element to measure + * @return + */ + function getScrollbarHeight($parent: JQuery): number; + /** + * Get the number of pixels for the given measurement + * + * @param unit Measurement (e.g. "14.5 px" or "2 em") + * @return + */ + function getUnitAsPixel(unit: string): number; +} +/** + * @param tagName + * @param className + */ +export function domElem(tagName: string, className?: string): HTMLElement; +export function htmlEncode(input: any): any; +export module Positioning { + enum VerticalScrollBehavior { + Default = 0, + Top = 1, + Middle = 2, + Bottom = 3, + } + interface IPositionOptions { + /** + * where to align the element (horizontal-vertical) + */ + elementAlign?: string; + /** + * where to align the element against base element (horizontal-vertical) + */ + baseAlign?: string; + /** + * behavior when the element overflows the window (horizontal-vertical) + */ + overflow?: string; + /** + * flag to specify that markers should be used to horizontally align the elements rather than the elements themselves. + */ + alignToMarkerHorizontal?: boolean; + /** + * flag to specify that markers should be used to vertically align the elements rather than the elements themselves. + */ + alignToMarkerVertical?: boolean; + /** + * jQuery object inside the element that should be aligned with the base + */ + elementAlignmentMarker?: JQuery; + /** + * jQuery object inside the base element that should be aligned with the element + */ + baseAlignmentMarker?: JQuery; + /** + * how much extra left offset (if any) should be given to the target element versus the reference element. + */ + leftOffsetPixels?: Number; + /** + * how much extra top offset (if any) should be given to the target element versus the reference element. + */ + topOffsetPixels?: Number; + supportScroll?: boolean; + /** + * prevent setting z-index on the target element + */ + skipZIndexSetting?: boolean; + } + function _topOverflow(top: any): number; + function _bottomOverflow(bottom: any): number; + function _fitHorizontal(position: any, data: any): void; + function _flipHorizontal(position: any, data: any): void; + /** + * Tries to fit the positioned element by using the base element if any overflow exists. + * If still overflow exists after flipping, it shrinks the element where it best fits. + */ + function _fitVertical(position: any, data: any): { + top: any; + shrink: number; + }; + /** + * Tries to flip the positioned element by using the base element if any overflow exists. + * If still overflow exists after flipping, it shrinks the element where it best fits. + */ + function _flipVertical(position: any, data: any): { + top: any; + shrink: any; + }; + /** + * Positions the given element by taking the given base element + * as a reference using the options provided + * + * @param element Element to position + * @param baseElement Reference element for positioning + * @param options Options for positioning + */ + function position(element: any, baseElement: any, options?: IPositionOptions): void; + /** + * Get the first parent of the given element that allows scrolling + * + * @param $element Element to scroll into view + */ + function getVerticalScrollContainer($element: JQuery): JQuery; + /** + * Sets the scroll (top) position of the $container element so that the $element is visible. + * This is a no-op if the element is already visible. + * + * @param $element Element to scroll into view + * @param position The destination position of the element after scrolling (top, middle, bottom) + * @param scrollIfAlreadyVisible + * If true, perform the scroll even if the element is already in view + * + * @param scrollAnimationDuration + * If true, scroll with animation using the given animation time + * + */ + function scrollIntoViewVertical($element: JQuery, position?: Positioning.VerticalScrollBehavior, scrollIfAlreadyVisible?: boolean, scrollAnimationDuration?: number): void; +} +export function attachResize(element: any, handler: (e: JQueryEventObject, args?) => void): void; +export function detachResize(element: any): void; +export function clearResizeHandlers(): void; +export interface SelectionRange { + $startNode: JQuery; + $endNode: JQuery; + startNodeOffset: number; + endNodeOffset: number; +} +export interface IBrowserInformation { + msie?: boolean; + edge?: boolean; + chrome?: boolean; + safari?: boolean; + mozilla?: boolean; + webkit?: boolean; + version?: string; +} +export module BrowserCheckUtils { + function isFirefox(): boolean; + function isChrome(): boolean; + function isMozilla(): boolean; + function isMsie(): boolean; + function isIE(): boolean; + function isEdge(): boolean; + function getVersion(): string; + function isIEVersion(version: number): boolean; + function isLessThanOrEqualToIE9(): boolean; + function isLessThanOrEqualToIE8(): boolean; +} +export module SelectionUtils { + function getSelection(): SelectionRange; + function selectInputText($input: JQuery, startPosition: number, endPosition: number, focus: boolean): void; +} +export module HtmlInsertionUtils { + function pasteHtmlAtCaret(html: string, parentWindow?: Window): void; +} +export enum HotKeyCombination { + None = 0, + Ctrl = 1, + Alt = 2, + Shift = 3, + CtrlShift = 4, + CtrlAlt = 5, +} +export interface HotKey { + combination: HotKeyCombination; + which: number; + displayText: string; + handler: () => boolean; +} +export interface IGlobalHotKeyManager { + registerHotKey: (hotKey: HotKey) => void; + registerCtrlAltHotkey: (which: number, text: string, handler: () => boolean) => void; + dispose: () => void; +} +export var globalHotKeyManager: IGlobalHotKeyManager; +export interface ISectionManager { + identifySections: () => void; + nextSection: () => boolean; + previousSection: () => boolean; +} +export var sectionManager: ISectionManager; +export interface IFilterGroup { + start: number; + end: number; + level: number; +} +export function updateFilterGroups(groups: IFilterGroup[], clauseNumber: number, insert: boolean): IFilterGroup[]; +export function updateFilterGroupLevels(groups: IFilterGroup[]): number; +export function findTreeNode(path: string, separator: string, comparer: IComparer, textField: string): any; +export function calculateTreePath(includeRoot: boolean, separator: string, textField: string, rootField: string): string; +export function walkTree(f: IFunctionPPR): void; +export function injectStylesheets(cssReferenceUrls: string[], baseUrl?: string): void; +export function accessible(element: JQuery, handler?: Function): JQuery; +export function Watermark(element: JQuery, ...args: any[]): JQuery; +} +declare module "VSS/Utils/Url" { +import Service = require("VSS/Service"); +/** + * Check if specified URL is safe - i.e. part of an approved list of URL schemes. + * + * @param url Url to check. + * @returns {boolean} + */ +export function isSafeProtocol(url: string): boolean; +/** + * Return a new url that adds (if the given parameter name does not exist in the url), + * or replaces the value of given parameter name with the given parameter value. + * + * @param url The original url. + * @param paramName The parameter name to replace in the url. + * @param paramValue The parameter value to replace in the url. + * @returns {string} + */ +export function replaceUrlParam(url: string, paramName: string, paramValue: string): string; +/** + * Verifies that the given url is within the constraints of 2000 characters. + * + * @param url The url to verify. + * @returns {boolean} + */ +export function isUrlWithinConstraints(url: string): boolean; +export class UrlTranslatorService implements Service.ILocalService { + private _urlTranslators; + /** + * Registers a URL translator function. + * + * @param translatorFunction The translator function of the form function(url, options, successCallback, errorCallback, nextTranslator){} + * @param order The order of the translator function. + */ + registerUrlTranslator(translatorFunction: Function, order?: number): void; + beginTranslateUrl(url: string, options?: any, callback?: IFunctionPR, errorCallback?: IErrorCallback): void; +} +export function getTranslatorService(): UrlTranslatorService; +} +declare module "VSS/VSS" { +export var uiCulture: string; +export var errorHandler: ErrorHandler; +export var globalProgressIndicator: GlobalProgressIndicator; +export var activtyStatsCollector: ActivtyStatsCollector; +/** + * @param data + */ +export function queueCallbacks(context: any, callback: IResultCallback, errorCallback: IErrorCallback, data?: any): IQueueCallbacksResult; +export interface IQueueCallbacksResult { + cookie: number; + count: IFunctionPR; + finish: IArgsFunctionR; + error: IArgsFunctionR; + register: (callback: IResultCallback, errorCallback: IErrorCallback, data: any) => number; + unregister: (cookie: number) => void; +} +/** + * Queues a request for a piece of data. Handles situations where the data has already been + * retrieved as well as when multiple requests are pending for the same data. When the data has + * already been retrieved, the successCallback will be invoked immediately. When multiple + * requests are pending for the same data, each of the callers will be notified when the data + * request has been completed (worker will only be invoked once). + * + * Sample usage: This will invoke the worker function using the current object as the context. The "_teamSettings" + * property of the current object will be checked for a value before invoking the worker. If the value + * needs to be looked up, the worker will be invoked and it will make a request for the data. If the + * request is completed successfully the data is passed to the succeeded callback. If there is an error + * with the request the failed callback is invoked. + * + * queueRequest(this, this, "_teamSettings", successCallback, errorCallback, + * function (succeeded, failed) { + * Ajax.getMSJSON(url, null, function (teamSettings) { + * succeeded(teamSettings); + * }, failed); + * }); + * + * @param context The "this" that the worker and successCallback functions will be invoked with. + * @param target + * The object which the propName property should be checked on to see if the request has already been performed. + * If the property has a value (that is not a function), then the success callback is invoked immediately with the properties value as the result. + * If the property does not have a value, the request is processed and the result is stored in the property. + * + * @param propName Name of the property on the target to store the result in and check to see if the request is needed. + * @param successCallback Function invoked when the request is completed. The function should take the "result" as its first parameter. + * @param errroCallback Function invoked when the request has completed with an error. The function should take the "error" as its first parameter. + * @param worker + * This is the which performs the work to retrieve the data. The function should have the following signature: + * function worker(succeeded, failed) + * + * The worker should invoke the "succeeded" function that it is provided passing it the result. If an error occurs the worker should invoke the + * "failed" function with the error. + * + * NOTE: It is important to note that the "successCallback" is not the same as the "succeeded" callback provided to the worker + * function. It is important for the worker to invoke the callbacks it is provided with rather than the callbacks which are + * provided to the queueRequest method. The same holds true for the failed callback provided to the worker function. + * + */ +export function queueRequest(context: any, target: any, propName: string, successCallback: IResultCallback, errorCallback: IErrorCallback, worker: IResultCallback): void; +/** + * Checks if a queued request has been completed. + * + * @param cachedResult The property passed to queueRequest as target[propName] + */ +export function queuedRequestHasResult(cachedResult: any): boolean; +export function getErrorMessage(errorString: string): string; +export function getErrorMessage(errorFunction: Function): string; +export function getErrorMessage(error: Error): string; +export interface errorPublisher { + publishError(error: TfsError): void; +} +export class ErrorHandler { + $error: JQuery; + visible: boolean; + private _errorPublishers; + /** + * Global error handler class which is attached to TFS + */ + constructor(); + /** + * (Internal function) Initializes error handler + */ + initialize(): void; + private attachWindowErrorHandler(); + private attachQPromiseErrorHandler(); + private publishError(error); + /** + * (Internal function) Checks whether error container exists or not + */ + exists(): boolean; + /** + * (Internal function) Shows error in the container + */ + showError(message: string, status?: string, stackTrace?: string): void; + /** + * (Internal function) Hides the error when clicked + */ + hideError(): void; + /** + * Displays error in a container. If no container is found, error + * message is displayed in an alert dialog + */ + show(error: TfsError): void; + /** + * Add error publisher to ErrorHander class + */ + attachErrorPublisher(errorPublisher: errorPublisher): void; + /** + * Remove error publisher to ErrorHander class + */ + detachErrorPublisher(errorPublisher: errorPublisher): void; +} +/** + * @param callback + * @param context + */ +export function handleError(error: TfsError, callback?: IErrorCallback, context?: any): void; +/**Remove in M91 **/ +export class ClientActivtyStatistic { + name: string; + id: string; + parentId: string; + startOffset: number; + duration: number; + constructor(); +} +export class ActivtyStatistic { + name: string; + id: string; + parentId: string; + status: number; + actionDate: Date; + constructor(); +} +export interface ActivtyStatsCollectionAllowedCallback { + (): boolean; +} +export class ActivtyStatsCollector { + static ACTIVITY_COLLECTION_STATUS: string; + static ACTIVITY_ID_STORAGE_ITEM: string; + static ACTIVITY_CLIENT_STATE_STORAGE_ITEM: string; + static CURRENT_PAGE: string; + /** + * Global handler for logging activity data + */ + constructor(); + addActivtyStatsCollectionAllowedCallback(activtyStatsCollectionAllowedCallback: ActivtyStatsCollectionAllowedCallback): void; + actionStarted(name: string): number; + actionCompleted(id: number, jqXHR: JQueryXHR): void; + logActivity(activityId: string, page: string): void; + logClientStats(): void; + getClientStatistics(): IDictionaryStringTo; + getActivtyStatistics(): ActivtyStatistic[]; + clearStats(): void; + collectStats(shouldCollect: boolean): void; + getCurrentPage(): ActivtyStatistic; + setCurrentPage(currentPage: ActivtyStatistic): void; + isCollectingStats(): boolean; +} +export class GlobalProgressIndicator { + private _progressPendingActions; + private _progressPendingActionsCount; + private _progressPendingActionsNewId; + private _pageProgressElements; + private _pageProgressDelayShowTimeout; + private _pageProgressMinShowTimeout; + private _showingProgress; + /** + * Global handler for displaying progress during page loads, module_ loads, ajax requests, or any other registered long-running operations + */ + constructor(); + getProgressElements(): JQuery[]; + registerProgressElement(element: JQuery): void; + unRegisterProgressElement(element: JQuery): void; + private _addProgressElement(element); + private _showProgressElements(); + private _hideProgressElements(); + actionStarted(name: string, immediate?: boolean): number; + actionCompleted(id: number): void; + getPendingActions(): string[]; +} +export function hasUnloadRequest(): boolean; +export function classExtend(ctor: any, members: any): any; +export function getTypeName(type: any): string; +export function initClassPrototype(ctor: Function, members: any): void; +export function getModuleBase(moduleName: string): string; +export function using(moduleNames: string[], moduleLoaded: any): void; +export function tfsModuleLoaded(moduleName: string, moduleExports: any): void; +} +declare module "VSS/WebApi/Constants" { +export module AuthenticationResourceIds { + var AuthenticationLocationId: string; + var AreaId: string; + var AuthenticationAreaName: string; + var SessionTokenResource: string; +} +export module BlobCopyLocationIds { + var ResourceId: string; + var ResourceString: string; + var ResouceName: string; + var AreaName: string; +} +export module CommonIdentityPickerResourceIds { + var IdentitiesLocationId: string; + var IdentityAvatarLocationId: string; + var IdentityFeatureMruLocationId: string; + var IdentityConnectionsLocationId: string; + var ServiceArea: string; + var IdentitiesResource: string; +} +export module ContributionsResourceIds { + var InstalledAppsLocationId: string; + var InstalledAppsByNameLocationId: string; + var VDiscId: string; + var AreaId: string; + var ContributionsAreaName: string; + var InstalledAppsLocationIdString: string; + var InstalledAppsByNameLocationIdString: string; + var ExtensionsAreaName: string; +} +export module CustomerIntelligenceResourceIds { + var EventsLocationId: string; + var AreaId: string; + var CustomerIntelligenceAreaName: string; +} +export module DatabaseMigrationLocationIds { + var ResourceId: string; + var ResourceString: string; + var ResouceName: string; + var AreaName: string; +} +export module DataImportLocationIds { + var DataImportEntryLocationId: string; + var AreaId: string; + var AreaName: string; + var DataImportResource: string; +} +export module FeatureAvailabilityResourceIds { + var FeatureFlagsLocationId: string; + var AreaId: string; + var FeatureAvailabilityAreaName: string; +} +export module IdentityMruResourceIds { + var MruIdentitiesLocationId: string; + var AreaId: string; + var AreaName: string; + var MruIdentitiesResource: string; +} +export module LocationResourceIds { + var ConnectionData: string; + var ServiceDefinitions: string; + var AccessMappings: string; + var LocationServiceArea: string; + var ConnectionDataResource: string; + var ServiceDefinitionsResource: string; + var AccessMappingsResource: string; +} +export module OperationsResourceIds { + var OperationsLocationId: string; + var AreaName: string; + var OperationsResource: string; + var OperationsRouteName: string; + var OperationsApi: string; +} +export module ServiceInstanceTypes { + var SPS: string; + var TFS: string; + var TFSOnPremises: string; + var SpsExtension: string; + var SDKSample: string; + var SPSString: string; + var TFSString: string; + var TFSOnPremisesString: string; + var SpsExtensionString: string; + var SDKSampleString: string; +} +} +declare module "VSS/WebApi/Contracts" { +import VSS_Licensing_Contracts = require("VSS/Licensing/Contracts"); +/** + * Information about the location of a REST API resource + */ +export interface ApiResourceLocation { + /** + * Area name for this resource + */ + area: string; + /** + * Unique Identifier for this location + */ + id: string; + /** + * Maximum api version that this resource supports (current server version for this resource) + */ + maxVersion: string; + /** + * Minimum api version that this resource supports + */ + minVersion: string; + /** + * The latest version of this resource location that is in "Release" (non-preview) mode + */ + releasedVersion: string; + /** + * Resource name + */ + resourceName: string; + /** + * The current resource version supported by this resource location + */ + resourceVersion: number; + /** + * This location's route template (templated relative path) + */ + routeTemplate: string; +} +/** + * Represents version information for a REST Api resource + */ +export interface ApiResourceVersion { + /** + * String representation of the Public API version. This is the version that the public sees and is used for a large group of services (e.g. the TFS 1.0 API) + */ + apiVersion: string; + /** + * Is the public API version in preview + */ + isPreview: boolean; + /** + * Internal resource version. This is defined per-resource and is used to support build-to-build compatibility of API changes within a given (in-preview) public api version. For example, within the TFS 1.0 API release cycle, while it is still in preview, a resource's data structure may be changed. This resource can be versioned such that older clients will still work (requests will be sent to the older version) and new/upgraded clients will talk to the new version of the resource. + */ + resourceVersion: number; +} +export enum ConnectOptions { + /** + * Retrieve no optional data. + */ + None = 0, + /** + * Includes information about AccessMappings and ServiceDefinitions. + */ + IncludeServices = 1, +} +export interface ExtensionLicenseData { + createdDate: Date; + extensionId: string; + isFree: boolean; + minimumRequiredAccessLevel: VSS_Licensing_Contracts.VisualStudioOnlineServiceLevel; + updatedDate: Date; +} +export interface IdentityRef { + displayName: string; + id: string; + imageUrl: string; + isAadIdentity: boolean; + isContainer: boolean; + profileUrl: string; + uniqueName: string; + url: string; +} +/** + * The JSON model for JSON Patch Operations + */ +export interface JsonPatchDocument { +} +/** + * The JSON model for a JSON Patch operation + */ +export interface JsonPatchOperation { + /** + * The path to copy from for the Move/Copy operation. + */ + from: string; + /** + * The patch operation + */ + op: Operation; + /** + * The path for the operation + */ + path: string; + /** + * The value for the operation. This is either a primitive or a JToken. + */ + value: any; +} +export interface JsonWebToken { +} +export enum JWTAlgorithm { + None = 0, + HS256 = 1, + RS256 = 2, +} +export enum Operation { + Add = 0, + Remove = 1, + Replace = 2, + Move = 3, + Copy = 4, + Test = 5, +} +export interface Publisher { + /** + * Name of the publishing service. + */ + name: string; + /** + * Service Owner Guid Eg. Tfs : 00025394-6065-48CA-87D9-7F5672854EF7 + */ + serviceOwnerId: string; +} +/** + * The class to represent a REST reference link. Example: { self: { href: "http://localhost:8080/tfs/DefaultCollection/_apis/wit/workItems/1" } } RFC: http://tools.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them. + */ +export interface ReferenceLink { + href: string; +} +export interface ResourceRef { + id: string; + url: string; +} +export interface ServiceEvent { + /** + * This is the id of the type. Constants that will be used by subscribers to identify/filter events being published on a topic. + */ + eventType: string; + /** + * This is the service that published this event. + */ + publisher: Publisher; + /** + * The resource object that carries specific information about the event. The object must have the ServiceEventObject applied for serialization/deserialization to work. + */ + resource: any; + /** + * This dictionary carries the context descriptors along with their ids. + */ + resourceContainers: { + [key: string]: any; + }; + /** + * This is the version of the resource. + */ + resourceVersion: string; +} +export interface VssJsonCollectionWrapper extends VssJsonCollectionWrapperBase { + value: any[]; +} +/** + * This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole + */ +export interface VssJsonCollectionWrapperV extends VssJsonCollectionWrapperBase { + value: T; +} +export interface VssJsonCollectionWrapperBase { + count: number; +} +export interface WrappedException { + customProperties: { + [key: string]: any; + }; + errorCode: number; + eventId: number; + helpLink: string; + innerException: WrappedException; + message: string; + stackTrace: string; + typeKey: string; + typeName: string; +} +export var TypeInfo: { + ApiResourceLocation: { + fields: any; + }; + ApiResourceVersion: { + fields: any; + }; + ConnectOptions: { + enumValues: { + "none": number; + "includeServices": number; + }; + }; + ExtensionLicenseData: { + fields: any; + }; + IdentityRef: { + fields: any; + }; + JsonPatchDocument: { + fields: any; + }; + JsonPatchOperation: { + fields: any; + }; + JsonWebToken: { + fields: any; + }; + JWTAlgorithm: { + enumValues: { + "none": number; + "hS256": number; + "rS256": number; + }; + }; + Operation: { + enumValues: { + "add": number; + "remove": number; + "replace": number; + "move": number; + "copy": number; + "test": number; + }; + }; + Publisher: { + fields: any; + }; + ReferenceLink: { + fields: any; + }; + ResourceRef: { + fields: any; + }; + ServiceEvent: { + fields: any; + }; + VssJsonCollectionWrapper: { + fields: any; + }; + VssJsonCollectionWrapperV: { + fields: any; + }; + VssJsonCollectionWrapperBase: { + fields: any; + }; + WrappedException: { + fields: any; + }; +}; +} +declare module "VSS/WebApi/RestClient" { +import Q = require("q"); +import Serialization = require("VSS/Serialization"); +import WebApi_Contracts = require("VSS/WebApi/Contracts"); +/** +* Parameters for sending a WebApi request +*/ +export interface VssApiResourceRequestParams { + /** + * Name of the area for the resource + */ + area: string; + /** + * Unique identifier for the resource's route to issue a request to. Used to lookup the route template + * for this request if the routeTemplate parameter is not supplied or for version negotiation in S2S calls. + * This is required to ensure any S2S calls work. + */ + locationId: string; + /** + * Route template that is used to form the request path. If routeTemplate is NOT specified, then locationId + * is used to lookup the template via an OPTIONS request. + */ + routeTemplate?: string; + /** + * Name of the resource to use in route template replacements. Only used if routeTemplate is provided. + */ + resource?: string; + /** + * Dictionary of route template replacement values + */ + routeValues?: { + [key: string]: any; + }; + /** + * Data to post. In this case of a GET, this indicates query parameters. + * For other requests, this is the request body object (which will be serialized + * into a JSON string unless isRawData is set to true). + */ + data?: any; + /** + * Query parameters to add to the url. In the case of a GET, query parameters can + * be supplied via 'data' or 'queryParams'. For other verbs such as POST, the + * data object specifies the POST body, so queryParams is needed to indicate + * parameters to add to the query string of the url (not included in the post body). + */ + queryParams?: IDictionaryStringTo; + /** + * HTTP verb (GET by default if not specified) + */ + httpMethod?: string; + /** + * The http response (Accept) type. This is "json" (corresponds to application/json Accept header) + * unless otherwise specified. Other possible values are "html", "text", "zip", or "binary" or their accept + * header equivalents (e.g. application/zip). + */ + httpResponseType?: string; + /** + * Contract metadata for the request body. This allows us to do the necessary serialization + * for the provided 'data' object using VSS serialization settings. + */ + requestType?: Serialization.ContractMetadata; + /** + * Contract metadata for the response. This allows us to do the necessary deserialization + * for the response object using VSS serialization settings. + */ + responseType?: Serialization.ContractMetadata; + /** + * Indicates that the response is expected to be a wrapped array, so unwrap the response to + * a regular array. + */ + responseIsCollection?: boolean; + /** + * Allows the caller to specify custom request headers. + */ + customHeaders?: { + [headerName: string]: any; + }; + /** + * Request timeout in milliseconds. The default is 5 minutes. + */ + timeout?: number; + /** + * The api version string to send in the request (e.g. "1.0" or "2.0-preview.2") + */ + apiVersion?: string; + /** + * If true, this indicates that no processing should be done on the 'data' object + * before it is sent in the request. *This is rarely needed*. One case is when posting + * an HTML5 File object. + */ + isRawData?: boolean; +} +/** +* Base class that should be used (derived from) to make requests to VSS REST apis +*/ +export class VssHttpClient { + private static APIS_RELATIVE_PATH; + private static DEFAULT_REQUEST_TIMEOUT; + private static _legacyDateRegExp; + private _locationsByAreaPromises; + _rootRequestPath: string; + authTokenManager: IAuthTokenManager; + private _initializationPromise; + forceOptionsCallForAutoNegotiate: boolean; + constructor(rootRequestPath: string); + /** + * Sets a promise that is waited on before any requests are issued. Can be used to asynchronously + * set the request url and auth token manager. + */ + _setInitializationPromise(promise: IPromise): void; + /** + * Issue a request to a VSS REST endpoint. + * + * @param requestParams request options + * @param useAjaxResult If true, textStatus and jqXHR are added to the success callback. In this case, spread (instead of then) needs to be used + * @returns Q Promise for the response + */ + _beginRequest(requestParams: VssApiResourceRequestParams, useAjaxResult?: boolean): IPromise; + _autoNegotiateApiVersion(location: WebApi_Contracts.ApiResourceLocation, requestedVersion: string): string; + private _beginRequestToResolvedUrl(requestUrl, apiVersion, requestParams, deferred, useAjaxResult); + /** + * Issue a request to a VSS REST endpoint and makes sure the result contains jqXHR. Use spread to access jqXHR. + * + * @param requestParams request options + * @returns Q Promise for the response + */ + _beginRequestWithAjaxResult(requestParams: VssApiResourceRequestParams): Q.Promise; + /** + * Issue an AJAX request. This is a wrapper around jquery's ajax method that handles VSS authentication + * and triggers events that can be listened to by other modules. + * + * @param requestUrl Url to send the request to + * @param ajaxOptions jQuery.ajax options + * @param useAjaxResult If true, textStatus and jqXHR are added to the success callback. In this case, spread (instead of then) needs to be used. + */ + _issueAjaxRequest(requestUrl: string, ajaxOptions: JQueryAjaxSettings, useAjaxResult?: boolean): IPromise; + /** + * Gets information about an API resource location (route template, supported versions, etc.) + * + * @param area resource area name + * @param locationId Guid of the location to get + */ + _beginGetLocation(area: string, locationId: string): IPromise; + private beginGetAreaLocations(area); + protected getRequestUrl(routeTemplate: string, area: string, resource: string, routeValues: any, queryParams?: IDictionaryStringTo): string; + private replaceRouteValues(routeTemplate, routeValues); + _getLinkResponseHeaders(xhr: XMLHttpRequest): { + [relName: string]: string; + }; +} +} +declare module "TFS/Build/Contracts" { +import TFS_Core_Contracts = require("TFS/Core/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +export interface AgentPoolQueue extends ShallowReference { + _links: any; + /** + * The pool used by this queue. + */ + pool: TaskAgentPoolReference; +} +export enum AgentStatus { + /** + * Indicates that the build agent cannot be contacted. + */ + Unavailable = 0, + /** + * Indicates that the build agent is currently available. + */ + Available = 1, + /** + * Indicates that the build agent has taken itself offline. + */ + Offline = 2, +} +export interface ArtifactResource { + _links: any; + /** + * The type-specific resource data. For example, "#/10002/5/drop", "$/drops/5", "\\myshare\myfolder\mydrops\5" + */ + data: string; + /** + * Link to the resource. This might include things like query parameters to download as a zip file + */ + downloadUrl: string; + /** + * Properties of Artifact Resource + */ + properties: { + [key: string]: string; + }; + /** + * The type of the resource: File container, version control folder, UNC path, etc. + */ + type: string; + /** + * Link to the resource + */ + url: string; +} +export enum AuditAction { + Add = 1, + Update = 2, + Delete = 3, +} +/** + * Data representation of a build + */ +export interface Build { + _links: any; + /** + * Build number/name of the build + */ + buildNumber: string; + /** + * Build number revision + */ + buildNumberRevision: number; + /** + * The build controller. This should only be set if the definition type is Xaml. + */ + controller: BuildController; + /** + * The definition associated with the build + */ + definition: DefinitionReference; + /** + * Indicates whether the build has been deleted. + */ + deleted: boolean; + /** + * Demands + */ + demands: any[]; + /** + * Time that the build was completed + */ + finishTime: Date; + /** + * Id of the build + */ + id: number; + keepForever: boolean; + /** + * Process or person that last changed the build + */ + lastChangedBy: VSS_Common_Contracts.IdentityRef; + /** + * Date the build was last changed + */ + lastChangedDate: Date; + /** + * Log location of the build + */ + logs: BuildLogReference; + /** + * Orchestration plan for the build + */ + orchestrationPlan: TaskOrchestrationPlanReference; + /** + * Parameters for the build + */ + parameters: string; + /** + * The build's priority + */ + priority: QueuePriority; + /** + * The team project + */ + project: TFS_Core_Contracts.TeamProjectReference; + properties: any; + /** + * Quality of the xaml build (good, bad, etc.) + */ + quality: string; + /** + * The queue. This should only be set if the definition type is Build. + */ + queue: AgentPoolQueue; + /** + * Queue option of the build. + */ + queueOptions: QueueOptions; + /** + * The current position of the build in the queue + */ + queuePosition: number; + /** + * Time that the build was queued + */ + queueTime: Date; + /** + * Reason that the build was created + */ + reason: BuildReason; + /** + * The repository + */ + repository: BuildRepository; + /** + * The identity that queued the build + */ + requestedBy: VSS_Common_Contracts.IdentityRef; + /** + * The identity on whose behalf the build was queued + */ + requestedFor: VSS_Common_Contracts.IdentityRef; + /** + * The build result + */ + result: BuildResult; + /** + * Source branch + */ + sourceBranch: string; + /** + * Source version + */ + sourceVersion: string; + /** + * Time that the build was started + */ + startTime: Date; + /** + * Status of the build + */ + status: BuildStatus; + tags: string[]; + /** + * Uri of the build + */ + uri: string; + /** + * REST url of the build + */ + url: string; + validationResults: BuildRequestValidationResult[]; +} +export interface BuildAgent { + buildDirectory: string; + controller: ShallowReference; + createdDate: Date; + description: string; + enabled: boolean; + id: number; + messageQueueUrl: string; + name: string; + reservedForBuild: string; + server: ShallowReference; + status: AgentStatus; + statusMessage: string; + updatedDate: Date; + uri: string; + url: string; +} +export interface BuildArtifact { + /** + * The artifact id + */ + id: number; + /** + * The name of the artifact + */ + name: string; + /** + * The actual resource + */ + resource: ArtifactResource; +} +export interface BuildArtifactAddedEvent extends BuildUpdatedEvent { + artifact: BuildArtifact; +} +export enum BuildAuthorizationScope { + /** + * The identity used should have build service account permissions scoped to the project collection. This is useful when resources for a single build are spread across multiple projects. + */ + ProjectCollection = 1, + /** + * The identity used should have build service account permissions scoped to the project in which the build definition resides. This is useful for isolation of build jobs to a particular team project to avoid any unintentional escalation of privilege attacks during a build. + */ + Project = 2, +} +/** + * Data representation of a build badge + */ +export interface BuildBadge { + /** + * Build id, if exists that this badge corresponds to + */ + buildId: number; + /** + * Self Url that generates SVG + */ + imageUrl: string; +} +export interface BuildCompletedEvent extends BuildUpdatedEvent { +} +export interface BuildController extends ShallowReference { + _links: any; + /** + * The date the controller was created. + */ + createdDate: Date; + /** + * The description of the controller. + */ + description: string; + /** + * Indicates whether the controller is enabled. + */ + enabled: boolean; + /** + * The status of the controller. + */ + status: ControllerStatus; + /** + * The date the controller was last updated. + */ + updatedDate: Date; + /** + * The controller's URI. + */ + uri: string; +} +export interface BuildDefinition extends BuildDefinitionReference { + _links: any; + /** + * Indicates whether badges are enabled for this definition + */ + badgeEnabled: boolean; + build: BuildDefinitionStep[]; + /** + * The build number format + */ + buildNumberFormat: string; + /** + * The comment entered when saving the definition + */ + comment: string; + demands: any[]; + /** + * The description + */ + description: string; + /** + * The drop location for the definition + */ + dropLocation: string; + /** + * Gets or sets the job authorization scope for builds which are queued against this definition + */ + jobAuthorizationScope: BuildAuthorizationScope; + /** + * Gets or sets the job execution timeout in minutes for builds which are queued against this definition + */ + jobTimeoutInMinutes: number; + options: BuildOption[]; + properties: any; + /** + * The repository + */ + repository: BuildRepository; + retentionRules: RetentionPolicy[]; + triggers: BuildTrigger[]; + variables: { + [key: string]: BuildDefinitionVariable; + }; +} +export interface BuildDefinitionChangedEvent { + changeType: AuditAction; + definition: BuildDefinition; +} +export interface BuildDefinitionChangingEvent { + changeType: AuditAction; + newDefinition: BuildDefinition; + originalDefinition: BuildDefinition; +} +export interface BuildDefinitionReference extends DefinitionReference { + /** + * The author of the definition. + */ + authoredBy: VSS_Common_Contracts.IdentityRef; + /** + * If this is a draft definition, it might have a parent + */ + draftOf: DefinitionReference; + /** + * The quality of the definition document (draft, etc.) + */ + quality: DefinitionQuality; + /** + * The default queue which should be used for requests. + */ + queue: AgentPoolQueue; +} +export interface BuildDefinitionRevision { + changedBy: VSS_Common_Contracts.IdentityRef; + changedDate: Date; + changeType: AuditAction; + comment: string; + definitionUrl: string; + name: string; + revision: number; +} +export interface BuildDefinitionSourceProvider { + /** + * Uri of the associated definition + */ + definitionUri: string; + /** + * fields associated with this build definition + */ + fields: { + [key: string]: string; + }; + /** + * Id of this source provider + */ + id: number; + /** + * The lst time this source provider was modified + */ + lastModified: Date; + /** + * Name of the source provider + */ + name: string; + /** + * Which trigger types are supported by this definition source provider + */ + supportedTriggerTypes: DefinitionTriggerType; +} +export interface BuildDefinitionStep { + alwaysRun: boolean; + continueOnError: boolean; + displayName: string; + enabled: boolean; + inputs: { + [key: string]: string; + }; + task: TaskDefinitionReference; +} +export interface BuildDefinitionTemplate { + canDelete: boolean; + category: string; + description: string; + iconTaskId: string; + id: string; + name: string; + template: BuildDefinition; +} +export interface BuildDefinitionVariable { + allowOverride: boolean; + isSecret: boolean; + value: string; +} +export interface BuildDeletedEvent extends RealtimeBuildEvent { + build: Build; +} +export interface BuildDeployment { + deployment: BuildSummary; + sourceBuild: ShallowReference; +} +/** + * Represents a build log. + */ +export interface BuildLog extends BuildLogReference { + /** + * The date the log was created. + */ + createdOn: Date; + /** + * The date the log was last changed. + */ + lastChangedOn: Date; + /** + * The number of lines in the log. + */ + lineCount: number; +} +/** + * Data representation of a build log reference + */ +export interface BuildLogReference { + /** + * The id of the log. + */ + id: number; + /** + * The type of the log location. + */ + type: string; + /** + * Full link to the log resource. + */ + url: string; +} +export interface BuildOption { + definition: BuildOptionDefinitionReference; + enabled: boolean; + inputs: { + [key: string]: string; + }; +} +export interface BuildOptionDefinition extends BuildOptionDefinitionReference { + description: string; + groups: BuildOptionGroupDefinition[]; + inputs: BuildOptionInputDefinition[]; + name: string; + ordinal: number; +} +export interface BuildOptionDefinitionReference { + id: string; +} +export interface BuildOptionGroupDefinition { + displayName: string; + isExpanded: boolean; + name: string; +} +export interface BuildOptionInputDefinition { + defaultValue: string; + groupName: string; + help: { + [key: string]: string; + }; + label: string; + name: string; + options: { + [key: string]: string; + }; + required: boolean; + type: BuildOptionInputType; + visibleRule: string; +} +export enum BuildOptionInputType { + String = 0, + Boolean = 1, + StringList = 2, + Radio = 3, + PickList = 4, + MultiLine = 5, +} +export enum BuildPhaseStatus { + /** + * The state is not known. + */ + Unknown = 0, + /** + * The build phase completed unsuccessfully. + */ + Failed = 1, + /** + * The build phase completed successfully. + */ + Succeeded = 2, +} +export interface BuildPollingSummaryEvent { +} +export interface BuildProcessTemplate { + description: string; + fileExists: boolean; + id: number; + parameters: string; + serverPath: string; + supportedReasons: BuildReason; + teamProject: string; + templateType: ProcessTemplateType; + url: string; + version: string; +} +export enum BuildQueryOrder { + /** + * Order by finish time ascending. + */ + FinishTimeAscending = 2, + /** + * Order by finish time descending. + */ + FinishTimeDescending = 3, +} +export enum BuildReason { + /** + * No reason. This value should not be used. + */ + None = 0, + /** + * The build was started manually. + */ + Manual = 1, + /** + * The build was started for the trigger TriggerType.ContinuousIntegration. + */ + IndividualCI = 2, + /** + * The build was started for the trigger TriggerType.BatchedContinuousIntegration. + */ + BatchedCI = 4, + /** + * The build was started for the trigger TriggerType.Schedule. + */ + Schedule = 8, + /** + * The build was created by a user. + */ + UserCreated = 32, + /** + * The build was started manually for private validation. + */ + ValidateShelveset = 64, + /** + * The build was started for the trigger ContinuousIntegrationType.Gated. + */ + CheckInShelveset = 128, + /** + * The build was triggered for retention policy purposes. + */ + Triggered = 175, + /** + * All reasons. + */ + All = 239, +} +export interface BuildRepository { + checkoutSubmodules: boolean; + /** + * Indicates whether to clean the target folder when getting code from the repository. This is a String so that it can reference variables. + */ + clean: string; + /** + * Gets or sets the name of the default branch. + */ + defaultBranch: string; + id: string; + /** + * Gets or sets the friendly name of the repository. + */ + name: string; + properties: { + [key: string]: string; + }; + /** + * Gets or sets the root folder. + */ + rootFolder: string; + /** + * Gets or sets the type of the repository. + */ + type: string; + /** + * Gets or sets the url of the repository. + */ + url: string; +} +export interface BuildRequestValidationResult { + message: string; + result: ValidationResult; +} +export interface BuildResourceUsage { + distributedTaskAgents: number; + totalUsage: number; + xamlControllers: number; +} +export enum BuildResult { + /** + * No result + */ + None = 0, + /** + * The build completed successfully. + */ + Succeeded = 2, + /** + * The build completed compilation successfully but had other errors. + */ + PartiallySucceeded = 4, + /** + * The build completed unsuccessfully. + */ + Failed = 8, + /** + * The build was canceled before starting. + */ + Canceled = 32, +} +export interface BuildServer { + agents: ShallowReference[]; + controller: ShallowReference; + id: number; + isVirtual: boolean; + messageQueueUrl: string; + name: string; + requireClientCertificates: boolean; + status: ServiceHostStatus; + statusChangedDate: Date; + uri: string; + url: string; + version: number; +} +export interface BuildSettings { + defaultRetentionPolicy: RetentionPolicy; + maximumRetentionPolicy: RetentionPolicy; +} +export interface BuildStartedEvent extends BuildUpdatedEvent { +} +export enum BuildStatus { + /** + * No status. + */ + None = 0, + /** + * The build is currently in progress. + */ + InProgress = 1, + /** + * The build has completed. + */ + Completed = 2, + /** + * The build is cancelling + */ + Cancelling = 4, + /** + * The build is inactive in the queue. + */ + Postponed = 8, + /** + * The build has not yet started. + */ + NotStarted = 32, + /** + * All status. + */ + All = 47, +} +export interface BuildSummary { + build: ShallowReference; + finishTime: Date; + keepForever: boolean; + quality: string; + reason: BuildReason; + requestedFor: VSS_Common_Contracts.IdentityRef; + startTime: Date; + status: BuildStatus; +} +export interface BuildTrigger { + triggerType: DefinitionTriggerType; +} +export interface BuildUpdatedEvent extends RealtimeBuildEvent { + build: Build; +} +export interface BuildWorkspace { + mappings: MappingDetails[]; +} +/** + * Represents a change associated with a build. + */ +export interface Change { + /** + * The author of the change. + */ + author: VSS_Common_Contracts.IdentityRef; + /** + * The location of a user-friendly representation of the resource. + */ + displayUri: string; + /** + * Something that identifies the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset id. + */ + id: string; + /** + * The location of the full representation of the resource. + */ + location: string; + /** + * A description of the change. This might be a commit message or changeset description. + */ + message: string; + /** + * Indicates whether the message was truncated + */ + messageTruncated: boolean; + /** + * A timestamp for the change. + */ + timestamp: Date; + /** + * The type of change. "commit", "changeset", etc. + */ + type: string; +} +export interface ConsoleLogEvent extends RealtimeBuildEvent { + lines: string[]; + timelineId: string; + timelineRecordId: string; +} +export interface ContinuousDeploymentDefinition { + /** + * The connected service associated with the continuous deployment + */ + connectedService: TFS_Core_Contracts.WebApiConnectedServiceRef; + /** + * The definition associated with the continuous deployment + */ + definition: ShallowReference; + gitBranch: string; + hostedServiceName: string; + project: TFS_Core_Contracts.TeamProjectReference; + repositoryId: string; + storageAccountName: string; + subscriptionId: string; + website: string; + webspace: string; +} +export interface ContinuousIntegrationTrigger extends BuildTrigger { + batchChanges: boolean; + branchFilters: string[]; + /** + * The polling interval in seconds. + */ + pollingInterval: number; + /** + * This is the id of the polling job that polls the external repository. Once the build definition is saved/updated, this value is set. + */ + pollingJobId: string; +} +export enum ControllerStatus { + /** + * Indicates that the build controller cannot be contacted. + */ + Unavailable = 0, + /** + * Indicates that the build controller is currently available. + */ + Available = 1, + /** + * Indicates that the build controller has taken itself offline. + */ + Offline = 2, +} +export enum DefinitionQuality { + Definition = 1, + Draft = 2, +} +export enum DefinitionQueryOrder { + /** + * No order + */ + None = 0, + /** + * Order by created on/last modified time ascending. + */ + LastModifiedAscending = 1, + /** + * Order by created on/last modified time descending. + */ + LastModifiedDescending = 2, +} +export enum DefinitionQueueStatus { + /** + * When enabled the definition queue allows builds to be queued by users, the system will queue scheduled, gated and continuous integration builds, and the queued builds will be started by the system. + */ + Enabled = 0, + /** + * When paused the definition queue allows builds to be queued by users and the system will queue scheduled, gated and continuous integration builds. Builds in the queue will not be started by the system. + */ + Paused = 1, + /** + * When disabled the definition queue will not allow builds to be queued by users and the system will not queue scheduled, gated or continuous integration builds. Builds already in the queue will not be started by the system. + */ + Disabled = 2, +} +/** + * A reference to a definition. + */ +export interface DefinitionReference extends ShallowReference { + /** + * The date the definition was created + */ + createdDate: Date; + /** + * The project. + */ + project: TFS_Core_Contracts.TeamProjectReference; + /** + * If builds can be queued from this definition + */ + queueStatus: DefinitionQueueStatus; + /** + * The definition revision number. + */ + revision: number; + /** + * The type of the definition. + */ + type: DefinitionType; + /** + * The Uri of the definition + */ + uri: string; +} +export enum DefinitionTriggerType { + /** + * Manual builds only. + */ + None = 1, + /** + * A build should be started for each changeset. + */ + ContinuousIntegration = 2, + /** + * A build should be started for multiple changesets at a time at a specified interval. + */ + BatchedContinuousIntegration = 4, + /** + * A build should be started on a specified schedule whether or not changesets exist. + */ + Schedule = 8, + /** + * A validation build should be started for each check-in. + */ + GatedCheckIn = 16, + /** + * A validation build should be started for each batch of check-ins. + */ + BatchedGatedCheckIn = 32, + /** + * All types. + */ + All = 63, +} +export enum DefinitionType { + Xaml = 1, + Build = 2, +} +export enum DeleteOptions { + /** + * No data should be deleted. This value should not be used. + */ + None = 0, + /** + * The drop location should be deleted. + */ + DropLocation = 1, + /** + * The test results should be deleted. + */ + TestResults = 2, + /** + * The version control label should be deleted. + */ + Label = 4, + /** + * The build should be deleted. + */ + Details = 8, + /** + * Published symbols should be deleted. + */ + Symbols = 16, + /** + * All data should be deleted. + */ + All = 31, +} +/** + * Represents the data from the build information nodes for type "DeploymentInformation" for xaml builds + */ +export interface Deployment { + type: string; +} +/** + * Deployment iformation for type "Build" + */ +export interface DeploymentBuild extends Deployment { + buildId: number; +} +/** + * Deployment iformation for type "Deploy" + */ +export interface DeploymentDeploy extends Deployment { + message: string; +} +/** + * Deployment iformation for type "Test" + */ +export interface DeploymentTest extends Deployment { + runId: number; +} +export enum GetOption { + /** + * Use the latest changeset at the time the build is queued. + */ + LatestOnQueue = 0, + /** + * Use the latest changeset at the time the build is started. + */ + LatestOnBuild = 1, + /** + * A user-specified version has been supplied. + */ + Custom = 2, +} +/** + * Data representation of an information node associated with a build + */ +export interface InformationNode { + /** + * Fields of the information node + */ + fields: { + [key: string]: string; + }; + /** + * Process or person that last modified this node + */ + lastModifiedBy: string; + /** + * Date this node was last modified + */ + lastModifiedDate: Date; + /** + * Node Id of this information node + */ + nodeId: number; + /** + * Id of parent node (xml tree) + */ + parentId: number; + /** + * The type of the information node + */ + type: string; +} +export interface Issue { + category: string; + data: { + [key: string]: string; + }; + message: string; + type: IssueType; +} +export enum IssueType { + Error = 1, + Warning = 2, +} +export interface MappingDetails { + localPath: string; + mappingType: string; + serverPath: string; +} +export enum ProcessTemplateType { + /** + * Indicates a custom template. + */ + Custom = 0, + /** + * Indicates a default template. + */ + Default = 1, + /** + * Indicates an upgrade template. + */ + Upgrade = 2, +} +export interface PropertyValue { + /** + * Guid of identity that changed this property value + */ + changedBy: string; + /** + * The date this property value was changed + */ + changedDate: Date; + /** + * Name in the name value mapping + */ + propertyName: string; + /** + * Value in the name value mapping + */ + value: any; +} +export enum QueryDeletedOption { + /** + * Include only non-deleted builds. + */ + ExcludeDeleted = 0, + /** + * Include deleted and non-deleted builds. + */ + IncludeDeleted = 1, + /** + * Include only deleted builds. + */ + OnlyDeleted = 2, +} +export enum QueueOptions { + /** + * No queue options + */ + None = 0, + /** + * Create a plan Id for the build, do not run it + */ + DoNotRun = 1, +} +export enum QueuePriority { + /** + * Low priority. + */ + Low = 5, + /** + * Below normal priority. + */ + BelowNormal = 4, + /** + * Normal priority. + */ + Normal = 3, + /** + * Above normal priority. + */ + AboveNormal = 2, + /** + * High priority. + */ + High = 1, +} +export interface RealtimeBuildEvent { + buildId: number; +} +export interface RequestReference { + /** + * Id of the resource + */ + id: number; + /** + * Name of the requestor + */ + requestedFor: VSS_Common_Contracts.IdentityRef; + /** + * Full http link to the resource + */ + url: string; +} +export interface RetentionPolicy { + artifacts: string[]; + branches: string[]; + daysToKeep: number; + deleteBuildRecord: boolean; + deleteTestResults: boolean; +} +export interface Schedule { + branchFilters: string[]; + /** + * Days for a build (flags enum for days of the week) + */ + daysToBuild: ScheduleDays; + /** + * The Job Id of the Scheduled job that will queue the scheduled build. Since a single trigger can have multiple schedules and we want a single job to process a single schedule (since each schedule has a list of branches to build), the schedule itself needs to define the Job Id. This value will be filled in when a definition is added or updated. The UI does not provide it or use it. + */ + scheduleJobId: string; + /** + * Local timezone hour to start + */ + startHours: number; + /** + * Local timezone minute to start + */ + startMinutes: number; + /** + * Time zone of the build schedule (string representation of the time zone id) + */ + timeZoneId: string; +} +export enum ScheduleDays { + /** + * Do not run. + */ + None = 0, + /** + * Run on Monday. + */ + Monday = 1, + /** + * Run on Tuesday. + */ + Tuesday = 2, + /** + * Run on Wednesday. + */ + Wednesday = 4, + /** + * Run on Thursday. + */ + Thursday = 8, + /** + * Run on Friday. + */ + Friday = 16, + /** + * Run on Saturday. + */ + Saturday = 32, + /** + * Run on Sunday. + */ + Sunday = 64, + /** + * Run on all days of the week. + */ + All = 127, +} +export interface ScheduleTrigger extends BuildTrigger { + schedules: Schedule[]; +} +export enum ServiceHostStatus { + /** + * The service host is currently connected and accepting commands. + */ + Online = 1, + /** + * The service host is currently disconnected and not accepting commands. + */ + Offline = 2, +} +/** + * An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + */ +export interface ShallowReference { + /** + * Id of the resource + */ + id: number; + /** + * Name of the linked resource (definition name, controller name, etc.) + */ + name: string; + /** + * Full http link to the resource + */ + url: string; +} +export interface SvnMappingDetails { + depth: number; + ignoreExternals: boolean; + localPath: string; + revision: string; + serverPath: string; +} +export interface SvnWorkspace { + mappings: SvnMappingDetails[]; +} +export interface TaskAgentPoolReference { + id: number; + name: string; +} +export interface TaskDefinitionReference { + id: string; + versionSpec: string; +} +export interface TaskOrchestrationPlanReference { + planId: string; +} +export enum TaskResult { + Succeeded = 0, + SucceededWithIssues = 1, + Failed = 2, + Canceled = 3, + Skipped = 4, + Abandoned = 5, +} +export interface Timeline extends TimelineReference { + lastChangedBy: string; + lastChangedOn: Date; + records: TimelineRecord[]; +} +export interface TimelineRecord { + _links: any; + changeId: number; + currentOperation: string; + details: TimelineReference; + errorCount: number; + finishTime: Date; + id: string; + issues: Issue[]; + lastModified: Date; + log: BuildLogReference; + name: string; + order: number; + parentId: string; + percentComplete: number; + result: TaskResult; + resultCode: string; + startTime: Date; + state: TimelineRecordState; + type: string; + url: string; + warningCount: number; + workerName: string; +} +export enum TimelineRecordState { + Pending = 0, + InProgress = 1, + Completed = 2, +} +export interface TimelineRecordsUpdatedEvent extends RealtimeBuildEvent { + timelineRecords: TimelineRecord[]; +} +export interface TimelineReference { + changeId: number; + id: string; + url: string; +} +export enum ValidationResult { + OK = 0, + Warning = 1, + Error = 2, +} +/** + * Mapping for a workspace + */ +export interface WorkspaceMapping { + /** + * Uri of the associated definition + */ + definitionUri: string; + /** + * Depth of this mapping + */ + depth: number; + /** + * local location of the definition + */ + localItem: string; + /** + * type of workspace mapping + */ + mappingType: WorkspaceMappingType; + /** + * Server location of the definition + */ + serverItem: string; + /** + * Id of the workspace + */ + workspaceId: number; +} +export enum WorkspaceMappingType { + /** + * The path is mapped in the workspace. + */ + Map = 0, + /** + * The path is cloaked in the workspace. + */ + Cloak = 1, +} +export interface WorkspaceTemplate { + /** + * Uri of the associated definition + */ + definitionUri: string; + /** + * The identity that last modified this template + */ + lastModifiedBy: string; + /** + * The last time this template was modified + */ + lastModifiedDate: Date; + /** + * List of workspace mappings + */ + mappings: WorkspaceMapping[]; + /** + * Id of the workspace for this template + */ + workspaceId: number; +} +export interface XamlBuildDefinition extends DefinitionReference { + _links: any; + /** + * Batch size of the definition + */ + batchSize: number; + buildArgs: string; + /** + * The continuous integration quiet period + */ + continuousIntegrationQuietPeriod: number; + /** + * The build controller + */ + controller: BuildController; + /** + * The date this definition was created + */ + createdOn: Date; + /** + * Default drop location for builds from this definition + */ + defaultDropLocation: string; + /** + * Description of the definition + */ + description: string; + /** + * The last build on this definition + */ + lastBuild: ShallowReference; + /** + * The repository + */ + repository: BuildRepository; + /** + * The reasons supported by the template + */ + supportedReasons: BuildReason; + /** + * How builds are triggered from this definition + */ + triggerType: DefinitionTriggerType; +} +export var TypeInfo: { + AgentPoolQueue: { + fields: any; + }; + AgentStatus: { + enumValues: { + "unavailable": number; + "available": number; + "offline": number; + }; + }; + ArtifactResource: { + fields: any; + }; + AuditAction: { + enumValues: { + "add": number; + "update": number; + "delete": number; + }; + }; + Build: { + fields: any; + }; + BuildAgent: { + fields: any; + }; + BuildArtifact: { + fields: any; + }; + BuildArtifactAddedEvent: { + fields: any; + }; + BuildAuthorizationScope: { + enumValues: { + "projectCollection": number; + "project": number; + }; + }; + BuildBadge: { + fields: any; + }; + BuildCompletedEvent: { + fields: any; + }; + BuildController: { + fields: any; + }; + BuildDefinition: { + fields: any; + }; + BuildDefinitionChangedEvent: { + fields: any; + }; + BuildDefinitionChangingEvent: { + fields: any; + }; + BuildDefinitionReference: { + fields: any; + }; + BuildDefinitionRevision: { + fields: any; + }; + BuildDefinitionSourceProvider: { + fields: any; + }; + BuildDefinitionStep: { + fields: any; + }; + BuildDefinitionTemplate: { + fields: any; + }; + BuildDefinitionVariable: { + fields: any; + }; + BuildDeletedEvent: { + fields: any; + }; + BuildDeployment: { + fields: any; + }; + BuildLog: { + fields: any; + }; + BuildLogReference: { + fields: any; + }; + BuildOption: { + fields: any; + }; + BuildOptionDefinition: { + fields: any; + }; + BuildOptionDefinitionReference: { + fields: any; + }; + BuildOptionGroupDefinition: { + fields: any; + }; + BuildOptionInputDefinition: { + fields: any; + }; + BuildOptionInputType: { + enumValues: { + "string": number; + "boolean": number; + "stringList": number; + "radio": number; + "pickList": number; + "multiLine": number; + }; + }; + BuildPhaseStatus: { + enumValues: { + "unknown": number; + "failed": number; + "succeeded": number; + }; + }; + BuildPollingSummaryEvent: { + fields: any; + }; + BuildProcessTemplate: { + fields: any; + }; + BuildQueryOrder: { + enumValues: { + "finishTimeAscending": number; + "finishTimeDescending": number; + }; + }; + BuildReason: { + enumValues: { + "none": number; + "manual": number; + "individualCI": number; + "batchedCI": number; + "schedule": number; + "userCreated": number; + "validateShelveset": number; + "checkInShelveset": number; + "triggered": number; + "all": number; + }; + }; + BuildRepository: { + fields: any; + }; + BuildRequestValidationResult: { + fields: any; + }; + BuildResourceUsage: { + fields: any; + }; + BuildResult: { + enumValues: { + "none": number; + "succeeded": number; + "partiallySucceeded": number; + "failed": number; + "canceled": number; + }; + }; + BuildServer: { + fields: any; + }; + BuildSettings: { + fields: any; + }; + BuildStartedEvent: { + fields: any; + }; + BuildStatus: { + enumValues: { + "none": number; + "inProgress": number; + "completed": number; + "cancelling": number; + "postponed": number; + "notStarted": number; + "all": number; + }; + }; + BuildSummary: { + fields: any; + }; + BuildTrigger: { + fields: any; + }; + BuildUpdatedEvent: { + fields: any; + }; + BuildWorkspace: { + fields: any; + }; + Change: { + fields: any; + }; + ConsoleLogEvent: { + fields: any; + }; + ContinuousDeploymentDefinition: { + fields: any; + }; + ContinuousIntegrationTrigger: { + fields: any; + }; + ControllerStatus: { + enumValues: { + "unavailable": number; + "available": number; + "offline": number; + }; + }; + DefinitionQuality: { + enumValues: { + "definition": number; + "draft": number; + }; + }; + DefinitionQueryOrder: { + enumValues: { + "none": number; + "lastModifiedAscending": number; + "lastModifiedDescending": number; + }; + }; + DefinitionQueueStatus: { + enumValues: { + "enabled": number; + "paused": number; + "disabled": number; + }; + }; + DefinitionReference: { + fields: any; + }; + DefinitionTriggerType: { + enumValues: { + "none": number; + "continuousIntegration": number; + "batchedContinuousIntegration": number; + "schedule": number; + "gatedCheckIn": number; + "batchedGatedCheckIn": number; + "all": number; + }; + }; + DefinitionType: { + enumValues: { + "xaml": number; + "build": number; + }; + }; + DeleteOptions: { + enumValues: { + "none": number; + "dropLocation": number; + "testResults": number; + "label": number; + "details": number; + "symbols": number; + "all": number; + }; + }; + Deployment: { + fields: any; + }; + DeploymentBuild: { + fields: any; + }; + DeploymentDeploy: { + fields: any; + }; + DeploymentTest: { + fields: any; + }; + GetOption: { + enumValues: { + "latestOnQueue": number; + "latestOnBuild": number; + "custom": number; + }; + }; + InformationNode: { + fields: any; + }; + Issue: { + fields: any; + }; + IssueType: { + enumValues: { + "error": number; + "warning": number; + }; + }; + MappingDetails: { + fields: any; + }; + ProcessTemplateType: { + enumValues: { + "custom": number; + "default": number; + "upgrade": number; + }; + }; + PropertyValue: { + fields: any; + }; + QueryDeletedOption: { + enumValues: { + "excludeDeleted": number; + "includeDeleted": number; + "onlyDeleted": number; + }; + }; + QueueOptions: { + enumValues: { + "none": number; + "doNotRun": number; + }; + }; + QueuePriority: { + enumValues: { + "low": number; + "belowNormal": number; + "normal": number; + "aboveNormal": number; + "high": number; + }; + }; + RealtimeBuildEvent: { + fields: any; + }; + RequestReference: { + fields: any; + }; + RetentionPolicy: { + fields: any; + }; + Schedule: { + fields: any; + }; + ScheduleDays: { + enumValues: { + "none": number; + "monday": number; + "tuesday": number; + "wednesday": number; + "thursday": number; + "friday": number; + "saturday": number; + "sunday": number; + "all": number; + }; + }; + ScheduleTrigger: { + fields: any; + }; + ServiceHostStatus: { + enumValues: { + "online": number; + "offline": number; + }; + }; + ShallowReference: { + fields: any; + }; + SvnMappingDetails: { + fields: any; + }; + SvnWorkspace: { + fields: any; + }; + TaskAgentPoolReference: { + fields: any; + }; + TaskDefinitionReference: { + fields: any; + }; + TaskOrchestrationPlanReference: { + fields: any; + }; + TaskResult: { + enumValues: { + "succeeded": number; + "succeededWithIssues": number; + "failed": number; + "canceled": number; + "skipped": number; + "abandoned": number; + }; + }; + Timeline: { + fields: any; + }; + TimelineRecord: { + fields: any; + }; + TimelineRecordState: { + enumValues: { + "pending": number; + "inProgress": number; + "completed": number; + }; + }; + TimelineRecordsUpdatedEvent: { + fields: any; + }; + TimelineReference: { + fields: any; + }; + ValidationResult: { + enumValues: { + "oK": number; + "warning": number; + "error": number; + }; + }; + WorkspaceMapping: { + fields: any; + }; + WorkspaceMappingType: { + enumValues: { + "map": number; + "cloak": number; + }; + }; + WorkspaceTemplate: { + fields: any; + }; + XamlBuildDefinition: { + fields: any; + }; +}; +} +declare module "TFS/Build/ExtensionContracts" { +import Build_Contracts = require("TFS/Build/Contracts"); +/** +* Interface defining the configuration that is shared between extension targeted at "ms.vss-build-web.build-results-view" and the host +*/ +export interface IBuildResultsViewExtensionConfig { + /** + * Required if reacting to the current build, callback added via 'addBuildCallBack' is called whenever there are any build changes + * More than one callbacks can be added, and all will be called + * It is important to have atleast one call back, since that's how an extension can get information about the current build it has to deal with + */ + onBuildChanged: (handler: (build: Build_Contracts.Build) => void) => void; + /** + * Optional, If needed, this callback will be called when this particular extension is selected/displayed + */ + onViewDisplayed: (onDisplayedCallBack: () => void) => void; +} +} +declare module "TFS/Build/RestClient" { +import Contracts = require("TFS/Build/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class BuildHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] Associates an artifact with a build + * + * @param {Contracts.BuildArtifact} artifact + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createArtifact(artifact: Contracts.BuildArtifact, buildId: number, project?: string): IPromise; + /** + * [Preview API] Gets a specific artifact for a build + * + * @param {number} buildId + * @param {string} artifactName + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifact(buildId: number, artifactName: string, project?: string): IPromise; + /** + * [Preview API] Gets a specific artifact for a build + * + * @param {number} buildId + * @param {string} artifactName + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifactContentZip(buildId: number, artifactName: string, project?: string): IPromise; + /** + * [Preview API] Gets all artifacts for a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifacts(buildId: number, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project + * @param {number} definitionId + * @param {string} branchName + * @return IPromise + */ + getBadge(project: string, definitionId: number, branchName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} repoType + * @param {string} repoId + * @param {string} branchName + * @return IPromise + */ + getBuildBadge(project: string, repoType: string, repoId?: string, branchName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} repoType + * @param {string} repoId + * @param {string} branchName + * @return IPromise + */ + getBuildBadgeData(project: string, repoType: string, repoId?: string, branchName?: string): IPromise; + /** + * [Preview API] Deletes a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteBuild(buildId: number, project?: string): IPromise; + /** + * [Preview API] Gets a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @param {string} propertyFilters - A comma-delimited list of properties to include in the results + * @return IPromise + */ + getBuild(buildId: number, project?: string, propertyFilters?: string): IPromise; + /** + * [Preview API] Gets builds + * + * @param {string} project - Project ID or project name + * @param {number[]} definitions - A comma-delimited list of definition ids + * @param {number[]} queues - A comma-delimited list of queue ids + * @param {string} buildNumber + * @param {Date} minFinishTime + * @param {Date} maxFinishTime + * @param {string} requestedFor + * @param {Contracts.BuildReason} reasonFilter + * @param {Contracts.BuildStatus} statusFilter + * @param {Contracts.BuildResult} resultFilter + * @param {string[]} tagFilters - A comma-delimited list of tags + * @param {string[]} properties - A comma-delimited list of properties to include in the results + * @param {Contracts.DefinitionType} type - The definition type + * @param {number} top - The maximum number of builds to retrieve + * @param {string} continuationToken + * @param {number} maxBuildsPerDefinition + * @param {Contracts.QueryDeletedOption} deletedFilter + * @param {Contracts.BuildQueryOrder} queryOrder + * @return IPromise + */ + getBuilds(project?: string, definitions?: number[], queues?: number[], buildNumber?: string, minFinishTime?: Date, maxFinishTime?: Date, requestedFor?: string, reasonFilter?: Contracts.BuildReason, statusFilter?: Contracts.BuildStatus, resultFilter?: Contracts.BuildResult, tagFilters?: string[], properties?: string[], type?: Contracts.DefinitionType, top?: number, continuationToken?: string, maxBuildsPerDefinition?: number, deletedFilter?: Contracts.QueryDeletedOption, queryOrder?: Contracts.BuildQueryOrder): IPromise; + /** + * [Preview API] Queues a build + * + * @param {Contracts.Build} build + * @param {string} project - Project ID or project name + * @param {boolean} ignoreWarnings + * @return IPromise + */ + queueBuild(build: Contracts.Build, project?: string, ignoreWarnings?: boolean): IPromise; + /** + * [Preview API] Updates a build + * + * @param {Contracts.Build} build + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateBuild(build: Contracts.Build, buildId: number, project?: string): IPromise; + /** + * [Preview API] Gets the changes associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of changes to return + * @return IPromise + */ + getBuildCommits(project: string, buildId: number, top?: number): IPromise; + /** + * [Preview API] Gets the changes associated between given builds + * + * @param {string} project - Project ID or project name + * @param {number} fromBuildId + * @param {number} toBuildId + * @param {number} top - The maximum number of changes to return + * @return IPromise + */ + getChangesBetweenBuilds(project: string, fromBuildId?: number, toBuildId?: number, top?: number): IPromise; + /** + * [Preview API] Gets a controller + * + * @param {number} controllerId + * @return IPromise + */ + getBuildController(controllerId: number): IPromise; + /** + * [Preview API] Gets controller, optionally filtered by name + * + * @param {string} name + * @return IPromise + */ + getBuildControllers(name?: string): IPromise; + /** + * [Preview API] Creates a new definition + * + * @param {Contracts.BuildDefinition} definition + * @param {string} project - Project ID or project name + * @param {number} definitionToCloneId + * @param {number} definitionToCloneRevision + * @return IPromise + */ + createDefinition(definition: Contracts.BuildDefinition, project?: string, definitionToCloneId?: number, definitionToCloneRevision?: number): IPromise; + /** + * [Preview API] Deletes a definition and all associated builds + * + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteDefinition(definitionId: number, project?: string): IPromise; + /** + * [Preview API] Gets a definition, optionally at a specific revision + * + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @param {number} revision + * @param {string[]} propertyFilters + * @return IPromise + */ + getDefinition(definitionId: number, project?: string, revision?: number, propertyFilters?: string[]): IPromise; + /** + * [Preview API] Gets definitions, optionally filtered by name + * + * @param {string} project - Project ID or project name + * @param {string} name + * @param {Contracts.DefinitionType} type + * @param {string} repositoryId + * @param {string} repositoryType + * @param {Contracts.DefinitionQueryOrder} queryOrder + * @param {number} top + * @return IPromise + */ + getDefinitions(project?: string, name?: string, type?: Contracts.DefinitionType, repositoryId?: string, repositoryType?: string, queryOrder?: Contracts.DefinitionQueryOrder, top?: number): IPromise; + /** + * [Preview API] Updates an existing definition + * + * @param {Contracts.BuildDefinition} definition + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @param {number} secretsSourceDefinitionId + * @param {number} secretsSourceDefinitionRevision + * @return IPromise + */ + updateDefinition(definition: Contracts.BuildDefinition, definitionId: number, project?: string, secretsSourceDefinitionId?: number, secretsSourceDefinitionRevision?: number): IPromise; + /** + * [Preview API] Gets the deployment information associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildDeployments(project: string, buildId: number): IPromise; + /** + * [Preview API] Gets a log + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} logId + * @param {number} startLine + * @param {number} endLine + * @return IPromise + */ + getBuildLog(project: string, buildId: number, logId: number, startLine?: number, endLine?: number): IPromise; + /** + * [Preview API] Gets logs for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildLogs(project: string, buildId: number): IPromise; + /** + * [Preview API] Gets logs for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildLogsZip(project: string, buildId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getBuildOptionDefinitions(project?: string): IPromise; + /** + * [Preview API] Creates a build queue + * + * @param {Contracts.AgentPoolQueue} queue + * @return IPromise + */ + createQueue(queue: Contracts.AgentPoolQueue): IPromise; + /** + * [Preview API] Deletes a build queue + * + * @param {number} id + * @return IPromise + */ + deleteQueue(id: number): IPromise; + /** + * [Preview API] Gets a queue + * + * @param {number} controllerId + * @return IPromise + */ + getAgentPoolQueue(controllerId: number): IPromise; + /** + * [Preview API] Gets queues, optionally filtered by name + * + * @param {string} name + * @return IPromise + */ + getQueues(name?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getResourceUsage(): IPromise; + /** + * [Preview API] Gets revisions of a definition + * + * @param {string} project - Project ID or project name + * @param {number} definitionId + * @return IPromise + */ + getDefinitionRevisions(project: string, definitionId: number): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getBuildSettings(): IPromise; + /** + * [Preview API] Updates the build settings + * + * @param {Contracts.BuildSettings} settings + * @return IPromise + */ + updateBuildSettings(settings: Contracts.BuildSettings): IPromise; + /** + * [Preview API] Adds a tag to a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} tag + * @return IPromise + */ + addBuildTag(project: string, buildId: number, tag: string): IPromise; + /** + * [Preview API] Adds tag to a build + * + * @param {string[]} tags + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + addBuildTags(tags: string[], project: string, buildId: number): IPromise; + /** + * [Preview API] Deletes a tag from a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} tag + * @return IPromise + */ + deleteBuildTag(project: string, buildId: number, tag: string): IPromise; + /** + * [Preview API] Gets the tags for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildTags(project: string, buildId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getTags(project: string): IPromise; + /** + * [Preview API] Deletes a definition template + * + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + deleteTemplate(project: string, templateId: string): IPromise; + /** + * [Preview API] Gets definition template filtered by id + * + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + getTemplate(project: string, templateId: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getTemplates(project: string): IPromise; + /** + * [Preview API] Saves a definition template + * + * @param {Contracts.BuildDefinitionTemplate} template + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + saveTemplate(template: Contracts.BuildDefinitionTemplate, project: string, templateId: string): IPromise; + /** + * [Preview API] Gets details for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} timelineId + * @param {number} changeId + * @return IPromise + */ + getBuildTimeline(project: string, buildId: number, timelineId?: string, changeId?: number): IPromise; + /** + * [Preview API] Gets the work item ids associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of workitems to return + * @return IPromise + */ + getBuildWorkItemsRefs(project: string, buildId: number, top?: number): IPromise; + /** + * [Preview API] Gets the work item ids associated with build commits + * + * @param {string[]} commitIds + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of workitems to return, also number of commits to consider if commitids are not sent + * @return IPromise + */ + getBuildWorkItemsRefsFromCommits(commitIds: string[], project: string, buildId: number, top?: number): IPromise; + /** + * [Preview API] Gets all the work item ids inbetween fromBuildId to toBuildId + * + * @param {string} project - Project ID or project name + * @param {number} fromBuildId + * @param {number} toBuildId + * @param {number} top - The maximum number of workitems to return + * @return IPromise + */ + getWorkItemsBetweenBuilds(project: string, fromBuildId: number, toBuildId: number, top?: number): IPromise; +} +export class BuildHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * Associates an artifact with a build + * + * @param {Contracts.BuildArtifact} artifact + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createArtifact(artifact: Contracts.BuildArtifact, buildId: number, project?: string): IPromise; + /** + * Gets a specific artifact for a build + * + * @param {number} buildId + * @param {string} artifactName + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifact(buildId: number, artifactName: string, project?: string): IPromise; + /** + * Gets a specific artifact for a build + * + * @param {number} buildId + * @param {string} artifactName + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifactContentZip(buildId: number, artifactName: string, project?: string): IPromise; + /** + * Gets all artifacts for a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifacts(buildId: number, project?: string): IPromise; + /** + * @param {string} project + * @param {number} definitionId + * @param {string} branchName + * @return IPromise + */ + getBadge(project: string, definitionId: number, branchName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} repoType + * @param {string} repoId + * @param {string} branchName + * @return IPromise + */ + getBuildBadge(project: string, repoType: string, repoId?: string, branchName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} repoType + * @param {string} repoId + * @param {string} branchName + * @return IPromise + */ + getBuildBadgeData(project: string, repoType: string, repoId?: string, branchName?: string): IPromise; + /** + * Deletes a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteBuild(buildId: number, project?: string): IPromise; + /** + * Gets a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @param {string} propertyFilters - A comma-delimited list of properties to include in the results + * @return IPromise + */ + getBuild(buildId: number, project?: string, propertyFilters?: string): IPromise; + /** + * Gets builds + * + * @param {string} project - Project ID or project name + * @param {number[]} definitions - A comma-delimited list of definition ids + * @param {number[]} queues - A comma-delimited list of queue ids + * @param {string} buildNumber + * @param {Date} minFinishTime + * @param {Date} maxFinishTime + * @param {string} requestedFor + * @param {Contracts.BuildReason} reasonFilter + * @param {Contracts.BuildStatus} statusFilter + * @param {Contracts.BuildResult} resultFilter + * @param {string[]} tagFilters - A comma-delimited list of tags + * @param {string[]} properties - A comma-delimited list of properties to include in the results + * @param {Contracts.DefinitionType} type - The definition type + * @param {number} top - The maximum number of builds to retrieve + * @param {string} continuationToken + * @param {number} maxBuildsPerDefinition + * @param {Contracts.QueryDeletedOption} deletedFilter + * @param {Contracts.BuildQueryOrder} queryOrder + * @return IPromise + */ + getBuilds(project?: string, definitions?: number[], queues?: number[], buildNumber?: string, minFinishTime?: Date, maxFinishTime?: Date, requestedFor?: string, reasonFilter?: Contracts.BuildReason, statusFilter?: Contracts.BuildStatus, resultFilter?: Contracts.BuildResult, tagFilters?: string[], properties?: string[], type?: Contracts.DefinitionType, top?: number, continuationToken?: string, maxBuildsPerDefinition?: number, deletedFilter?: Contracts.QueryDeletedOption, queryOrder?: Contracts.BuildQueryOrder): IPromise; + /** + * Queues a build + * + * @param {Contracts.Build} build + * @param {string} project - Project ID or project name + * @param {boolean} ignoreWarnings + * @return IPromise + */ + queueBuild(build: Contracts.Build, project?: string, ignoreWarnings?: boolean): IPromise; + /** + * Updates a build + * + * @param {Contracts.Build} build + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateBuild(build: Contracts.Build, buildId: number, project?: string): IPromise; + /** + * Gets the changes associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of changes to return + * @return IPromise + */ + getBuildCommits(project: string, buildId: number, top?: number): IPromise; + /** + * [Preview API] Gets the changes associated between given builds + * + * @param {string} project - Project ID or project name + * @param {number} fromBuildId + * @param {number} toBuildId + * @param {number} top - The maximum number of changes to return + * @return IPromise + */ + getChangesBetweenBuilds(project: string, fromBuildId?: number, toBuildId?: number, top?: number): IPromise; + /** + * Gets a controller + * + * @param {number} controllerId + * @return IPromise + */ + getBuildController(controllerId: number): IPromise; + /** + * Gets controller, optionally filtered by name + * + * @param {string} name + * @return IPromise + */ + getBuildControllers(name?: string): IPromise; + /** + * Creates a new definition + * + * @param {Contracts.BuildDefinition} definition + * @param {string} project - Project ID or project name + * @param {number} definitionToCloneId + * @param {number} definitionToCloneRevision + * @return IPromise + */ + createDefinition(definition: Contracts.BuildDefinition, project?: string, definitionToCloneId?: number, definitionToCloneRevision?: number): IPromise; + /** + * Deletes a definition and all associated builds + * + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteDefinition(definitionId: number, project?: string): IPromise; + /** + * Gets a definition, optionally at a specific revision + * + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @param {number} revision + * @param {string[]} propertyFilters + * @return IPromise + */ + getDefinition(definitionId: number, project?: string, revision?: number, propertyFilters?: string[]): IPromise; + /** + * Gets definitions, optionally filtered by name + * + * @param {string} project - Project ID or project name + * @param {string} name + * @param {Contracts.DefinitionType} type + * @param {string} repositoryId + * @param {string} repositoryType + * @param {Contracts.DefinitionQueryOrder} queryOrder + * @param {number} top + * @return IPromise + */ + getDefinitions(project?: string, name?: string, type?: Contracts.DefinitionType, repositoryId?: string, repositoryType?: string, queryOrder?: Contracts.DefinitionQueryOrder, top?: number): IPromise; + /** + * Updates an existing definition + * + * @param {Contracts.BuildDefinition} definition + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @param {number} secretsSourceDefinitionId + * @param {number} secretsSourceDefinitionRevision + * @return IPromise + */ + updateDefinition(definition: Contracts.BuildDefinition, definitionId: number, project?: string, secretsSourceDefinitionId?: number, secretsSourceDefinitionRevision?: number): IPromise; + /** + * Gets the deployment information associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildDeployments(project: string, buildId: number): IPromise; + /** + * Gets a log + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} logId + * @param {number} startLine + * @param {number} endLine + * @return IPromise + */ + getBuildLog(project: string, buildId: number, logId: number, startLine?: number, endLine?: number): IPromise; + /** + * Gets logs for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildLogs(project: string, buildId: number): IPromise; + /** + * Gets logs for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildLogsZip(project: string, buildId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getBuildOptionDefinitions(project?: string): IPromise; + /** + * Creates a build queue + * + * @param {Contracts.AgentPoolQueue} queue + * @return IPromise + */ + createQueue(queue: Contracts.AgentPoolQueue): IPromise; + /** + * Deletes a build queue + * + * @param {number} id + * @return IPromise + */ + deleteQueue(id: number): IPromise; + /** + * Gets a queue + * + * @param {number} controllerId + * @return IPromise + */ + getAgentPoolQueue(controllerId: number): IPromise; + /** + * Gets queues, optionally filtered by name + * + * @param {string} name + * @return IPromise + */ + getQueues(name?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getResourceUsage(): IPromise; + /** + * Gets revisions of a definition + * + * @param {string} project - Project ID or project name + * @param {number} definitionId + * @return IPromise + */ + getDefinitionRevisions(project: string, definitionId: number): IPromise; + /** + * @return IPromise + */ + getBuildSettings(): IPromise; + /** + * Updates the build settings + * + * @param {Contracts.BuildSettings} settings + * @return IPromise + */ + updateBuildSettings(settings: Contracts.BuildSettings): IPromise; + /** + * Adds a tag to a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} tag + * @return IPromise + */ + addBuildTag(project: string, buildId: number, tag: string): IPromise; + /** + * Adds tag to a build + * + * @param {string[]} tags + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + addBuildTags(tags: string[], project: string, buildId: number): IPromise; + /** + * Deletes a tag from a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} tag + * @return IPromise + */ + deleteBuildTag(project: string, buildId: number, tag: string): IPromise; + /** + * Gets the tags for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildTags(project: string, buildId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getTags(project: string): IPromise; + /** + * Deletes a definition template + * + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + deleteTemplate(project: string, templateId: string): IPromise; + /** + * Gets definition template filtered by id + * + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + getTemplate(project: string, templateId: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getTemplates(project: string): IPromise; + /** + * Saves a definition template + * + * @param {Contracts.BuildDefinitionTemplate} template + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + saveTemplate(template: Contracts.BuildDefinitionTemplate, project: string, templateId: string): IPromise; + /** + * Gets details for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} timelineId + * @param {number} changeId + * @return IPromise + */ + getBuildTimeline(project: string, buildId: number, timelineId?: string, changeId?: number): IPromise; + /** + * Gets the work item ids associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of workitems to return + * @return IPromise + */ + getBuildWorkItemsRefs(project: string, buildId: number, top?: number): IPromise; + /** + * Gets the work item ids associated with build commits + * + * @param {string[]} commitIds + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of workitems to return, also number of commits to consider if commitids are not sent + * @return IPromise + */ + getBuildWorkItemsRefsFromCommits(commitIds: string[], project: string, buildId: number, top?: number): IPromise; + /** + * [Preview API] Gets all the work item ids inbetween fromBuildId to toBuildId + * + * @param {string} project - Project ID or project name + * @param {number} fromBuildId + * @param {number} toBuildId + * @param {number} top - The maximum number of workitems to return + * @return IPromise + */ + getWorkItemsBetweenBuilds(project: string, fromBuildId: number, toBuildId: number, top?: number): IPromise; +} +export class BuildHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * Associates an artifact with a build + * + * @param {Contracts.BuildArtifact} artifact + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createArtifact(artifact: Contracts.BuildArtifact, buildId: number, project?: string): IPromise; + /** + * Gets a specific artifact for a build + * + * @param {number} buildId + * @param {string} artifactName + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifact(buildId: number, artifactName: string, project?: string): IPromise; + /** + * Gets a specific artifact for a build + * + * @param {number} buildId + * @param {string} artifactName + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifactContentZip(buildId: number, artifactName: string, project?: string): IPromise; + /** + * Gets all artifacts for a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getArtifacts(buildId: number, project?: string): IPromise; + /** + * @param {string} project + * @param {number} definitionId + * @param {string} branchName + * @return IPromise + */ + getBadge(project: string, definitionId: number, branchName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} repoType + * @param {string} repoId + * @param {string} branchName + * @return IPromise + */ + getBuildBadge(project: string, repoType: string, repoId?: string, branchName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} repoType + * @param {string} repoId + * @param {string} branchName + * @return IPromise + */ + getBuildBadgeData(project: string, repoType: string, repoId?: string, branchName?: string): IPromise; + /** + * Deletes a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteBuild(buildId: number, project?: string): IPromise; + /** + * Gets a build + * + * @param {number} buildId + * @param {string} project - Project ID or project name + * @param {string} propertyFilters - A comma-delimited list of properties to include in the results + * @return IPromise + */ + getBuild(buildId: number, project?: string, propertyFilters?: string): IPromise; + /** + * Gets builds + * + * @param {string} project - Project ID or project name + * @param {number[]} definitions - A comma-delimited list of definition ids + * @param {number[]} queues - A comma-delimited list of queue ids + * @param {string} buildNumber + * @param {Date} minFinishTime + * @param {Date} maxFinishTime + * @param {string} requestedFor + * @param {Contracts.BuildReason} reasonFilter + * @param {Contracts.BuildStatus} statusFilter + * @param {Contracts.BuildResult} resultFilter + * @param {string[]} tagFilters - A comma-delimited list of tags + * @param {string[]} properties - A comma-delimited list of properties to include in the results + * @param {Contracts.DefinitionType} type - The definition type + * @param {number} top - The maximum number of builds to retrieve + * @param {string} continuationToken + * @param {number} maxBuildsPerDefinition + * @param {Contracts.QueryDeletedOption} deletedFilter + * @param {Contracts.BuildQueryOrder} queryOrder + * @return IPromise + */ + getBuilds(project?: string, definitions?: number[], queues?: number[], buildNumber?: string, minFinishTime?: Date, maxFinishTime?: Date, requestedFor?: string, reasonFilter?: Contracts.BuildReason, statusFilter?: Contracts.BuildStatus, resultFilter?: Contracts.BuildResult, tagFilters?: string[], properties?: string[], type?: Contracts.DefinitionType, top?: number, continuationToken?: string, maxBuildsPerDefinition?: number, deletedFilter?: Contracts.QueryDeletedOption, queryOrder?: Contracts.BuildQueryOrder): IPromise; + /** + * Queues a build + * + * @param {Contracts.Build} build + * @param {string} project - Project ID or project name + * @param {boolean} ignoreWarnings + * @return IPromise + */ + queueBuild(build: Contracts.Build, project?: string, ignoreWarnings?: boolean): IPromise; + /** + * Updates a build + * + * @param {Contracts.Build} build + * @param {number} buildId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateBuild(build: Contracts.Build, buildId: number, project?: string): IPromise; + /** + * Gets the changes associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of changes to return + * @return IPromise + */ + getBuildCommits(project: string, buildId: number, top?: number): IPromise; + /** + * Gets a controller + * + * @param {number} controllerId + * @return IPromise + */ + getBuildController(controllerId: number): IPromise; + /** + * Gets controller, optionally filtered by name + * + * @param {string} name + * @return IPromise + */ + getBuildControllers(name?: string): IPromise; + /** + * Creates a new definition + * + * @param {Contracts.BuildDefinition} definition + * @param {string} project - Project ID or project name + * @param {number} definitionToCloneId + * @param {number} definitionToCloneRevision + * @return IPromise + */ + createDefinition(definition: Contracts.BuildDefinition, project?: string, definitionToCloneId?: number, definitionToCloneRevision?: number): IPromise; + /** + * Deletes a definition and all associated builds + * + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteDefinition(definitionId: number, project?: string): IPromise; + /** + * Gets a definition, optionally at a specific revision + * + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @param {number} revision + * @param {string[]} propertyFilters + * @return IPromise + */ + getDefinition(definitionId: number, project?: string, revision?: number, propertyFilters?: string[]): IPromise; + /** + * Gets definitions, optionally filtered by name + * + * @param {string} project - Project ID or project name + * @param {string} name + * @param {Contracts.DefinitionType} type + * @param {string} repositoryId + * @param {string} repositoryType + * @param {Contracts.DefinitionQueryOrder} queryOrder + * @param {number} top + * @return IPromise + */ + getDefinitions(project?: string, name?: string, type?: Contracts.DefinitionType, repositoryId?: string, repositoryType?: string, queryOrder?: Contracts.DefinitionQueryOrder, top?: number): IPromise; + /** + * Updates an existing definition + * + * @param {Contracts.BuildDefinition} definition + * @param {number} definitionId + * @param {string} project - Project ID or project name + * @param {number} secretsSourceDefinitionId + * @param {number} secretsSourceDefinitionRevision + * @return IPromise + */ + updateDefinition(definition: Contracts.BuildDefinition, definitionId: number, project?: string, secretsSourceDefinitionId?: number, secretsSourceDefinitionRevision?: number): IPromise; + /** + * Gets the deployment information associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildDeployments(project: string, buildId: number): IPromise; + /** + * Gets a log + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} logId + * @param {number} startLine + * @param {number} endLine + * @return IPromise + */ + getBuildLog(project: string, buildId: number, logId: number, startLine?: number, endLine?: number): IPromise; + /** + * Gets logs for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildLogs(project: string, buildId: number): IPromise; + /** + * Gets logs for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildLogsZip(project: string, buildId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getBuildOptionDefinitions(project?: string): IPromise; + /** + * Creates a build queue + * + * @param {Contracts.AgentPoolQueue} queue + * @return IPromise + */ + createQueue(queue: Contracts.AgentPoolQueue): IPromise; + /** + * Deletes a build queue + * + * @param {number} id + * @return IPromise + */ + deleteQueue(id: number): IPromise; + /** + * Gets a queue + * + * @param {number} controllerId + * @return IPromise + */ + getAgentPoolQueue(controllerId: number): IPromise; + /** + * Gets queues, optionally filtered by name + * + * @param {string} name + * @return IPromise + */ + getQueues(name?: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getResourceUsage(): IPromise; + /** + * Gets revisions of a definition + * + * @param {string} project - Project ID or project name + * @param {number} definitionId + * @return IPromise + */ + getDefinitionRevisions(project: string, definitionId: number): IPromise; + /** + * @return IPromise + */ + getBuildSettings(): IPromise; + /** + * Updates the build settings + * + * @param {Contracts.BuildSettings} settings + * @return IPromise + */ + updateBuildSettings(settings: Contracts.BuildSettings): IPromise; + /** + * Adds a tag to a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} tag + * @return IPromise + */ + addBuildTag(project: string, buildId: number, tag: string): IPromise; + /** + * Adds tag to a build + * + * @param {string[]} tags + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + addBuildTags(tags: string[], project: string, buildId: number): IPromise; + /** + * Deletes a tag from a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} tag + * @return IPromise + */ + deleteBuildTag(project: string, buildId: number, tag: string): IPromise; + /** + * Gets the tags for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + getBuildTags(project: string, buildId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getTags(project: string): IPromise; + /** + * Deletes a definition template + * + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + deleteTemplate(project: string, templateId: string): IPromise; + /** + * Gets definition template filtered by id + * + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + getTemplate(project: string, templateId: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getTemplates(project: string): IPromise; + /** + * Saves a definition template + * + * @param {Contracts.BuildDefinitionTemplate} template + * @param {string} project - Project ID or project name + * @param {string} templateId + * @return IPromise + */ + saveTemplate(template: Contracts.BuildDefinitionTemplate, project: string, templateId: string): IPromise; + /** + * Gets details for a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} timelineId + * @param {number} changeId + * @return IPromise + */ + getBuildTimeline(project: string, buildId: number, timelineId?: string, changeId?: number): IPromise; + /** + * Gets the work item ids associated with a build + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of workitems to return + * @return IPromise + */ + getBuildWorkItemsRefs(project: string, buildId: number, top?: number): IPromise; + /** + * Gets the work item ids associated with build commits + * + * @param {string[]} commitIds + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} top - The maximum number of workitems to return, also number of commits to consider if commitids are not sent + * @return IPromise + */ + getBuildWorkItemsRefsFromCommits(commitIds: string[], project: string, buildId: number, top?: number): IPromise; +} +export class BuildHttpClient extends BuildHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return BuildHttpClient2_1 + */ +export function getClient(): BuildHttpClient2_1; +} +declare module "TFS/Core/Contracts" { +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +export enum ConnectedServiceKind { + /** + * Custom or unknown service + */ + Custom = 0, + /** + * Azure Subscription + */ + AzureSubscription = 1, + /** + * Chef Connection + */ + Chef = 2, + /** + * Generic Connection + */ + Generic = 3, +} +export interface IdentityData { + identityIds: string[]; +} +export interface Process extends ProcessReference { + _links: any; + description: string; + id: string; + isDefault: boolean; + type: ProcessType; +} +export interface ProcessReference { + name: string; + url: string; +} +export enum ProcessType { + System = 0, + Custom = 1, + Inherited = 2, +} +export enum ProjectChangeType { + Modified = 0, + Deleted = 1, + Added = 2, +} +/** + * Contains information of the project + */ +export interface ProjectInfo { + abbreviation: string; + description: string; + id: string; + lastUpdateTime: Date; + name: string; + properties: ProjectProperty[]; + /** + * Current revision of the project + */ + revision: number; + state: any; + uri: string; + version: number; +} +export interface ProjectMessage { + project: ProjectInfo; + projectChangeType: ProjectChangeType; +} +export interface ProjectProperty { + name: string; + value: string; +} +export interface Proxy { + /** + * This is a description string + */ + description: string; + /** + * The friendly name of the server + */ + friendlyName: string; + globalDefault: boolean; + /** + * This is a string representation of the site that the proxy server is located in (e.g. "NA-WA-RED") + */ + site: string; + siteDefault: boolean; + /** + * The URL of the proxy server + */ + url: string; +} +export enum SourceControlTypes { + Tfvc = 1, + Git = 2, +} +/** + * The Team Context for an operation. + */ +export interface TeamContext { + /** + * The team project Id or name. Ignored if ProjectId is set. + */ + project: string; + /** + * The Team Project ID. Required if Project is not set. + */ + projectId: string; + /** + * The Team Id or name. Ignored if TeamId is set. + */ + team: string; + /** + * The Team Id + */ + teamId: string; +} +/** + * Represents a Team Project object. + */ +export interface TeamProject extends TeamProjectReference { + /** + * The links to other objects related to this object. + */ + _links: any; + capabilities: { + [key: string]: { + [key: string]: string; + }; + }; + /** + * The shallow ref to the default team. + */ + defaultTeam: WebApiTeamRef; +} +/** + * Data contract for a TeamProjectCollection. + */ +export interface TeamProjectCollection extends TeamProjectCollectionReference { + /** + * The links to other objects related to this object. + */ + _links: any; + /** + * Project collection description. + */ + description: string; + /** + * Project collection state. + */ + state: string; +} +/** + * Reference object for a TeamProjectCollection. + */ +export interface TeamProjectCollectionReference { + /** + * Collection Id. + */ + id: string; + /** + * Collection Name. + */ + name: string; + /** + * Collection REST Url. + */ + url: string; +} +/** + * Represents a shallow reference to a TeamProject. + */ +export interface TeamProjectReference { + /** + * Project abbreviation. + */ + abbreviation: string; + /** + * The project's description (if any). + */ + description: string; + /** + * Project identifier. + */ + id: string; + /** + * Project name. + */ + name: string; + /** + * Project revision. + */ + revision: number; + /** + * Project state. + */ + state: any; + /** + * Url to the full version of the object. + */ + url: string; +} +export interface WebApiConnectedService extends WebApiConnectedServiceRef { + /** + * The user who did the OAuth authentication to created this service + */ + authenticatedBy: VSS_Common_Contracts.IdentityRef; + /** + * Extra description on the service. + */ + description: string; + /** + * Friendly Name of service connection + */ + friendlyName: string; + /** + * Id/Name of the connection service. For Ex: Subscription Id for Azure Connection + */ + id: string; + /** + * The kind of service. + */ + kind: string; + /** + * The project associated with this service + */ + project: TeamProjectReference; + /** + * Optional uri to connect directly to the service such as https://windows.azure.com + */ + serviceUri: string; +} +export interface WebApiConnectedServiceDetails extends WebApiConnectedServiceRef { + /** + * Meta data for service connection + */ + connectedServiceMetaData: WebApiConnectedService; + /** + * Credential info + */ + credentialsXml: string; + /** + * Optional uri to connect directly to the service such as https://windows.azure.com + */ + endPoint: string; +} +export interface WebApiConnectedServiceRef { + id: string; + url: string; +} +/** + * The representation of data needed to create a tag definition which is sent across the wire. + */ +export interface WebApiCreateTagRequestData { + name: string; +} +export interface WebApiProject extends TeamProjectReference { + /** + * Set of capabilities this project has + */ + capabilities: { + [key: string]: { + [key: string]: string; + }; + }; + /** + * Reference to collection which contains this project + */ + collection: WebApiProjectCollectionRef; + /** + * Default team for this project + */ + defaultTeam: WebApiTeamRef; +} +export interface WebApiProjectCollection extends WebApiProjectCollectionRef { + /** + * Project collection description + */ + description: string; + /** + * Project collection state + */ + state: string; +} +export interface WebApiProjectCollectionRef { + /** + * Collection Tfs Url (Host Url) + */ + collectionUrl: string; + /** + * Collection Guid + */ + id: string; + /** + * Collection Name + */ + name: string; + /** + * Collection REST Url + */ + url: string; +} +/** + * The representation of a tag definition which is sent across the wire. + */ +export interface WebApiTagDefinition { + active: boolean; + id: string; + name: string; + url: string; +} +export interface WebApiTeam extends WebApiTeamRef { + /** + * Team description + */ + description: string; + /** + * Identity REST API Url to this team + */ + identityUrl: string; +} +export interface WebApiTeamRef { + /** + * Team (Identity) Guid. A Team Foundation ID. + */ + id: string; + /** + * Team name + */ + name: string; + /** + * Team REST API Url + */ + url: string; +} +export var TypeInfo: { + ConnectedServiceKind: { + enumValues: { + "custom": number; + "azureSubscription": number; + "chef": number; + "generic": number; + }; + }; + IdentityData: { + fields: any; + }; + Process: { + fields: any; + }; + ProcessReference: { + fields: any; + }; + ProcessType: { + enumValues: { + "system": number; + "custom": number; + "inherited": number; + }; + }; + ProjectChangeType: { + enumValues: { + "modified": number; + "deleted": number; + "added": number; + }; + }; + ProjectInfo: { + fields: any; + }; + ProjectMessage: { + fields: any; + }; + ProjectProperty: { + fields: any; + }; + Proxy: { + fields: any; + }; + SourceControlTypes: { + enumValues: { + "tfvc": number; + "git": number; + }; + }; + TeamContext: { + fields: any; + }; + TeamProject: { + fields: any; + }; + TeamProjectCollection: { + fields: any; + }; + TeamProjectCollectionReference: { + fields: any; + }; + TeamProjectReference: { + fields: any; + }; + WebApiConnectedService: { + fields: any; + }; + WebApiConnectedServiceDetails: { + fields: any; + }; + WebApiConnectedServiceRef: { + fields: any; + }; + WebApiCreateTagRequestData: { + fields: any; + }; + WebApiProject: { + fields: any; + }; + WebApiProjectCollection: { + fields: any; + }; + WebApiProjectCollectionRef: { + fields: any; + }; + WebApiTagDefinition: { + fields: any; + }; + WebApiTeam: { + fields: any; + }; + WebApiTeamRef: { + fields: any; + }; +}; +} +declare module "TFS/Core/RestClient" { +import Contracts = require("TFS/Core/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_Operations_Contracts = require("VSS/Operations/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class CoreHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.WebApiConnectedServiceDetails} connectedServiceCreationData + * @param {string} projectId + * @return IPromise + */ + createConnectedService(connectedServiceCreationData: Contracts.WebApiConnectedServiceDetails, projectId: string): IPromise; + /** + * [Preview API] + * + * @param {string} projectId + * @param {string} name + * @return IPromise + */ + getConnectedServiceDetails(projectId: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} projectId + * @param {Contracts.ConnectedServiceKind} kind + * @return IPromise + */ + getConnectedServices(projectId: string, kind?: Contracts.ConnectedServiceKind): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + createIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + deleteIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * [Preview API] + * + * @param {string} mruName + * @return IPromise + */ + getIdentityMru(mruName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + updateIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * [Preview API] + * + * @param {string} projectId + * @param {string} teamId + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getTeamMembers(projectId: string, teamId: string, top?: number, skip?: number): IPromise; + /** + * [Preview API] Retrieve process by id + * + * @param {string} processId + * @return IPromise + */ + getProcessById(processId: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getProcesses(): IPromise; + /** + * [Preview API] Get project collection with the specified id or name. + * + * @param {string} collectionId + * @return IPromise + */ + getProjectCollection(collectionId: string): IPromise; + /** + * [Preview API] Get project collection references for this application. + * + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getProjectCollections(top?: number, skip?: number): IPromise; + /** + * [Preview API] + * + * @param {number} minRevision + * @return IPromise + */ + getProjectHistory(minRevision?: number): IPromise; + /** + * [Preview API] Get project with the specified id or name, optionally including capabilities. + * + * @param {string} projectId + * @param {boolean} includeCapabilities - Include capabilities (such as source control) in the team project result (default: false). + * @param {boolean} includeHistory - Search within renamed projects (that had such name in the past). + * @return IPromise + */ + getProject(projectId: string, includeCapabilities?: boolean, includeHistory?: boolean): IPromise; + /** + * [Preview API] Get project references with the specified state + * + * @param {any} stateFilter - Filter on team projects in a specific team project state (default: WellFormed). + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getProjects(stateFilter?: any, top?: number, skip?: number): IPromise; + /** + * [Preview API] Queue a project creation. + * + * @param {Contracts.TeamProject} projectToCreate - The project to create. + * @return IPromise + */ + queueCreateProject(projectToCreate: Contracts.TeamProject): IPromise; + /** + * [Preview API] Queue a project deletion. + * + * @param {string} projectId - The project id of the project to delete. + * @return IPromise + */ + queueDeleteProject(projectId: string): IPromise; + /** + * [Preview API] Update an existing project's name, abbreviation, or description. + * + * @param {Contracts.TeamProject} projectUpdate - The updates for the project. + * @param {string} projectId - The project id of the project to update. + * @return IPromise + */ + updateProject(projectUpdate: Contracts.TeamProject, projectId: string): IPromise; + /** + * [Preview API] + * + * @param {string} proxyUrl + * @return IPromise + */ + getProxies(proxyUrl?: string): IPromise; + /** + * [Preview API] + * + * @param {string} projectId + * @param {string} teamId + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getTeams(projectId: string, teamId?: string, top?: number, skip?: number): IPromise; +} +export class CoreHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.WebApiConnectedServiceDetails} connectedServiceCreationData + * @param {string} projectId + * @return IPromise + */ + createConnectedService(connectedServiceCreationData: Contracts.WebApiConnectedServiceDetails, projectId: string): IPromise; + /** + * [Preview API] + * + * @param {string} projectId + * @param {string} name + * @return IPromise + */ + getConnectedServiceDetails(projectId: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} projectId + * @param {Contracts.ConnectedServiceKind} kind + * @return IPromise + */ + getConnectedServices(projectId: string, kind?: Contracts.ConnectedServiceKind): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + createIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + deleteIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * [Preview API] + * + * @param {string} mruName + * @return IPromise + */ + getIdentityMru(mruName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + updateIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * @param {string} projectId + * @param {string} teamId + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getTeamMembers(projectId: string, teamId: string, top?: number, skip?: number): IPromise; + /** + * Retrieve process by id + * + * @param {string} processId + * @return IPromise + */ + getProcessById(processId: string): IPromise; + /** + * @return IPromise + */ + getProcesses(): IPromise; + /** + * Get project collection with the specified id or name. + * + * @param {string} collectionId + * @return IPromise + */ + getProjectCollection(collectionId: string): IPromise; + /** + * Get project collection references for this application. + * + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getProjectCollections(top?: number, skip?: number): IPromise; + /** + * [Preview API] + * + * @param {number} minRevision + * @return IPromise + */ + getProjectHistory(minRevision?: number): IPromise; + /** + * Get project with the specified id or name, optionally including capabilities. + * + * @param {string} projectId + * @param {boolean} includeCapabilities - Include capabilities (such as source control) in the team project result (default: false). + * @param {boolean} includeHistory - Search within renamed projects (that had such name in the past). + * @return IPromise + */ + getProject(projectId: string, includeCapabilities?: boolean, includeHistory?: boolean): IPromise; + /** + * Get project references with the specified state + * + * @param {any} stateFilter - Filter on team projects in a specific team project state (default: WellFormed). + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getProjects(stateFilter?: any, top?: number, skip?: number): IPromise; + /** + * Queue a project creation. + * + * @param {Contracts.TeamProject} projectToCreate - The project to create. + * @return IPromise + */ + queueCreateProject(projectToCreate: Contracts.TeamProject): IPromise; + /** + * Queue a project deletion. + * + * @param {string} projectId - The project id of the project to delete. + * @return IPromise + */ + queueDeleteProject(projectId: string): IPromise; + /** + * Update an existing project's name, abbreviation, or description. + * + * @param {Contracts.TeamProject} projectUpdate - The updates for the project. + * @param {string} projectId - The project id of the project to update. + * @return IPromise + */ + updateProject(projectUpdate: Contracts.TeamProject, projectId: string): IPromise; + /** + * [Preview API] + * + * @param {string} proxyUrl + * @return IPromise + */ + getProxies(proxyUrl?: string): IPromise; + /** + * @param {string} projectId + * @param {string} teamId + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getTeams(projectId: string, teamId?: string, top?: number, skip?: number): IPromise; +} +export class CoreHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.WebApiConnectedServiceDetails} connectedServiceCreationData + * @param {string} projectId + * @return IPromise + */ + createConnectedService(connectedServiceCreationData: Contracts.WebApiConnectedServiceDetails, projectId: string): IPromise; + /** + * [Preview API] + * + * @param {string} projectId + * @param {string} name + * @return IPromise + */ + getConnectedServiceDetails(projectId: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} projectId + * @param {Contracts.ConnectedServiceKind} kind + * @return IPromise + */ + getConnectedServices(projectId: string, kind?: Contracts.ConnectedServiceKind): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + createIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + deleteIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * [Preview API] + * + * @param {string} mruName + * @return IPromise + */ + getIdentityMru(mruName: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.IdentityData} mruData + * @param {string} mruName + * @return IPromise + */ + updateIdentityMru(mruData: Contracts.IdentityData, mruName: string): IPromise; + /** + * @param {string} projectId + * @param {string} teamId + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getTeamMembers(projectId: string, teamId: string, top?: number, skip?: number): IPromise; + /** + * Retrieve process by id + * + * @param {string} processId + * @return IPromise + */ + getProcessById(processId: string): IPromise; + /** + * @return IPromise + */ + getProcesses(): IPromise; + /** + * Get project collection with the specified id or name. + * + * @param {string} collectionId + * @return IPromise + */ + getProjectCollection(collectionId: string): IPromise; + /** + * Get project collection references for this application. + * + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getProjectCollections(top?: number, skip?: number): IPromise; + /** + * [Preview API] + * + * @param {number} minRevision + * @return IPromise + */ + getProjectHistory(minRevision?: number): IPromise; + /** + * Get project with the specified id or name, optionally including capabilities. + * + * @param {string} projectId + * @param {boolean} includeCapabilities - Include capabilities (such as source control) in the team project result (default: false). + * @param {boolean} includeHistory - Search within renamed projects (that had such name in the past). + * @return IPromise + */ + getProject(projectId: string, includeCapabilities?: boolean, includeHistory?: boolean): IPromise; + /** + * Get project references with the specified state + * + * @param {any} stateFilter - Filter on team projects in a specific team project state (default: WellFormed). + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getProjects(stateFilter?: any, top?: number, skip?: number): IPromise; + /** + * Queue a project creation. + * + * @param {Contracts.TeamProject} projectToCreate - The project to create. + * @return IPromise + */ + queueCreateProject(projectToCreate: Contracts.TeamProject): IPromise; + /** + * Queue a project deletion. + * + * @param {string} projectId - The project id of the project to delete. + * @return IPromise + */ + queueDeleteProject(projectId: string): IPromise; + /** + * Update an existing project's name, abbreviation, or description. + * + * @param {Contracts.TeamProject} projectUpdate - The updates for the project. + * @param {string} projectId - The project id of the project to update. + * @return IPromise + */ + updateProject(projectUpdate: Contracts.TeamProject, projectId: string): IPromise; + /** + * [Preview API] + * + * @param {string} proxyUrl + * @return IPromise + */ + getProxies(proxyUrl?: string): IPromise; + /** + * @param {string} projectId + * @param {string} teamId + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getTeams(projectId: string, teamId?: string, top?: number, skip?: number): IPromise; +} +export class CoreHttpClient extends CoreHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return CoreHttpClient2_1 + */ +export function getClient(): CoreHttpClient2_1; +} +declare module "TFS/Dashboards/Contracts" { +export interface Dashboard { + widgets: Widget[]; +} +export interface DashboardGroup { + dashboardEntries: DashboardGroupEntry[]; +} +/** + * Dashboard group entry settings + */ +export interface DashboardGroupEntry { + id: string; + name: string; + position: number; +} +/** + * Response from RestAPI when saving and editing DashboardGroupEntry + */ +export interface DashboardGroupEntryResponse extends DashboardGroupEntry { + _links: any; + url: string; +} +export interface DashboardGroupResponse { + _links: any; + dashboardEntries: DashboardGroupEntryResponse[]; + url: string; +} +export interface DashboardResponse extends DashboardGroupEntry { + _links: any; + url: string; + widgets: WidgetResponse[]; +} +export enum DashboardScope { + Collection_User = 0, + Project_Team = 1, +} +/** + * Widget data + */ +export interface Widget { + /** + * Refers to the allowed sizes for the widget. This gets populated when user wants to configure the widget + */ + allowedSizes: WidgetSize[]; + /** + * Refers to unique identifier of a feature artifact. Used for pinning+unpinning a specific artifact. + */ + artifactId: string; + configurationContributionId: string; + contentUri: string; + contributionId: string; + id: string; + isEnabled: boolean; + isNameConfigurable: boolean; + loadingImageUrl: string; + name: string; + position: WidgetPosition; + settings: string; + size: WidgetSize; + typeId: string; +} +/** + * For V1, this is just a pool of definitions describing our possible Widget Configurations. + */ +export interface WidgetConfigurationMetadata { + /** + * The id of the underlying contribution defining the supplied Widget. + */ + contributionId: string; + /** + * Contribution target IDs + */ + targets: string[]; + /** + * Dev-facing name of this kind of widget configuration. Each widget must use a unique value here. + */ + typeId: string; +} +/** + * For V1, this is just a pool of definitions describing our possible Widgets. + */ +export interface WidgetMetadata { + /** + * Sizes supported by the Widget. + */ + allowedSizes: WidgetSize[]; + /** + * The id of the underlying contribution defining the supplied Widget custom configuration UI. Null if custom configuration UI is not available. + */ + configurationContributionId: string; + /** + * Indicates if the widget requires configuration before being added to dashboard. + */ + configurationRequired: boolean; + /** + * Uri for the WidgetFactory to get the widget + */ + contentUri: string; + /** + * The id of the underlying contribution defining the supplied Widget. + */ + contributionId: string; + /** + * Optional default settings to be copied into widget settings + */ + defaultSettings: string; + /** + * Summary information describing the widget. + */ + description: string; + /** + * Widgets can be disabled by the app store. We'll need to gracefully handle for: - persistence (Allow) - Requests (Tag as disabled, and provide context) + */ + isEnabled: boolean; + /** + * Opt-out boolean that indicates if the widget supports widget name/title configuration. Widgets ignoring the name should set it to false in the manifest. + */ + isNameConfigurable: boolean; + /** + * Opt-out boolean indicating if the widget is hidden from the catalog. For V1, only "pull" model widgets can be provided from the catalog. + */ + isVisibleFromCatalog: boolean; + /** + * Resource for a loading placeholder image on dashboard + */ + loadingImageUrl: string; + /** + * User facing name of the widget type. Each widget must use a unique value here. + */ + name: string; + /** + * Resource for a preview image in the widget Catalog. + */ + previewImageUrl: string; + /** + * Data contract required for the widget to function and to work in its container. + */ + supportedScopes: WidgetScope[]; + /** + * Dev-facing name of this kind of widget. Each widget must use a unique value here. + */ + typeId: string; +} +export interface WidgetMetadataResponse { + uri: string; + widgetMetadata: WidgetMetadata; +} +export interface WidgetPosition { + column: number; + row: number; +} +/** + * Response from RestAPI when saving and editing Widget + */ +export interface WidgetResponse extends Widget { + _links: any; + url: string; +} +export enum WidgetScope { + Collection_User = 0, + Project_Team = 1, +} +export interface WidgetSize { + columnSpan: number; + rowSpan: number; +} +export interface WidgetTypesResponse { + uri: string; + widgetTypes: WidgetMetadata[]; +} +export var TypeInfo: { + Dashboard: { + fields: any; + }; + DashboardGroup: { + fields: any; + }; + DashboardGroupEntry: { + fields: any; + }; + DashboardGroupEntryResponse: { + fields: any; + }; + DashboardGroupResponse: { + fields: any; + }; + DashboardResponse: { + fields: any; + }; + DashboardScope: { + enumValues: { + "collection_User": number; + "project_Team": number; + }; + }; + Widget: { + fields: any; + }; + WidgetConfigurationMetadata: { + fields: any; + }; + WidgetMetadata: { + fields: any; + }; + WidgetMetadataResponse: { + fields: any; + }; + WidgetPosition: { + fields: any; + }; + WidgetResponse: { + fields: any; + }; + WidgetScope: { + enumValues: { + "collection_User": number; + "project_Team": number; + }; + }; + WidgetSize: { + fields: any; + }; + WidgetTypesResponse: { + fields: any; + }; +}; +} +declare module "TFS/Dashboards/Controls" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +import Contracts = require("TFS/Dashboards/Contracts"); +import Dashboards_UIContracts = require("TFS/Dashboards/UIContracts"); +export module DashboardContributions { + var WidgetCatalogDialog: string; + var AddWidgetButton: string; + var DashboardGrid: string; +} +export interface IWidgetCatalogDialog { +} +export interface WidgetCatalogDialogOptions { + /** + * when the ok is clicked on the catalog, widgets chosen is provided back to the caller. + */ + onOkCallback: (widget: Contracts.Widget[]) => void; + /** + * the data contract that the catalog will use to populate with widgets to add to a dashboard. + */ + scope: Contracts.WidgetScope; +} +/** +* Control showing the widget catalog dialog control +*/ +export module WidgetCatalogDialog { + var contributionId: string; + /** + * Create an instance of the widget catalog dialog control + * + * @param $container Container element to create the widget catalog dialog control in (dialog is appended to this element) + * @param options widget catalog dialog control options + * @param webContext Optional web context to scope the control to + */ + function create($container: JQuery, options?: WidgetCatalogDialogOptions, webContext?: Contracts_Platform.WebContext): IPromise; +} +export interface IAddWidgetButton { +} +export interface AddWidgetButtonOptions { + /** + * method that handles the widget button click event + */ + clickHandler: (eventObject: JQueryEventObject) => void; + /** + * method that handles the hover in event for the widget button + */ + hoverInHandler?: (eventObject: JQueryEventObject) => void; + /** + * method that handles the hover out event for the widget button + */ + hoverOutHandler?: (eventObject: JQueryEventObject) => void; +} +export module AddWidgetButton { + var contributionId: string; + /** + * Create an instance of the widget catalog dialog control + * + * @param $container Container element to create the widget catalog dialog control in (dialog is appended to this element) + * @param options widget catalog dialog control options + * @param webContext Optional web context to scope the control to + */ + function create($container: JQuery, options?: AddWidgetButtonOptions, webContext?: Contracts_Platform.WebContext): IPromise; +} +export interface IDashboardGrid { + /** + * Add a widget into the dashboard + */ + addWidget: (widget: Contracts.Widget) => IPromise; + /** + * Add multiple widgets to the dashboard. + */ + addWidgets: (widget: Contracts.Widget[]) => void; + /** + * Update widget state by providing its settings + */ + refreshWidgetSettings: (widgetId: string, settings: Dashboards_UIContracts.ISettings) => void; +} +export interface IDashboardPermissions { + /** + *{ boolean } canEdit - have the permission to edit the dashboard. THis includes drag and drop and saving the dashboard. + */ + canEdit: boolean; +} +export interface DashboardGridOptions { + /** + * Unique identifier for a dashboard + */ + id: string; + /** + * key to identify dashboard storage model. This is used in concert with the scope to decide how to store the dashboard. + */ + storageKey: string; + /** + * contract associated with the permission and storage model for the dashboard. + */ + scope: Contracts.DashboardScope; + /** + * permissions container for the dashboard. + */ + dashboardPermission: IDashboardPermissions; + /** + * Dashboard's Widgets + */ + initialWidgets?: Contracts.Widget[]; + /** + * Call the configuration for a WidgetHost + * @param widgetHost - The widgethost that contain the widget to configure + */ + configureWidget: (widgetHost: Dashboards_UIContracts.IWidgetHost) => void; + /** + * Callback triggered each time a widget finished rendered + */ + widgetRenderedCallback: (widget: Dashboards_UIContracts.IWidgetHost) => void; +} +export module DashboardGrid { + var contributionId: string; + /** + * Create an instance of the dashboard grid control + * + * @param $container Container element to create the dashboard grid control + * @param options dashboard grid control options + * @param webContext Optional web context to scope the control to + */ + function create($container: JQuery, options?: DashboardGridOptions, webContext?: Contracts_Platform.WebContext): IPromise; +} +} +declare module "TFS/Dashboards/RestClient" { +import Contracts = require("TFS/Dashboards/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class DashboardHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.DashboardGroupEntry} entry + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createDashboard(entry: Contracts.DashboardGroupEntry, groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteDashboard(groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getDashboard(groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Dashboard} dashboard + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + replaceDashboard(dashboard: Contracts.Dashboard, groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getDashboardGroup(groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.DashboardGroup} group + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + replaceDashboardGroup(group: Contracts.DashboardGroup, groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Widget} widget + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createWidget(widget: Contracts.Widget, groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteWidget(groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWidget(groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Widget} widget + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateWidget(widget: Contracts.Widget, groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} typeId + * @return IPromise + */ + getWidgetMetadata(typeId: string): IPromise; + /** + * [Preview API] Returns available widgets in alphabetical order. + * + * @param {Contracts.WidgetScope} scope + * @return IPromise + */ + getWidgetTypes(scope: Contracts.WidgetScope): IPromise; +} +export class DashboardHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.DashboardGroupEntry} entry + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createDashboard(entry: Contracts.DashboardGroupEntry, groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteDashboard(groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getDashboard(groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Dashboard} dashboard + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + replaceDashboard(dashboard: Contracts.Dashboard, groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getDashboardGroup(groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.DashboardGroup} group + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + replaceDashboardGroup(group: Contracts.DashboardGroup, groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Widget} widget + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createWidget(widget: Contracts.Widget, groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteWidget(groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWidget(groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Widget} widget + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateWidget(widget: Contracts.Widget, groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} typeId + * @return IPromise + */ + getWidgetMetadata(typeId: string): IPromise; + /** + * [Preview API] Returns available widgets in alphabetical order. + * + * @param {Contracts.WidgetScope} scope + * @return IPromise + */ + getWidgetTypes(scope: Contracts.WidgetScope): IPromise; +} +export class DashboardHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.DashboardGroupEntry} entry + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createDashboard(entry: Contracts.DashboardGroupEntry, groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteDashboard(groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getDashboard(groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Dashboard} dashboard + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + replaceDashboard(dashboard: Contracts.Dashboard, groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getDashboardGroup(groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.DashboardGroup} group + * @param {string} groupId + * @param {string} project - Project ID or project name + * @return IPromise + */ + replaceDashboardGroup(group: Contracts.DashboardGroup, groupId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Widget} widget + * @param {string} groupId + * @param {string} dashboardId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createWidget(widget: Contracts.Widget, groupId: string, dashboardId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteWidget(groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWidget(groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Widget} widget + * @param {string} groupId + * @param {string} dashboardId + * @param {string} widgetId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateWidget(widget: Contracts.Widget, groupId: string, dashboardId: string, widgetId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} typeId + * @return IPromise + */ + getWidgetMetadata(typeId: string): IPromise; + /** + * [Preview API] Returns available widgets in alphabetical order. + * + * @param {Contracts.WidgetScope} scope + * @return IPromise + */ + getWidgetTypes(scope: Contracts.WidgetScope): IPromise; +} +export class DashboardHttpClient extends DashboardHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return DashboardHttpClient2_1 + */ +export function getClient(): DashboardHttpClient2_1; +} +declare module "TFS/Dashboards/UIContracts" { +import TFS_Dashboards_Contracts = require("TFS/Dashboards/Contracts"); +/** +* Type of error returned by a widget to the server. +* TODO: this list should be properly flushed out for public use. +*/ +export enum WidgetErrorType { + /** + * Server Side Error when making a REST API Call for data (e.g. bad request, invalid or empty data etc) + */ + RestCall = 0, + /** + * Auth issues when connecting to an API. + */ + RestAuthentication = 1, + /** + * Failures when rendering the widget, due to issues while working with the dom. + */ + Render = 2, + /** + * Widget taking too load to load within its allocated time + */ + Timeout = 3, +} +/** +* Provides detailed representation for an error in the widget that is sent to the host by the widget. +*/ +export interface IWidgetErrorDetails { + /** + * Type of error thrown by the widget. Refer to WidgetErrorType for details. + */ + errorType: WidgetErrorType; + /** + * notify the widget host that this widget failed and provide any errors to be displayed on the error overlay. + */ + message: string; + /** + * notify the widget host that this widget failed and provide any errors to be displayed on the error overlay. + */ + widgetName: string; + /** + * VS Code associated with an error to present on the error overlay experience. It is optional. + */ + errorCode?: string; +} +/** +* Provides API for Widget & Widget Configuration Views to provide status updates to a host container. +*/ +export interface INotifyStatus { + /** + * Notify the host that this widget finished loading and is ready to display + */ + notifyLoadSucceeded: () => void; + /** + * notify the host that this widget failed and provide any errors to be displayed on the error overlay. + */ + notifyLoadFailed: (error: any, errorType?: WidgetErrorType) => void; +} +/** +* Provides supplemental notification support. +*/ +export interface INotifyExtendedStatus extends INotifyStatus { + /** + * Notify the widget host that this widget has started loading. + */ + notifyLoadStarted: () => void; +} +export interface IConfigurableWidget { + /** + * User register to this call back to do what they want to the new settings + * @param {ISettings} settings : Complete list of settings (changed or not) + */ + refreshCallBack: (settings: ISettings) => void; + /** + * Call from the configuration framework to notify that some settings has been changed. This will + * call the client callback to have this one refresh the way he wants (complete refresh or partial). + * @param {string} setting - All settings + */ + refresh(settings: ISettings): void; + configure: () => void; +} +/** +* Provides API for interactions with the widget hosting container. +*/ +export interface IWidgetHost extends INotifyExtendedStatus, IConfigurableWidget { + /** + * Exposes state information about the Widget, for use by configuration blades. + * This member is not intended for consumption directly by widgets. + */ + getWidget: () => TFS_Dashboards_Contracts.Widget; +} +export interface IWidgetConfigurationHost extends IConfigureWidgetName, IConfigureWidgetSize { + /** + * Exposes information about the Widget, from the start of configuration. + */ + getInitialWidgetState: () => TFS_Dashboards_Contracts.Widget; + /** Allows a Widget to notify of configuration Changes. */ + onConfigurationChange(configurationStatus: IWidgetConfigurationStatus): void; + /** Allows a widget Configuration view to Register a change handler to react to a pending save. */ + setSaveValidationCallback(saveValidationCallback: () => IWidgetConfigurationStatus): void; + /** Allows a widget Configuration to RegisterRegisters a handler to react after a save is confirmed*/ + setConfigurationSavedCallback(configurationSavedCallback: () => void): void; +} +export interface IGeneralSettings { + WidgetName: string; + WidgetSize: TFS_Dashboards_Contracts.WidgetSize; +} +export interface ISettings { + generalSettings: IGeneralSettings; + customSettings: string; +} +/** +* Exposes state for a particular Widget. Decouples the detailed representation of the REST API from widget implementers. +*/ +export interface IWidgetState { + /** + * Get size of this widget. + */ + getSize: () => TFS_Dashboards_Contracts.WidgetSize; + /** + * Get Name of this particular widget + */ + getName: () => string; + /** + * Get TypeId of this widget + */ + getTypeId: () => string; + /** + * Get settings of this widget + */ + getSettings: () => string; + /** + * Get loading image url of the widget + */ + getLoadingImageUrl: () => string; +} +/** +* Interface representing the context of a widget for *Viewing*, with read access to its state as well as interactivity with the host. +*/ +export interface IWidgetContext extends IWidgetState, INotifyExtendedStatus, IConfigurableWidget { +} +/** Describes the status of a Widget Configuration for editing */ +export interface IWidgetConfigurationStatus { + /** Indicates if the current configuration can be saved */ + canSave: boolean; + /** The current state of the configuration*/ + settings: string; +} +/** Read-Write interface for managing Widget Name in Config UI.*/ +export interface IConfigureWidgetName { + /** returns the current name of the widget, from the General configuration view */ + getCurrentWidgetName(): string; + /** sets current name of the widget to the General configuration view. */ + setCurrentWidgetName(name: string): void; +} +/** Read-Only interface for managing Widget Size in Config UI.*/ +export interface IConfigureWidgetSize { + /** returns the current size of the widget, from the General configuration view */ + getCurrentWidgetSize(): TFS_Dashboards_Contracts.WidgetSize; +} +export interface IWidgetConfigurationContext extends INotifyStatus, IConfigureWidgetName, IConfigureWidgetSize { + /** + * Get initial state of Widget. + */ + getInitialWidgetState: () => TFS_Dashboards_Contracts.Widget; + /** + * notify the widget configuration host that this widget configuration changed + */ + notifyConfigurationChange: (settings: IWidgetConfigurationStatus) => void; + /** Callback registration for Configuration UI to respond to queries by the Configuration Host when the user is attempting to save. + Our experience requires errors be hidden until the user interacts OR the View is notified that we are attempting to save. + This requirement was mandated for consistency with the Backlogs config experience. + */ + setSaveValidationCallBack: (saveValidationCallback: () => IWidgetConfigurationStatus) => void; + /** + * Sets the callback to be called when the configuration is saved + * @param { () => void } callback - The callback to be called when configuration is saved + */ + setOnConfigurationSaveCallback: (callback: () => void) => void; +} +/** +* Init payload container, which allows us to avoid unintentional param collisions. +*/ +export interface WidgetOptions { + /** + * context of a widget, with access to its state as well as interactivity with the host. + */ + widgetContext: IWidgetContext; +} +export interface WidgetConfigurationOptions { + /** + * context of a widget configuration View, with access to its state as well as interactivity with the host. + */ + widgetConfigurationContext: IWidgetConfigurationContext; +} +/** + * Describes contract for initializing controls targeted to Configuration Scenarios in Widgets. + */ +export interface ConfigurationControlOptions { + initialValue: T; + onChange: () => void; +} +/** A control which exposes error Messages*/ +export interface IErrorControl { + getErrorMessage: () => string; +} +/** Describes contract for composite controls which are used to assemble Widget Configuration UI, involving error standardized error validation. */ +export interface IConfigurationControl extends IErrorControl { + getCurrentValue: () => T; + getErrorMessage: () => string; +} +} +declare module "TFS/DistributedTask/Contracts" { +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_FormInput_Contracts = require("VSS/Common/Contracts/FormInput"); +export interface AgentPoolEvent { + eventType: string; + pool: TaskAgentPool; +} +export interface AgentQueueEvent { + eventType: string; + queue: TaskAgentQueue; +} +export interface AgentRefreshMessage { + agentId: number; + timeout: any; +} +export enum ConnectedServiceKind { + /** + * Custom or unknown service + */ + Custom = 0, + /** + * Azure Subscription + */ + AzureSubscription = 1, + /** + * Chef Connection + */ + Chef = 2, + /** + * Generic Connection + */ + Generic = 3, + /** + * GitHub Connection + */ + GitHub = 4, +} +export interface DataSource { + endpointUrl: string; + name: string; + resultSelector: string; +} +export interface DataSourceBinding { + dataSourceName: string; + endpointId: string; + parameters: { + [key: string]: string; + }; + target: string; +} +export interface EndpointAuthorization { + parameters: { + [key: string]: string; + }; + scheme: string; +} +export interface Issue { + category: string; + data: { + [key: string]: string; + }; + message: string; + type: IssueType; +} +export enum IssueType { + Error = 1, + Warning = 2, +} +export interface JobAssignedEvent extends JobEvent { + request: TaskAgentJobRequest; +} +export interface JobCancelMessage { + jobId: string; + timeout: any; +} +export interface JobCompletedEvent extends JobEvent { + result: TaskResult; +} +/** + * Represents the context of variables and vectors for a job request. + */ +export interface JobEnvironment { + endpoints: ServiceEndpoint[]; + mask: MaskHint[]; + options: { + [key: number]: JobOption; + }; + /** + * Gets or sets the endpoint used for communicating back to the calling service. + */ + systemConnection: ServiceEndpoint; + variables: { + [key: string]: string; + }; +} +export interface JobEvent { + jobId: string; + name: string; +} +/** + * Represents an option that may affect the way an agent runs the job. + */ +export interface JobOption { + data: { + [key: string]: string; + }; + /** + * Gets the id of the option. + */ + id: string; +} +export interface JobRequestMessage { + environment: JobEnvironment; + jobId: string; + jobName: string; + lockedUntil: Date; + lockToken: string; + plan: TaskOrchestrationPlanReference; + requestId: number; + tasks: TaskInstance[]; + timeline: TimelineReference; +} +export interface MaskHint { + type: MaskType; + value: string; +} +export enum MaskType { + Variable = 1, + Regex = 2, +} +export interface PlanEnvironment { + mask: MaskHint[]; + options: { + [key: number]: JobOption; + }; + variables: { + [key: string]: string; + }; +} +/** + * Represents an endpoint which may be used by an orchestration job. + */ +export interface ServiceEndpoint { + administratorsGroup: VSS_Common_Contracts.IdentityRef; + /** + * Gets or sets the authorization data for talking to the endpoint. + */ + authorization: EndpointAuthorization; + /** + * The Gets or sets Identity reference for the user who created the Service endpoint + */ + createdBy: VSS_Common_Contracts.IdentityRef; + data: { + [key: string]: string; + }; + /** + * Gets or Sets description of endpoint + */ + description: string; + groupScopeId: string; + /** + * Gets or sets the identifier of this endpoint. + */ + id: string; + /** + * Gets or sets the friendly name of the endpoint. + */ + name: string; + readersGroup: VSS_Common_Contracts.IdentityRef; + /** + * Gets or sets the type of the endpoint. + */ + type: string; + /** + * Gets or sets the url of the endpoint. + */ + url: string; +} +export interface ServiceEndpointAuthenticationScheme { + displayName: string; + inputDescriptors: VSS_FormInput_Contracts.InputDescriptor[]; + scheme: string; +} +export interface ServiceEndpointType { + authenticationSchemes: ServiceEndpointAuthenticationScheme[]; + dataSources: DataSource[]; + description: string; + displayName: string; + name: string; + url: string; +} +export interface TaskAgent extends TaskAgentReference { + /** + * Gets the request which is currently assigned to this agent. + */ + assignedRequest: TaskAgentJobRequest; + /** + * Gets the date on which this agent was created. + */ + createdOn: Date; + /** + * Gets or sets a value indicating whether or not this agent should be enabled for job execution. + */ + enabled: boolean; + /** + * Gets or sets the maximum job parallelism allowed on this host. + */ + maxParallelism: number; + properties: any; + /** + * Gets the current connectivity status of the agent. + */ + status: TaskAgentStatus; + /** + * Gets the date on which the last connectivity status change occurred. + */ + statusChangedOn: Date; + systemCapabilities: { + [key: string]: string; + }; + userCapabilities: { + [key: string]: string; + }; +} +export interface TaskAgentJobRequest { + assignTime: Date; + definition: TaskOrchestrationOwner; + demands: any[]; + finishTime: Date; + hostId: string; + jobId: string; + lockedUntil: Date; + matchedAgents: TaskAgentReference[]; + owner: TaskOrchestrationOwner; + planId: string; + planType: string; + queueTime: Date; + receiveTime: Date; + requestId: number; + reservedAgent: TaskAgentReference; + result: TaskResult; + scopeId: string; + serviceOwner: string; +} +export interface TaskAgentMessage { + body: string; + messageId: number; + messageType: string; +} +export interface TaskAgentPool extends TaskAgentPoolReference { + /** + * Gets the administrators group for this agent pool. + */ + administratorsGroup: VSS_Common_Contracts.IdentityRef; + /** + * Gets or sets a value indicating whether or not a queue should be automatically provisioned for each project collection or not. + */ + autoProvision: boolean; + /** + * Gets the identity who created this pool. The creator of the pool is automatically added into the administrators group for the pool on creation. + */ + createdBy: VSS_Common_Contracts.IdentityRef; + /** + * Gets the date/time of the pool creation. + */ + createdOn: Date; + /** + * Gets the scope identifier for groups/roles which are owned by this pool. + */ + groupScopeId: string; + /** + * Gets or sets a value indicating whether or not this pool is managed by the service. + */ + isHosted: boolean; + properties: any; + /** + * Gets a value indicating whether or not roles have been provisioned for this pool. + */ + provisioned: boolean; + /** + * Gets the service accounts group for this agent pool. + */ + serviceAccountsGroup: VSS_Common_Contracts.IdentityRef; + /** + * Gets the current size of the pool. + */ + size: number; +} +export interface TaskAgentPoolReference { + id: number; + name: string; + scope: string; +} +export interface TaskAgentQueue { + groupScopeId: string; + id: number; + name: string; + pool: TaskAgentPoolReference; + provisioned: boolean; +} +export enum TaskAgentQueueActionFilter { + None = 0, + Manage = 2, + Use = 16, +} +export interface TaskAgentReference { + /** + * Gets the identifier of the agent. + */ + id: number; + /** + * Gets the name of the agent. + */ + name: string; + /** + * Gets the version of the agent. + */ + version: string; +} +export interface TaskAgentSession { + agent: TaskAgentReference; + ownerName: string; + sessionId: string; + systemCapabilities: { + [key: string]: string; + }; +} +export enum TaskAgentStatus { + Offline = 1, + Online = 2, +} +export interface TaskAttachment { + _links: any; + createdOn: Date; + lastChangedBy: string; + lastChangedOn: Date; + name: string; + recordId: string; + timelineId: string; + type: string; +} +export interface TaskChangeEvent { +} +export interface TaskDefinition { + agentExecution: TaskExecution; + author: string; + category: string; + contentsUploaded: boolean; + contributionIdentifier: string; + contributionVersion: string; + dataSourceBindings: DataSourceBinding[]; + demands: any[]; + description: string; + disabled: boolean; + friendlyName: string; + groups: TaskGroupDefinition[]; + helpMarkDown: string; + hostType: string; + iconUrl: string; + id: string; + inputs: TaskInputDefinition[]; + instanceNameFormat: string; + minimumAgentVersion: string; + name: string; + packageLocation: string; + packageType: string; + serverOwned: boolean; + sourceDefinitions: TaskSourceDefinition[]; + sourceLocation: string; + version: TaskVersion; + visibility: string[]; +} +export interface TaskDefinitionEndpoint { + /** + * An ID that identifies a service connection to be used for authenticating endpoint requests. + */ + connectionId: string; + /** + * The scope as understood by Connected Services. Essentialy, a project-id for now. + */ + scope: string; + /** + * An XPath/Json based selector to filter response returned by fetching the endpoint Url. An XPath based selector must be prefixed with the string "xpath:". A Json based selector must be prefixed with "json:". The following selector defines an XPath for extracting nodes named 'ServiceName'. endpoint.Selector = "xpath://ServiceName"; + */ + selector: string; + /** + * TaskId that this endpoint belongs to. + */ + taskId: string; + /** + * URL to GET. + */ + url: string; +} +export interface TaskExecution { + /** + * The utility task to run. Specifying this means that this task definition is simply a meta task to call another task. This is useful for tasks that call utility tasks like powershell and commandline + */ + execTask: TaskReference; + /** + * If a task is going to run code, then this provides the type/script etc... information by platform. For example, it might look like. net45: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } net20: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } java: { jar: "powershelltask.tasks.automation.teamfoundation.microsoft.com", } node: { script: "powershellhost.js", } + */ + platformInstructions: { + [key: string]: { + [key: string]: string; + }; + }; +} +export interface TaskGroupDefinition { + displayName: string; + isExpanded: boolean; + name: string; +} +export interface TaskInputDefinition { + defaultValue: string; + groupName: string; + helpMarkDown: string; + label: string; + name: string; + options: { + [key: string]: string; + }; + properties: { + [key: string]: string; + }; + required: boolean; + type: string; + visibleRule: string; +} +export interface TaskInstance extends TaskReference { + alwaysRun: boolean; + continueOnError: boolean; + displayName: string; + enabled: boolean; + instanceId: string; +} +export interface TaskLog extends TaskLogReference { + createdOn: Date; + indexLocation: string; + lastChangedOn: Date; + lineCount: number; + path: string; +} +export interface TaskLogReference { + id: number; + location: string; +} +export interface TaskOrchestrationContainer extends TaskOrchestrationItem { + children: TaskOrchestrationItem[]; + continueOnError: boolean; + parallel: boolean; + rollback: TaskOrchestrationContainer; +} +export interface TaskOrchestrationItem { + itemType: TaskOrchestrationItemType; +} +export enum TaskOrchestrationItemType { + Container = 0, + Job = 1, +} +export interface TaskOrchestrationJob extends TaskOrchestrationItem { + demands: any[]; + executeAs: VSS_Common_Contracts.IdentityRef; + executionTimeout: any; + instanceId: string; + name: string; + tasks: TaskInstance[]; + variables: { + [key: string]: string; + }; +} +export interface TaskOrchestrationOwner { + _links: any; + id: number; + name: string; +} +export interface TaskOrchestrationPlan extends TaskOrchestrationPlanReference { + environment: PlanEnvironment; + finishTime: Date; + implementation: TaskOrchestrationContainer; + requestedById: string; + requestedForId: string; + result: TaskResult; + resultCode: string; + startTime: Date; + state: TaskOrchestrationPlanState; + timeline: TimelineReference; +} +export interface TaskOrchestrationPlanReference { + artifactLocation: string; + artifactUri: string; + planId: string; + planType: string; + scopeIdentifier: string; + version: number; +} +export enum TaskOrchestrationPlanState { + InProgress = 1, + Queued = 2, + Completed = 4, +} +export interface TaskPackageMetadata { + /** + * Gets the name of the package. + */ + type: string; + /** + * Gets the url of the package. + */ + url: string; + /** + * Gets the version of the package. + */ + version: string; +} +export interface TaskReference { + id: string; + inputs: { + [key: string]: string; + }; + name: string; + version: string; +} +export enum TaskResult { + Succeeded = 0, + SucceededWithIssues = 1, + Failed = 2, + Canceled = 3, + Skipped = 4, + Abandoned = 5, +} +export interface TaskSourceDefinition { + authKey: string; + endpoint: string; + selector: string; + target: string; +} +export interface TaskVersion { + isTest: boolean; + major: number; + minor: number; + patch: number; +} +/** + * Represents a shallow reference to a TeamProject. + */ +export interface TeamProjectReference { + /** + * Project abbreviation. + */ + abbreviation: string; + /** + * The project's description (if any). + */ + description: string; + /** + * Project identifier. + */ + id: string; + /** + * Project name. + */ + name: string; + /** + * Project state. + */ + state: any; + /** + * Url to the full version of the object. + */ + url: string; +} +export interface Timeline extends TimelineReference { + lastChangedBy: string; + lastChangedOn: Date; + records: TimelineRecord[]; +} +export interface TimelineRecord { + changeId: number; + currentOperation: string; + details: TimelineReference; + errorCount: number; + finishTime: Date; + id: string; + issues: Issue[]; + lastModified: Date; + location: string; + log: TaskLogReference; + name: string; + order: number; + parentId: string; + percentComplete: number; + result: TaskResult; + resultCode: string; + startTime: Date; + state: TimelineRecordState; + type: string; + warningCount: number; + workerName: string; +} +export enum TimelineRecordState { + Pending = 0, + InProgress = 1, + Completed = 2, +} +export interface TimelineReference { + changeId: number; + id: string; + location: string; +} +export interface WebApiConnectedService extends WebApiConnectedServiceRef { + /** + * The user who did the OAuth authentication to created this service + */ + authenticatedBy: VSS_Common_Contracts.IdentityRef; + /** + * Extra description on the service. + */ + description: string; + /** + * Friendly Name of service connection + */ + friendlyName: string; + /** + * Id/Name of the connection service. For Ex: Subscription Id for Azure Connection + */ + id: string; + /** + * The kind of service. + */ + kind: string; + /** + * The project associated with this service + */ + project: TeamProjectReference; + /** + * Optional uri to connect directly to the service such as https://windows.azure.com + */ + serviceUri: string; +} +export interface WebApiConnectedServiceDetails extends WebApiConnectedServiceRef { + /** + * Meta data for service connection + */ + connectedServiceMetaData: WebApiConnectedService; + /** + * Credential info + */ + credentialsXml: string; + /** + * Optional uri to connect directly to the service such as https://windows.azure.com + */ + endPoint: string; +} +export interface WebApiConnectedServiceRef { + id: string; + url: string; +} +export var TypeInfo: { + AgentPoolEvent: { + fields: any; + }; + AgentQueueEvent: { + fields: any; + }; + AgentRefreshMessage: { + fields: any; + }; + ConnectedServiceKind: { + enumValues: { + "custom": number; + "azureSubscription": number; + "chef": number; + "generic": number; + "gitHub": number; + }; + }; + DataSource: { + fields: any; + }; + DataSourceBinding: { + fields: any; + }; + EndpointAuthorization: { + fields: any; + }; + Issue: { + fields: any; + }; + IssueType: { + enumValues: { + "error": number; + "warning": number; + }; + }; + JobAssignedEvent: { + fields: any; + }; + JobCancelMessage: { + fields: any; + }; + JobCompletedEvent: { + fields: any; + }; + JobEnvironment: { + fields: any; + }; + JobEvent: { + fields: any; + }; + JobOption: { + fields: any; + }; + JobRequestMessage: { + fields: any; + }; + MaskHint: { + fields: any; + }; + MaskType: { + enumValues: { + "variable": number; + "regex": number; + }; + }; + PlanEnvironment: { + fields: any; + }; + ServiceEndpoint: { + fields: any; + }; + ServiceEndpointAuthenticationScheme: { + fields: any; + }; + ServiceEndpointType: { + fields: any; + }; + TaskAgent: { + fields: any; + }; + TaskAgentJobRequest: { + fields: any; + }; + TaskAgentMessage: { + fields: any; + }; + TaskAgentPool: { + fields: any; + }; + TaskAgentPoolReference: { + fields: any; + }; + TaskAgentQueue: { + fields: any; + }; + TaskAgentQueueActionFilter: { + enumValues: { + "none": number; + "manage": number; + "use": number; + }; + }; + TaskAgentReference: { + fields: any; + }; + TaskAgentSession: { + fields: any; + }; + TaskAgentStatus: { + enumValues: { + "offline": number; + "online": number; + }; + }; + TaskAttachment: { + fields: any; + }; + TaskChangeEvent: { + fields: any; + }; + TaskDefinition: { + fields: any; + }; + TaskDefinitionEndpoint: { + fields: any; + }; + TaskExecution: { + fields: any; + }; + TaskGroupDefinition: { + fields: any; + }; + TaskInputDefinition: { + fields: any; + }; + TaskInstance: { + fields: any; + }; + TaskLog: { + fields: any; + }; + TaskLogReference: { + fields: any; + }; + TaskOrchestrationContainer: { + fields: any; + }; + TaskOrchestrationItem: { + fields: any; + }; + TaskOrchestrationItemType: { + enumValues: { + "container": number; + "job": number; + }; + }; + TaskOrchestrationJob: { + fields: any; + }; + TaskOrchestrationOwner: { + fields: any; + }; + TaskOrchestrationPlan: { + fields: any; + }; + TaskOrchestrationPlanReference: { + fields: any; + }; + TaskOrchestrationPlanState: { + enumValues: { + "inProgress": number; + "queued": number; + "completed": number; + }; + }; + TaskPackageMetadata: { + fields: any; + }; + TaskReference: { + fields: any; + }; + TaskResult: { + enumValues: { + "succeeded": number; + "succeededWithIssues": number; + "failed": number; + "canceled": number; + "skipped": number; + "abandoned": number; + }; + }; + TaskSourceDefinition: { + fields: any; + }; + TaskVersion: { + fields: any; + }; + TeamProjectReference: { + fields: any; + }; + Timeline: { + fields: any; + }; + TimelineRecord: { + fields: any; + }; + TimelineRecordState: { + enumValues: { + "pending": number; + "inProgress": number; + "completed": number; + }; + }; + TimelineReference: { + fields: any; + }; + WebApiConnectedService: { + fields: any; + }; + WebApiConnectedServiceDetails: { + fields: any; + }; + WebApiConnectedServiceRef: { + fields: any; + }; +}; +} +declare module "TFS/DistributedTask/TaskAgentRestClient" { +import Contracts = require("TFS/DistributedTask/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class TaskAgentHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @return IPromise + */ + addAgent(agent: Contracts.TaskAgent, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + deleteAgent(poolId: number, agentId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} agentId + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @return IPromise + */ + getAgent(poolId: number, agentId: number, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[]): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string} agentName + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @param {string[]} demands + * @return IPromise + */ + getAgents(poolId: number, agentName?: string, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[], demands?: string[]): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + replaceAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * [Preview API] Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector. + * + * @param {Contracts.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. + * @return IPromise + */ + queryEndpoint(endpoint: Contracts.TaskDefinitionEndpoint): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + deleteAgentRequest(poolId: number, requestId: number, lockToken: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + getAgentRequest(poolId: number, requestId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} agentId + * @param {number} completedRequestCount + * @return IPromise + */ + getAgentRequests(poolId: number, agentId: number, completedRequestCount?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @return IPromise + */ + queueAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + updateAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} messageId + * @param {string} sessionId + * @return IPromise + */ + deleteMessage(poolId: number, messageId: number, sessionId: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string} sessionId + * @param {number} lastMessageId + * @return IPromise + */ + getMessage(poolId: number, sessionId: string, lastMessageId?: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + refreshAgent(poolId: number, agentId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @return IPromise + */ + refreshAgents(poolId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentMessage} message + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + sendMessage(message: Contracts.TaskAgentMessage, poolId: number, requestId: number): IPromise; + /** + * [Preview API] This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackage(packageType: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getPackages(): IPromise; + /** + * [Preview API] This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackageZip(packageType: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @return IPromise + */ + getAgentPoolRoles(poolId?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentPool} pool + * @return IPromise + */ + addAgentPool(pool: Contracts.TaskAgentPool): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @return IPromise + */ + deleteAgentPool(poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string[]} properties + * @return IPromise + */ + getAgentPool(poolId: number, properties?: string[]): IPromise; + /** + * [Preview API] + * + * @param {string} poolName + * @param {string[]} properties + * @return IPromise + */ + getAgentPools(poolName?: string, properties?: string[]): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentPool} pool + * @param {number} poolId + * @return IPromise + */ + updateAgentPool(pool: Contracts.TaskAgentPool, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + getAgentQueueRoles(queueId?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentQueue} queue + * @return IPromise + */ + addAgentQueue(queue: Contracts.TaskAgentQueue): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + deleteAgentQueue(queueId: number): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueue(queueId: number, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * [Preview API] + * + * @param {string} queueName + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueues(queueName?: string, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * [Preview API] Proxy for a GET request defined by an service endpoint. The request is authorized using a data source in service endpoint. The response is filtered using an XPath/Json based selector. + * + * @param {Contracts.DataSourceBinding} binding - Describes the data source to fetch. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @return IPromise + */ + queryServiceEndpoint(binding: Contracts.DataSourceBinding, scopeIdentifier: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ServiceEndpoint} endpoint + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + createServiceEndpoint(endpoint: Contracts.ServiceEndpoint, scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + deleteServiceEndpoint(scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + getServiceEndpointDetails(scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string[]} authSchemes + * @param {string[]} endpointIds + * @return IPromise + */ + getServiceEndpoints(scopeIdentifier: string, type?: string, authSchemes?: string[], endpointIds?: string[]): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string} scheme + * @return IPromise + */ + getServiceEndpointTypes(scopeIdentifier: string, type?: string, scheme?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentSession} session + * @param {number} poolId + * @return IPromise + */ + createAgentSession(session: Contracts.TaskAgentSession, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string} sessionId + * @return IPromise + */ + deleteAgentSession(poolId: number, sessionId: string): IPromise; + /** + * [Preview API] + * + * @param {string} taskId + * @return IPromise + */ + deleteTaskDefinition(taskId: string): IPromise; + /** + * [Preview API] + * + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskContentZip(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskDefinition(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} taskId + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskDefinitions(taskId?: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * [Preview API] + * + * @param {{ [key: string] : string; }} userCapabilities + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgentUserCapabilities(userCapabilities: { + [key: string]: string; + }, poolId: number, agentId: number): IPromise; +} +export class TaskAgentHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @return IPromise + */ + addAgent(agent: Contracts.TaskAgent, poolId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + deleteAgent(poolId: number, agentId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @return IPromise + */ + getAgent(poolId: number, agentId: number, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[]): IPromise; + /** + * @param {number} poolId + * @param {string} agentName + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @param {string[]} demands + * @return IPromise + */ + getAgents(poolId: number, agentName?: string, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[], demands?: string[]): IPromise; + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + replaceAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector. + * + * @param {Contracts.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. + * @return IPromise + */ + queryEndpoint(endpoint: Contracts.TaskDefinitionEndpoint): IPromise; + /** + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + deleteAgentRequest(poolId: number, requestId: number, lockToken: string): IPromise; + /** + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + getAgentRequest(poolId: number, requestId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @param {number} completedRequestCount + * @return IPromise + */ + getAgentRequests(poolId: number, agentId: number, completedRequestCount?: number): IPromise; + /** + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @return IPromise + */ + queueAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number): IPromise; + /** + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + updateAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string): IPromise; + /** + * @param {number} poolId + * @param {number} messageId + * @param {string} sessionId + * @return IPromise + */ + deleteMessage(poolId: number, messageId: number, sessionId: string): IPromise; + /** + * @param {number} poolId + * @param {string} sessionId + * @param {number} lastMessageId + * @return IPromise + */ + getMessage(poolId: number, sessionId: string, lastMessageId?: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + refreshAgent(poolId: number, agentId: number): IPromise; + /** + * @param {number} poolId + * @return IPromise + */ + refreshAgents(poolId: number): IPromise; + /** + * @param {Contracts.TaskAgentMessage} message + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + sendMessage(message: Contracts.TaskAgentMessage, poolId: number, requestId: number): IPromise; + /** + * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackage(packageType: string): IPromise; + /** + * @return IPromise + */ + getPackages(): IPromise; + /** + * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackageZip(packageType: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @return IPromise + */ + getAgentPoolRoles(poolId?: number): IPromise; + /** + * @param {Contracts.TaskAgentPool} pool + * @return IPromise + */ + addAgentPool(pool: Contracts.TaskAgentPool): IPromise; + /** + * @param {number} poolId + * @return IPromise + */ + deleteAgentPool(poolId: number): IPromise; + /** + * @param {number} poolId + * @param {string[]} properties + * @return IPromise + */ + getAgentPool(poolId: number, properties?: string[]): IPromise; + /** + * @param {string} poolName + * @param {string[]} properties + * @return IPromise + */ + getAgentPools(poolName?: string, properties?: string[]): IPromise; + /** + * @param {Contracts.TaskAgentPool} pool + * @param {number} poolId + * @return IPromise + */ + updateAgentPool(pool: Contracts.TaskAgentPool, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + getAgentQueueRoles(queueId?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentQueue} queue + * @return IPromise + */ + addAgentQueue(queue: Contracts.TaskAgentQueue): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + deleteAgentQueue(queueId: number): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueue(queueId: number, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * [Preview API] + * + * @param {string} queueName + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueues(queueName?: string, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * [Preview API] Proxy for a GET request defined by an service endpoint. The request is authorized using a data source in service endpoint. The response is filtered using an XPath/Json based selector. + * + * @param {Contracts.DataSourceBinding} binding - Describes the data source to fetch. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @return IPromise + */ + queryServiceEndpoint(binding: Contracts.DataSourceBinding, scopeIdentifier: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ServiceEndpoint} endpoint + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + createServiceEndpoint(endpoint: Contracts.ServiceEndpoint, scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + deleteServiceEndpoint(scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + getServiceEndpointDetails(scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string[]} authSchemes + * @param {string[]} endpointIds + * @return IPromise + */ + getServiceEndpoints(scopeIdentifier: string, type?: string, authSchemes?: string[], endpointIds?: string[]): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string} scheme + * @return IPromise + */ + getServiceEndpointTypes(scopeIdentifier: string, type?: string, scheme?: string): IPromise; + /** + * @param {Contracts.TaskAgentSession} session + * @param {number} poolId + * @return IPromise + */ + createAgentSession(session: Contracts.TaskAgentSession, poolId: number): IPromise; + /** + * @param {number} poolId + * @param {string} sessionId + * @return IPromise + */ + deleteAgentSession(poolId: number, sessionId: string): IPromise; + /** + * @param {string} taskId + * @return IPromise + */ + deleteTaskDefinition(taskId: string): IPromise; + /** + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskContentZip(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskDefinition(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * @param {string} taskId + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskDefinitions(taskId?: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * @param {{ [key: string] : string; }} userCapabilities + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgentUserCapabilities(userCapabilities: { + [key: string]: string; + }, poolId: number, agentId: number): IPromise; +} +export class TaskAgentHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @return IPromise + */ + addAgent(agent: Contracts.TaskAgent, poolId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + deleteAgent(poolId: number, agentId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @return IPromise + */ + getAgent(poolId: number, agentId: number, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[]): IPromise; + /** + * @param {number} poolId + * @param {string} agentName + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @param {string[]} demands + * @return IPromise + */ + getAgents(poolId: number, agentName?: string, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[], demands?: string[]): IPromise; + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + replaceAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector. + * + * @param {Contracts.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. + * @return IPromise + */ + queryEndpoint(endpoint: Contracts.TaskDefinitionEndpoint): IPromise; + /** + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + deleteAgentRequest(poolId: number, requestId: number, lockToken: string): IPromise; + /** + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + getAgentRequest(poolId: number, requestId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @param {number} completedRequestCount + * @return IPromise + */ + getAgentRequests(poolId: number, agentId: number, completedRequestCount?: number): IPromise; + /** + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @return IPromise + */ + queueAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number): IPromise; + /** + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + updateAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string): IPromise; + /** + * @param {number} poolId + * @param {number} messageId + * @param {string} sessionId + * @return IPromise + */ + deleteMessage(poolId: number, messageId: number, sessionId: string): IPromise; + /** + * @param {number} poolId + * @param {string} sessionId + * @param {number} lastMessageId + * @return IPromise + */ + getMessage(poolId: number, sessionId: string, lastMessageId?: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + refreshAgent(poolId: number, agentId: number): IPromise; + /** + * @param {number} poolId + * @return IPromise + */ + refreshAgents(poolId: number): IPromise; + /** + * @param {Contracts.TaskAgentMessage} message + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + sendMessage(message: Contracts.TaskAgentMessage, poolId: number, requestId: number): IPromise; + /** + * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackage(packageType: string): IPromise; + /** + * @return IPromise + */ + getPackages(): IPromise; + /** + * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackageZip(packageType: string): IPromise; + /** + * @param {Contracts.TaskAgentPool} pool + * @return IPromise + */ + addAgentPool(pool: Contracts.TaskAgentPool): IPromise; + /** + * @param {number} poolId + * @return IPromise + */ + deleteAgentPool(poolId: number): IPromise; + /** + * @param {number} poolId + * @param {string[]} properties + * @return IPromise + */ + getAgentPool(poolId: number, properties?: string[]): IPromise; + /** + * @param {string} poolName + * @param {string[]} properties + * @return IPromise + */ + getAgentPools(poolName?: string, properties?: string[]): IPromise; + /** + * @param {Contracts.TaskAgentPool} pool + * @param {number} poolId + * @return IPromise + */ + updateAgentPool(pool: Contracts.TaskAgentPool, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentQueue} queue + * @return IPromise + */ + addAgentQueue(queue: Contracts.TaskAgentQueue): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + deleteAgentQueue(queueId: number): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueue(queueId: number, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * [Preview API] + * + * @param {string} queueName + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueues(queueName?: string, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * [Preview API] Proxy for a GET request defined by an service endpoint. The request is authorized using a data source in service endpoint. The response is filtered using an XPath/Json based selector. + * + * @param {Contracts.DataSourceBinding} binding - Describes the data source to fetch. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @return IPromise + */ + queryServiceEndpoint(binding: Contracts.DataSourceBinding, scopeIdentifier: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ServiceEndpoint} endpoint + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + createServiceEndpoint(endpoint: Contracts.ServiceEndpoint, scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + deleteServiceEndpoint(scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + getServiceEndpointDetails(scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string[]} authSchemes + * @param {string[]} endpointIds + * @return IPromise + */ + getServiceEndpoints(scopeIdentifier: string, type?: string, authSchemes?: string[], endpointIds?: string[]): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string} scheme + * @return IPromise + */ + getServiceEndpointTypes(scopeIdentifier: string, type?: string, scheme?: string): IPromise; + /** + * @param {Contracts.TaskAgentSession} session + * @param {number} poolId + * @return IPromise + */ + createAgentSession(session: Contracts.TaskAgentSession, poolId: number): IPromise; + /** + * @param {number} poolId + * @param {string} sessionId + * @return IPromise + */ + deleteAgentSession(poolId: number, sessionId: string): IPromise; + /** + * @param {{ [key: string] : string; }} userCapabilities + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgentUserCapabilities(userCapabilities: { + [key: string]: string; + }, poolId: number, agentId: number): IPromise; +} +export class TaskAgentHttpClient extends TaskAgentHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return TaskAgentHttpClient2_1 + */ +export function getClient(): TaskAgentHttpClient2_1; +} +declare module "TFS/DistributedTask/TaskRestClient" { +import TFS_DistributedTask_Contracts = require("TFS/DistributedTask/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class TaskHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} type + * @return IPromise + */ + getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string): IPromise; + /** + * [Preview API] + * + * @param {string} content - Content to upload + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name + * @return IPromise + */ + createAttachment(content: string, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name + * @return IPromise + */ + getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name + * @return IPromise + */ + getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @return IPromise + */ + getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} lines + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @return IPromise + */ + appendTimelineRecordFeed(lines: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): IPromise; + /** + * [Preview API] + * + * @param {string} content - Content to upload + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {number} logId + * @return IPromise + */ + appendLogContent(content: string, scopeIdentifier: string, hubName: string, planId: string, logId: number): IPromise; + /** + * [Preview API] + * + * @param {TFS_DistributedTask_Contracts.TaskLog} log + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + createLog(log: TFS_DistributedTask_Contracts.TaskLog, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {number} logId + * @param {number} startLine + * @param {number} endLine + * @return IPromise + */ + getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getLogs(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getPlan(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {number} changeId + * @return IPromise + */ + getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} records + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @return IPromise + */ + updateRecords(records: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_DistributedTask_Contracts.Timeline} timeline + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + createTimeline(timeline: TFS_DistributedTask_Contracts.Timeline, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @return IPromise + */ + deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {number} changeId + * @param {boolean} includeRecords + * @return IPromise + */ + getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getTimelines(scopeIdentifier: string, hubName: string, planId: string): IPromise; +} +export class TaskHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} type + * @return IPromise + */ + getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string): IPromise; + /** + * [Preview API] + * + * @param {string} content - Content to upload + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name + * @return IPromise + */ + createAttachment(content: string, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name + * @return IPromise + */ + getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name + * @return IPromise + */ + getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @return IPromise + */ + getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string): IPromise; + /** + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} lines + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @return IPromise + */ + appendTimelineRecordFeed(lines: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): IPromise; + /** + * @param {string} content - Content to upload + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {number} logId + * @return IPromise + */ + appendLogContent(content: string, scopeIdentifier: string, hubName: string, planId: string, logId: number): IPromise; + /** + * @param {TFS_DistributedTask_Contracts.TaskLog} log + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + createLog(log: TFS_DistributedTask_Contracts.TaskLog, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {number} logId + * @param {number} startLine + * @param {number} endLine + * @return IPromise + */ + getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getLogs(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getPlan(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {number} changeId + * @return IPromise + */ + getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): IPromise; + /** + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} records + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @return IPromise + */ + updateRecords(records: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * @param {TFS_DistributedTask_Contracts.Timeline} timeline + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + createTimeline(timeline: TFS_DistributedTask_Contracts.Timeline, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @return IPromise + */ + deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {number} changeId + * @param {boolean} includeRecords + * @return IPromise + */ + getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getTimelines(scopeIdentifier: string, hubName: string, planId: string): IPromise; +} +export class TaskHttpClient2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} lines + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @return IPromise + */ + appendTimelineRecordFeed(lines: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): IPromise; + /** + * @param {string} content - Content to upload + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {number} logId + * @return IPromise + */ + appendLogContent(content: string, scopeIdentifier: string, hubName: string, planId: string, logId: number): IPromise; + /** + * @param {TFS_DistributedTask_Contracts.TaskLog} log + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + createLog(log: TFS_DistributedTask_Contracts.TaskLog, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {number} logId + * @param {number} startLine + * @param {number} endLine + * @return IPromise + */ + getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getLogs(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getPlan(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {number} changeId + * @return IPromise + */ + getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): IPromise; + /** + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV} records + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @return IPromise + */ + updateRecords(records: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * @param {TFS_DistributedTask_Contracts.Timeline} timeline + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + createTimeline(timeline: TFS_DistributedTask_Contracts.Timeline, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @return IPromise + */ + deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @param {string} timelineId + * @param {number} changeId + * @param {boolean} includeRecords + * @return IPromise + */ + getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): IPromise; + /** + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} planId + * @return IPromise + */ + getTimelines(scopeIdentifier: string, hubName: string, planId: string): IPromise; +} +export class TaskHttpClient extends TaskHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return TaskHttpClient2_1 + */ +export function getClient(): TaskHttpClient2_1; +} +declare module "TFS/TestManagement/Contracts" { +import TFS_Core_Contracts = require("TFS/Core/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +export interface AggregatedResultsAnalysis { + duration: any; + increaseInDuration: any; + increaseInFailures: number; + increaseInPassedTests: number; + increaseInTotalTests: number; + previousBuild: BuildReference; + resultsByOutcome: AggregatedResultsByOutcome[]; + totalTests: number; +} +export interface AggregatedResultsByOutcome { + count: number; + duration: any; + outcome: TestOutcome; +} +export interface AggregatedResultsWithDetails { + groupByField: string; + resultsForGroup: TestResultsDetailsForGroup[]; +} +export enum AttachmentType { + GeneralAttachment = 0, + AfnStrip = 1, + BugFilingData = 2, + CodeCoverage = 3, + IntermediateCollectorData = 4, + RunConfig = 5, + TestImpactDetails = 6, + TmiTestRunDeploymentFiles = 7, + TmiTestRunReverseDeploymentFiles = 8, + TmiTestResultDetail = 9, + TmiTestRunSummary = 10, +} +export interface BatchResponse { + error: string; + responses: Response[]; + status: string; +} +export interface BuildConfiguration { + branchName: string; + buildDefinitionId: number; + flavor: string; + id: number; + number: string; + platform: string; + project: ShallowReference; + repositoryId: number; + sourceVersion: string; + uri: string; +} +export interface BuildCoverage { + codeCoverageFileUrl: string; + configuration: BuildConfiguration; + lastError: string; + modules: ModuleCoverage[]; + state: string; +} +export interface BuildReference { + buildSystem: string; + id: number; + number: string; + uri: string; +} +/** + * Represents the build configuration (platform, flavor) and coverage data for the build + */ +export interface CodeCoverageData { + /** + * Flavor of build for which data is retrieved/published + */ + buildFlavor: string; + /** + * Platform of build for which data is retrieved/published + */ + buildPlatform: string; + /** + * List of coverage data for the build + */ + coverageStats: CodeCoverageStatistics[]; +} +/** + * Represents the code coverage statistics for a particular coverage label (modules, statements, blocks, etc.) + */ +export interface CodeCoverageStatistics { + /** + * Covered units + */ + covered: number; + /** + * Delta of coverage + */ + delta: number; + /** + * Is delta valid + */ + isDeltaAvailable: boolean; + /** + * Label of coverage data ("Blocks", "Statements", "Modules", etc.) + */ + label: string; + /** + * Position of label + */ + position: number; + /** + * Total units + */ + total: number; +} +/** + * Represents the code coverage summary results Used to publish or retrieve code coverage summary against a build + */ +export interface CodeCoverageSummary { + /** + * Uri of build for which data is retrieved/published + */ + build: ShallowReference; + /** + * List of coverage data and details for the build + */ + coverageData: CodeCoverageData[]; + /** + * Uri of build against which difference in coverage is computed + */ + deltaBuild: ShallowReference; +} +export enum CoverageQueryFlags { + /** + * If set, the Coverage.Modules property will be populated. + */ + Modules = 1, + /** + * If set, the ModuleCoverage.Functions properties will be populated. + */ + Functions = 2, + /** + * If set, the ModuleCoverage.CoverageData field will be populated. + */ + BlockData = 4, +} +export interface CoverageStatistics { + blocksCovered: number; + blocksNotCovered: number; + linesCovered: number; + linesNotCovered: number; + linesPartiallyCovered: number; +} +export interface CustomTestField { + fieldName: string; + value: any; +} +export interface CustomTestFieldDefinition { + fieldId: number; + fieldName: string; + fieldType: CustomTestFieldType; + scope: CustomTestFieldScope; +} +export enum CustomTestFieldScope { + None = 0, + TestRun = 1, + TestResult = 2, + System = 4, + All = 7, +} +export enum CustomTestFieldType { + Bit = 2, + Int = 8, + Float = 6, + Guid = 14, + DateTime = 4, + String = 12, +} +/** + * This is a temporary class to provide the details for the test run environment. + */ +export interface DtlEnvironmentDetails { + csmContent: string; + csmParameters: string; + subscriptionName: string; +} +export interface FailingSince { + build: BuildReference; + date: Date; +} +export interface FunctionCoverage { + class: string; + name: string; + namespace: string; + sourceFile: string; + statistics: CoverageStatistics; +} +export enum GroupTestResultsBy { + None = 0, + AutomatedTestStorage = 1, +} +export interface LastResultDetails { + dateCompleted: Date; + duration: number; + runBy: VSS_Common_Contracts.IdentityRef; +} +export interface ModuleCoverage { + blockCount: number; + blockData: number[]; + functions: FunctionCoverage[]; + name: string; + signature: string; + signatureAge: number; + statistics: CoverageStatistics; +} +export interface PlanUpdateModel { + area: ShallowReference; + automatedTestEnvironment: TestEnvironment; + automatedTestSettings: TestSettings; + build: ShallowReference; + configurationIds: number[]; + description: string; + endDate: string; + iteration: string; + manualTestEnvironment: TestEnvironment; + manualTestSettings: TestSettings; + name: string; + owner: VSS_Common_Contracts.IdentityRef; + startDate: string; + state: string; + status: string; +} +export interface PointAssignment { + configuration: ShallowReference; + tester: VSS_Common_Contracts.IdentityRef; +} +export interface PointUpdateModel { +} +export interface PointWorkItemProperty { + workItem: { + key: string; + value: any; + }; +} +export interface QueryModel { + query: string; +} +export interface Response { + error: string; + id: string; + status: string; + url: string; +} +export enum ResultDetails { + None = 0, + Iterations = 1, + WorkItems = 2, +} +export enum ResultOutcome { + Pass = 1, + Fail = 2, + Pending = 3, +} +export interface ResultRetentionSettings { + automatedResultsRetentionDuration: number; + lastUpdatedBy: VSS_Common_Contracts.IdentityRef; + lastUpdatedDate: Date; + manualResultsRetentionDuration: number; +} +export interface ResultUpdateRequestModel { + actionResultDeletes: TestActionResultModel[]; + actionResults: TestActionResultModel[]; + parameterDeletes: TestResultParameterModel[]; + parameters: TestResultParameterModel[]; + testCaseResult: TestCaseResultUpdateModel; +} +export interface ResultUpdateResponseModel { + revision: number; +} +export interface RunCreateModel { + automated: boolean; + build: ShallowReference; + buildDropLocation: string; + buildFlavor: string; + buildPlatform: string; + comment: string; + completeDate: string; + configurationIds: number[]; + controller: string; + customTestFields: CustomTestField[]; + dtlAutEnvironment: ShallowReference; + dtlTestEnvironment: ShallowReference; + dueDate: string; + environmentDetails: DtlEnvironmentDetails; + errorMessage: string; + filter: RunFilter; + iteration: string; + name: string; + owner: VSS_Common_Contracts.IdentityRef; + plan: ShallowReference; + pointIds: number[]; + releaseEnvironmentUri: string; + releaseUri: string; + runTimeout: any; + sourceWorkflow: string; + startDate: string; + state: string; + testConfigurationsMapping: string; + testEnvironmentId: string; + testSettings: ShallowReference; + type: string; +} +/** + * This class is used to provide the filters used for discovery + */ +export interface RunFilter { + /** + * filter for the test case sources (test containers) + */ + sourceFilter: string; + /** + * filter for the test cases + */ + testCaseFilter: string; +} +export interface RunStatistic { + count: number; + outcome: string; + resolutionState: TestResolutionState; + state: string; +} +export interface RunUpdateModel { + build: ShallowReference; + comment: string; + completedDate: string; + controller: string; + deleteInProgressResults: boolean; + dtlAutEnvironment: ShallowReference; + dtlEnvironment: ShallowReference; + dtlEnvironmentDetails: DtlEnvironmentDetails; + dueDate: string; + errorMessage: string; + iteration: string; + logEntries: TestMessageLogDetails[]; + name: string; + startedDate: string; + state: string; + substate: TestRunSubstate; + testEnvironmentId: string; + testSettings: ShallowReference; +} +/** + * An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + */ +export interface ShallowReference { + /** + * Id of the resource + */ + id: string; + /** + * Name of the linked resource (definition name, controller name, etc.) + */ + name: string; + /** + * Full http link to the resource + */ + url: string; +} +export interface SharedStepModel { + id: number; + revision: number; +} +export interface SuiteCreateModel { +} +export interface SuiteTestCase { + pointAssignments: PointAssignment[]; + testCase: WorkItemReference; +} +export interface SuiteUpdateModel { +} +export interface TestActionResultModel extends TestResultModelBase { + actionPath: string; + iterationId: number; + sharedStepModel: SharedStepModel; + url: string; +} +export interface TestAttachmentReference { + id: number; + url: string; +} +export interface TestAttachmentRequestModel { + attachmentType: string; + comment: string; + fileName: string; + stream: string; +} +export interface TestCaseResult { + afnStripId: number; + area: ShallowReference; + associatedBugs: ShallowReference[]; + automatedTestId: string; + automatedTestName: string; + automatedTestStorage: string; + automatedTestType: string; + automatedTestTypeId: string; + build: ShallowReference; + buildReference: BuildReference; + comment: string; + completedDate: Date; + computerName: string; + configuration: ShallowReference; + createdDate: Date; + customFields: CustomTestField[]; + durationInMs: number; + errorMessage: string; + failingSince: FailingSince; + failureType: string; + id: number; + iterationDetails: TestIterationDetailsModel[]; + lastUpdatedBy: VSS_Common_Contracts.IdentityRef; + lastUpdatedDate: Date; + outcome: string; + owner: VSS_Common_Contracts.IdentityRef; + priority: number; + project: ShallowReference; + resetCount: number; + resolutionState: string; + resolutionStateId: number; + revision: number; + runBy: VSS_Common_Contracts.IdentityRef; + stackTrace: string; + startedDate: Date; + state: string; + testCase: ShallowReference; + testCaseTitle: string; + testPoint: ShallowReference; + testRun: ShallowReference; + url: string; +} +export interface TestCaseResult2 { + componentId: string; + custom: any; + endTime: Date; + exceptionStack: string; + externalArtifacts: string[]; + externalRunId: string; + externalSystem: string; + externalTestId: string; + failureReasons: string[]; + failureSummary: string; + investigationNotes: string; + isSuperseded: boolean; + isValid: boolean; + outcome: ResultOutcome; + resultCustomPropertiesTypeName: string; + resultId: string; + resultName: string; + runId: string; + startTime: Date; + testId: string; + tfsSecurityKey: string; +} +export interface TestCaseResultAttachmentModel { + id: number; + iterationId: number; + name: string; + size: number; + url: string; +} +export interface TestCaseResultIdentifier { + testResultId: number; + testRunId: number; +} +export interface TestCaseResultUpdateModel { + associatedWorkItems: number[]; + automatedTestTypeId: string; + comment: string; + completedDate: string; + computerName: string; + customFields: CustomTestField[]; + durationInMs: string; + errorMessage: string; + failureType: string; + outcome: string; + owner: VSS_Common_Contracts.IdentityRef; + resolutionState: string; + runBy: VSS_Common_Contracts.IdentityRef; + stackTrace: string; + startedDate: string; + state: string; + testCasePriority: string; + testResult: ShallowReference; +} +export interface TestEnvironment { + environmentId: string; + environmentName: string; +} +export interface TestFailureDetails { + count: number; + testResults: ShallowReference[]; +} +export interface TestFailuresAnalysis { + existingFailures: TestFailureDetails; + fixedTests: TestFailureDetails; + newFailures: TestFailureDetails; + previousBuild: BuildReference; +} +export interface TestIterationDetailsModel { + actionResults: TestActionResultModel[]; + attachments: TestCaseResultAttachmentModel[]; + comment: string; + completedDate: Date; + durationInMs: number; + errorMessage: string; + id: number; + outcome: string; + parameters: TestResultParameterModel[]; + startedDate: Date; + url: string; +} +/** + * An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + */ +export interface TestMessageLogDetails { + /** + * Date when the resource is created + */ + dateCreated: Date; + /** + * Id of the resource + */ + entryId: number; + /** + * Message of the resource + */ + message: string; +} +export enum TestOutcome { + /** + * Only used during an update to preserve the existing value. + */ + Unspecified = 0, + /** + * Test has not been completed, or the test type does not report pass/failure. + */ + None = 1, + /** + * Test was executed w/o any issues. + */ + Passed = 2, + /** + * Test was executed, but there were issues. Issues may involve exceptions or failed assertions. + */ + Failed = 3, + /** + * Test has completed, but we can't say if it passed or failed. May be used for aborted tests... + */ + Inconclusive = 4, + /** + * The test timed out + */ + Timeout = 5, + /** + * Test was aborted. This was not caused by a user gesture, but rather by a framework decision. + */ + Aborted = 6, + /** + * Test had it chance for been executed but was not, as ITestElement.IsRunnable == false. + */ + Blocked = 7, + /** + * Test was not executed. This was caused by a user gesture - e.g. user hit stop button. + */ + NotExecuted = 8, + /** + * To be used by Run level results. This is not a failure. + */ + Warning = 9, + /** + * There was a system error while we were trying to execute a test. + */ + Error = 10, + /** + * Test is Not Applicable for execution. + */ + NotApplicable = 11, + /** + * Test is paused. + */ + Paused = 12, + /** + * Test is currently executing. Added this for TCM charts + */ + InProgress = 13, + MaxValue = 13, +} +export interface TestPlan { + area: ShallowReference; + automatedTestEnvironment: TestEnvironment; + automatedTestSettings: TestSettings; + build: ShallowReference; + clientUrl: string; + description: string; + endDate: Date; + id: number; + iteration: string; + manualTestEnvironment: TestEnvironment; + manualTestSettings: TestSettings; + name: string; + owner: VSS_Common_Contracts.IdentityRef; + previousBuild: ShallowReference; + project: ShallowReference; + revision: number; + rootSuite: ShallowReference; + startDate: Date; + state: string; + updatedBy: VSS_Common_Contracts.IdentityRef; + updatedDate: Date; + url: string; +} +export interface TestPlansWithSelection { + lastSelectedPlan: number; + lastSelectedSuite: number; + plans: TestPlan[]; +} +export interface TestPoint { + assignedTo: VSS_Common_Contracts.IdentityRef; + automated: boolean; + comment: string; + configuration: ShallowReference; + failureType: string; + id: number; + lastResolutionStateId: number; + lastResult: ShallowReference; + lastResultDetails: LastResultDetails; + lastRunBuildNumber: string; + lastTestRun: ShallowReference; + lastUpdatedBy: VSS_Common_Contracts.IdentityRef; + lastUpdatedDate: Date; + outcome: string; + revision: number; + state: string; + suite: ShallowReference; + testCase: WorkItemReference; + testPlan: ShallowReference; + url: string; + workItemProperties: any[]; +} +export interface TestReport { + aggregatedResultsAnalysis: AggregatedResultsAnalysis; + build: BuildReference; + teamProject: TFS_Core_Contracts.TeamProjectReference; + testFailures: TestFailuresAnalysis; +} +export interface TestResolutionState { + id: number; + name: string; + project: ShallowReference; +} +export interface TestResultCreateModel { + area: ShallowReference; + associatedWorkItems: number[]; + automatedTestId: string; + automatedTestName: string; + automatedTestStorage: string; + automatedTestType: string; + automatedTestTypeId: string; + comment: string; + completedDate: string; + computerName: string; + configuration: ShallowReference; + customFields: CustomTestField[]; + durationInMs: string; + errorMessage: string; + failureType: string; + outcome: string; + owner: VSS_Common_Contracts.IdentityRef; + resolutionState: string; + runBy: VSS_Common_Contracts.IdentityRef; + stackTrace: string; + startedDate: string; + state: string; + testCase: ShallowReference; + testCasePriority: string; + testCaseTitle: string; + testPoint: ShallowReference; +} +export interface TestResultModelBase { + comment: string; + completedDate: Date; + durationInMs: number; + errorMessage: string; + outcome: string; + startedDate: Date; +} +export interface TestResultParameterModel { + actionPath: string; + iterationId: number; + parameterName: string; + url: string; + value: string; +} +export interface TestResultsDetailsForGroup { + groupByValue: string; + results: TestCaseResult[]; + resultsCountByOutcome: AggregatedResultsByOutcome[]; +} +export interface TestRun { + build: ShallowReference; + buildConfiguration: BuildConfiguration; + comment: string; + completedDate: Date; + controller: string; + createdDate: Date; + customFields: CustomTestField[]; + dropLocation: string; + dtlAutEnvironment: ShallowReference; + dtlEnvironment: ShallowReference; + dtlEnvironmentCreationDetails: DtlEnvironmentDetails; + dueDate: Date; + errorMessage: string; + filter: RunFilter; + id: number; + incompleteTests: number; + isAutomated: boolean; + iteration: string; + lastUpdatedBy: VSS_Common_Contracts.IdentityRef; + lastUpdatedDate: Date; + name: string; + notApplicableTests: number; + owner: VSS_Common_Contracts.IdentityRef; + passedTests: number; + phase: string; + plan: ShallowReference; + postProcessState: string; + project: ShallowReference; + releaseEnvironmentUri: string; + releaseUri: string; + revision: number; + runStatistics: RunStatistic[]; + startedDate: Date; + state: string; + substate: TestRunSubstate; + testEnvironment: TestEnvironment; + testMessageLogId: number; + testSettings: ShallowReference; + totalTests: number; + unanalyzedTests: number; + url: string; + webAccessUrl: string; +} +export interface TestRunCoverage { + lastError: string; + modules: ModuleCoverage[]; + state: string; + testRun: ShallowReference; +} +export enum TestRunState { + /** + * Only used during an update to preserve the existing value. + */ + Unspecified = 0, + /** + * The run is still being created. No tests have started yet. + */ + NotStarted = 1, + /** + * Tests are running. + */ + InProgress = 2, + /** + * All tests have completed or been skipped. + */ + Completed = 3, + /** + * Run is stopped and remaing tests have been aborted + */ + Aborted = 4, + /** + * Run is currently initializing This is a legacy state and should not be used any more + */ + Waiting = 5, + /** + * Run requires investigation because of a test point failure This is a legacy state and should not be used any more + */ + NeedsInvestigation = 6, +} +export interface TestRunStatistic { + run: ShallowReference; + runStatistics: RunStatistic[]; +} +export enum TestRunSubstate { + None = 0, + CreatingEnvironment = 1, + RunningTests = 2, + CanceledByUser = 3, + AbortedBySystem = 4, + TimedOut = 5, + PendingAnalysis = 6, + Analyzed = 7, + CancellationInProgress = 8, +} +/** + * Represents the test settings of the run. Used to create test settings and fetch test settings + */ +export interface TestSettings { + /** + * Area path required to create test settings + */ + areaPath: string; + /** + * Description of the test settings. Used in create test settings. + */ + description: string; + /** + * Indicates if the tests settings is public or private.Used in create test settings. + */ + isPublic: boolean; + /** + * Xml string of machine roles. Used in create test settings. + */ + machineRoles: string; + /** + * Test settings content. + */ + testSettingsContent: string; + /** + * Test settings id. + */ + testSettingsId: number; + /** + * Test settings name. + */ + testSettingsName: string; +} +export interface TestSuite { + areaUri: string; + defaultConfigurations: ShallowReference[]; + id: number; + inheritDefaultConfigurations: boolean; + lastError: string; + lastPopulatedDate: Date; + lastUpdatedBy: VSS_Common_Contracts.IdentityRef; + lastUpdatedDate: Date; + name: string; + parent: ShallowReference; + plan: ShallowReference; + project: ShallowReference; + queryString: string; + requirementId: number; + revision: number; + state: string; + suites: ShallowReference[]; + suiteType: string; + testCaseCount: number; + testCasesUrl: string; + url: string; +} +export interface WorkItemReference { + id: string; + name: string; + url: string; + webUrl: string; +} +export var TypeInfo: { + AggregatedResultsAnalysis: { + fields: any; + }; + AggregatedResultsByOutcome: { + fields: any; + }; + AggregatedResultsWithDetails: { + fields: any; + }; + AttachmentType: { + enumValues: { + "generalAttachment": number; + "afnStrip": number; + "bugFilingData": number; + "codeCoverage": number; + "intermediateCollectorData": number; + "runConfig": number; + "testImpactDetails": number; + "tmiTestRunDeploymentFiles": number; + "tmiTestRunReverseDeploymentFiles": number; + "tmiTestResultDetail": number; + "tmiTestRunSummary": number; + }; + }; + BatchResponse: { + fields: any; + }; + BuildConfiguration: { + fields: any; + }; + BuildCoverage: { + fields: any; + }; + BuildReference: { + fields: any; + }; + CodeCoverageData: { + fields: any; + }; + CodeCoverageStatistics: { + fields: any; + }; + CodeCoverageSummary: { + fields: any; + }; + CoverageQueryFlags: { + enumValues: { + "modules": number; + "functions": number; + "blockData": number; + }; + }; + CoverageStatistics: { + fields: any; + }; + CustomTestField: { + fields: any; + }; + CustomTestFieldDefinition: { + fields: any; + }; + CustomTestFieldScope: { + enumValues: { + "none": number; + "testRun": number; + "testResult": number; + "system": number; + "all": number; + }; + }; + CustomTestFieldType: { + enumValues: { + "bit": number; + "int": number; + "float": number; + "guid": number; + "dateTime": number; + "string": number; + }; + }; + DtlEnvironmentDetails: { + fields: any; + }; + FailingSince: { + fields: any; + }; + FunctionCoverage: { + fields: any; + }; + GroupTestResultsBy: { + enumValues: { + "none": number; + "automatedTestStorage": number; + }; + }; + LastResultDetails: { + fields: any; + }; + ModuleCoverage: { + fields: any; + }; + PlanUpdateModel: { + fields: any; + }; + PointAssignment: { + fields: any; + }; + PointUpdateModel: { + fields: any; + }; + PointWorkItemProperty: { + fields: any; + }; + QueryModel: { + fields: any; + }; + Response: { + fields: any; + }; + ResultDetails: { + enumValues: { + "none": number; + "iterations": number; + "workItems": number; + }; + }; + ResultOutcome: { + enumValues: { + "pass": number; + "fail": number; + "pending": number; + }; + }; + ResultRetentionSettings: { + fields: any; + }; + ResultUpdateRequestModel: { + fields: any; + }; + ResultUpdateResponseModel: { + fields: any; + }; + RunCreateModel: { + fields: any; + }; + RunFilter: { + fields: any; + }; + RunStatistic: { + fields: any; + }; + RunUpdateModel: { + fields: any; + }; + ShallowReference: { + fields: any; + }; + SharedStepModel: { + fields: any; + }; + SuiteCreateModel: { + fields: any; + }; + SuiteTestCase: { + fields: any; + }; + SuiteUpdateModel: { + fields: any; + }; + TestActionResultModel: { + fields: any; + }; + TestAttachmentReference: { + fields: any; + }; + TestAttachmentRequestModel: { + fields: any; + }; + TestCaseResult: { + fields: any; + }; + TestCaseResult2: { + fields: any; + }; + TestCaseResultAttachmentModel: { + fields: any; + }; + TestCaseResultIdentifier: { + fields: any; + }; + TestCaseResultUpdateModel: { + fields: any; + }; + TestEnvironment: { + fields: any; + }; + TestFailureDetails: { + fields: any; + }; + TestFailuresAnalysis: { + fields: any; + }; + TestIterationDetailsModel: { + fields: any; + }; + TestMessageLogDetails: { + fields: any; + }; + TestOutcome: { + enumValues: { + "unspecified": number; + "none": number; + "passed": number; + "failed": number; + "inconclusive": number; + "timeout": number; + "aborted": number; + "blocked": number; + "notExecuted": number; + "warning": number; + "error": number; + "notApplicable": number; + "paused": number; + "inProgress": number; + "maxValue": number; + }; + }; + TestPlan: { + fields: any; + }; + TestPlansWithSelection: { + fields: any; + }; + TestPoint: { + fields: any; + }; + TestReport: { + fields: any; + }; + TestResolutionState: { + fields: any; + }; + TestResultCreateModel: { + fields: any; + }; + TestResultModelBase: { + fields: any; + }; + TestResultParameterModel: { + fields: any; + }; + TestResultsDetailsForGroup: { + fields: any; + }; + TestRun: { + fields: any; + }; + TestRunCoverage: { + fields: any; + }; + TestRunState: { + enumValues: { + "unspecified": number; + "notStarted": number; + "inProgress": number; + "completed": number; + "aborted": number; + "waiting": number; + "needsInvestigation": number; + }; + }; + TestRunStatistic: { + fields: any; + }; + TestRunSubstate: { + enumValues: { + "none": number; + "creatingEnvironment": number; + "runningTests": number; + "canceledByUser": number; + "abortedBySystem": number; + "timedOut": number; + "pendingAnalysis": number; + "analyzed": number; + "cancellationInProgress": number; + }; + }; + TestSettings: { + fields: any; + }; + TestSuite: { + fields: any; + }; + WorkItemReference: { + fields: any; + }; +}; +} +declare module "TFS/TestManagement/RestClient" { +import Contracts = require("TFS/TestManagement/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @return IPromise + */ + createTestResultAttachment(attachmentRequestModel: Contracts.TestAttachmentRequestModel, project: string, runId: number, testCaseResultId: number): IPromise; + /** + * [Preview API] Returns a test result attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @return IPromise + */ + getTestResultAttachmentContent(project: string, runId: number, testCaseResultId: number, attachmentId: number): IPromise; + /** + * [Preview API] Returns a test result attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @return IPromise + */ + getTestResultAttachmentZip(project: string, runId: number, testCaseResultId: number, attachmentId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + createTestRunAttachment(attachmentRequestModel: Contracts.TestAttachmentRequestModel, project: string, runId: number): IPromise; + /** + * [Preview API] Returns a test run attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} attachmentId + * @return IPromise + */ + getTestRunAttachmentContent(project: string, runId: number, attachmentId: number): IPromise; + /** + * [Preview API] Returns a test run attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} attachmentId + * @return IPromise + */ + getTestRunAttachmentZip(project: string, runId: number, attachmentId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} flags + * @return IPromise + */ + getBuildCodeCoverage(project: string, buildId: number, flags: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} deltaBuildId + * @return IPromise + */ + getCodeCoverageSummary(project: string, buildId: number, deltaBuildId?: number): IPromise; + /** + * [Preview API] http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary + * + * @param {Contracts.CodeCoverageData} coverageData + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + updateCodeCoverageSummary(coverageData: Contracts.CodeCoverageData, project: string, buildId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} flags + * @return IPromise + */ + getTestRunCodeCoverage(project: string, runId: number, flags: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.CustomTestFieldDefinition[]} newFields + * @param {string} project - Project ID or project name + * @return IPromise + */ + addCustomFields(newFields: Contracts.CustomTestFieldDefinition[], project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {Contracts.CustomTestFieldScope} scopeFilter + * @return IPromise + */ + queryCustomFields(project: string, scopeFilter: Contracts.CustomTestFieldScope): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunLogs(project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.PlanUpdateModel} testPlan + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestPlan(testPlan: Contracts.PlanUpdateModel, project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @return IPromise + */ + getPlanById(project: string, planId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} owner + * @param {number} skip + * @param {number} top + * @param {boolean} includePlanDetails + * @param {boolean} filterActivePlans + * @return IPromise + */ + getPlans(project: string, owner?: string, skip?: number, top?: number, includePlanDetails?: boolean, filterActivePlans?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.PlanUpdateModel} planUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @return IPromise + */ + updateTestPlan(planUpdateModel: Contracts.PlanUpdateModel, project: string, planId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {number} pointIds + * @param {string} witFields + * @return IPromise + */ + getPoint(project: string, planId: number, suiteId: number, pointIds: number, witFields?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} witFields + * @param {string} configurationId + * @param {string} testCaseId + * @param {string} testPointIds + * @param {boolean} includePointDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPoints(project: string, planId: number, suiteId: number, witFields?: string, configurationId?: string, testCaseId?: string, testPointIds?: string, includePointDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.PointUpdateModel} pointUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} pointIds + * @return IPromise + */ + updateTestPoints(pointUpdateModel: Contracts.PointUpdateModel, project: string, planId: number, suiteId: number, pointIds: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @param {number} testResultId + * @param {number} recentDays + * @return IPromise + */ + queryTestResultRecentBugs(project: string, testRunId: number, testResultId: number, recentDays?: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} sourceWorkflow + * @param {boolean} includeFailureDetails + * @param {Contracts.BuildReference} buildToCompare + * @return IPromise + */ + queryReportForBuild(project: string, buildId: number, sourceWorkflow: string, includeFailureDetails: boolean, buildToCompare: Contracts.BuildReference): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} sourceWorkflow + * @param {string} groupBy + * @param {string} filter + * @return IPromise + */ + getTestResultDetailsForBuild(project: string, buildId: number, sourceWorkflow: string, groupBy?: string, filter?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ResultRetentionSettings} retentionSettings + * @param {string} project - Project ID or project name + * @return IPromise + */ + createResultRetentionSettings(retentionSettings: Contracts.ResultRetentionSettings, project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteResultRetentionSettings(project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getResultRetentionSettings(project: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ResultRetentionSettings} retentionSettings + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateResultRetentionSettings(retentionSettings: Contracts.ResultRetentionSettings, project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {boolean} includeActionResults + * @return IPromise + */ + getTestIteration(project: string, runId: number, testCaseResultId: number, iterationId: number, includeActionResults?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {boolean} includeActionResults + * @return IPromise + */ + getTestIterations(project: string, runId: number, testCaseResultId: number, includeActionResults?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestResultCreateModel[]} resultCreateModels + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + addTestResultsToTestRun(resultCreateModels: Contracts.TestResultCreateModel[], project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestCaseResultUpdateModel} resultUpdateModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number[]} resultIds + * @return IPromise + */ + bulkUpdateTestResults(resultUpdateModel: Contracts.TestCaseResultUpdateModel, project: string, runId: number, resultIds: number[]): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {boolean} includeIterationDetails + * @return IPromise + */ + getTestCaseResultById(project: string, runId: number, testCaseResultId: number, includeIterationDetails: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {boolean} includeIterationDetails + * @return IPromise + */ + getTestCaseResults(project: string, runId: number, includeIterationDetails: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {Contracts.ResultDetails} detailsToInclude + * @return IPromise + */ + getTestResultById(project: string, runId: number, testCaseResultId: number, detailsToInclude?: Contracts.ResultDetails): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {Contracts.ResultDetails} detailsToInclude + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestResults(project: string, runId: number, detailsToInclude?: Contracts.ResultDetails, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestCaseResultUpdateModel[]} resultUpdateModels + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + updateTestResults(resultUpdateModels: Contracts.TestCaseResultUpdateModel[], project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {string} actionPath + * @return IPromise + */ + getActionResults(project: string, runId: number, testCaseResultId: number, iterationId: number, actionPath?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {string} paramName + * @return IPromise + */ + getResultParameters(project: string, runId: number, testCaseResultId: number, iterationId: number, paramName?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.QueryModel} query + * @param {string} project - Project ID or project name + * @param {boolean} includeResultDetails + * @param {boolean} includeIterationDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestResultsByQuery(query: Contracts.QueryModel, project: string, includeResultDetails?: boolean, includeIterationDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @param {number} testResultId + * @param {number} historyDays + * @param {number} top + * @return IPromise + */ + queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunStatistics(project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.QueryModel} query + * @param {string} project - Project ID or project name + * @param {boolean} includeRunDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestRunsByQuery(query: Contracts.QueryModel, project: string, includeRunDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.RunCreateModel} testRun + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestRun(testRun: Contracts.RunCreateModel, project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + deleteTestRun(project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunById(project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} buildUri + * @param {string} owner + * @param {string} tmiRunId + * @param {number} planId + * @param {boolean} includeRunDetails + * @param {boolean} automated + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestRuns(project: string, buildUri?: string, owner?: string, tmiRunId?: string, planId?: number, includeRunDetails?: boolean, automated?: boolean, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.RunUpdateModel} runUpdateModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + updateTestRun(runUpdateModel: Contracts.RunUpdateModel, project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} testCaseIds + * @return IPromise + */ + addTestCasesToSuite(project: string, planId: number, suiteId: number, testCaseIds: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {number} testCaseIds + * @return IPromise + */ + getTestCaseById(project: string, planId: number, suiteId: number, testCaseIds: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + getTestCases(project: string, planId: number, suiteId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} testCaseIds + * @return IPromise + */ + removeTestCasesFromSuiteUrl(project: string, planId: number, suiteId: number, testCaseIds: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.SuiteCreateModel} testSuite + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + createTestSuite(testSuite: Contracts.SuiteCreateModel, project: string, planId: number, suiteId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + deleteTestSuite(project: string, planId: number, suiteId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {boolean} includeChildSuites + * @return IPromise + */ + getTestSuiteById(project: string, planId: number, suiteId: number, includeChildSuites?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {boolean} includeSuites + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestSuitesForPlan(project: string, planId: number, includeSuites?: boolean, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.SuiteUpdateModel} suiteUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + updateTestSuite(suiteUpdateModel: Contracts.SuiteUpdateModel, project: string, planId: number, suiteId: number): IPromise; + /** + * [Preview API] + * + * @param {number} testCaseId + * @return IPromise + */ + getSuitesByTestCaseId(testCaseId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.BuildReference} build + * @param {string} project - Project ID or project name + * @param {string} sourceWorkflow + * @param {Contracts.BuildReference} buildToCompare + * @return IPromise + */ + queryFailureDetailsForBuild(build: Contracts.BuildReference, project: string, sourceWorkflow: string, buildToCompare: Contracts.BuildReference): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @return IPromise + */ + queryFailureDetailsForTestRun(project: string, testRunId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestSettings} testSettings + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestSettings(testSettings: Contracts.TestSettings, project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testSettingsId + * @return IPromise + */ + deleteTestSettings(project: string, testSettingsId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testSettingsId + * @return IPromise + */ + getTestSettingsById(project: string, testSettingsId: number): IPromise; +} +export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @return IPromise + */ + createTestResultAttachment(attachmentRequestModel: Contracts.TestAttachmentRequestModel, project: string, runId: number, testCaseResultId: number): IPromise; + /** + * [Preview API] Returns a test result attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @return IPromise + */ + getTestResultAttachmentContent(project: string, runId: number, testCaseResultId: number, attachmentId: number): IPromise; + /** + * [Preview API] Returns a test result attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @return IPromise + */ + getTestResultAttachmentZip(project: string, runId: number, testCaseResultId: number, attachmentId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + createTestRunAttachment(attachmentRequestModel: Contracts.TestAttachmentRequestModel, project: string, runId: number): IPromise; + /** + * [Preview API] Returns a test run attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} attachmentId + * @return IPromise + */ + getTestRunAttachmentContent(project: string, runId: number, attachmentId: number): IPromise; + /** + * [Preview API] Returns a test run attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} attachmentId + * @return IPromise + */ + getTestRunAttachmentZip(project: string, runId: number, attachmentId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} flags + * @return IPromise + */ + getBuildCodeCoverage(project: string, buildId: number, flags: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} deltaBuildId + * @return IPromise + */ + getCodeCoverageSummary(project: string, buildId: number, deltaBuildId?: number): IPromise; + /** + * [Preview API] http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary + * + * @param {Contracts.CodeCoverageData} coverageData + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + updateCodeCoverageSummary(coverageData: Contracts.CodeCoverageData, project: string, buildId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} flags + * @return IPromise + */ + getTestRunCodeCoverage(project: string, runId: number, flags: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.CustomTestFieldDefinition[]} newFields + * @param {string} project - Project ID or project name + * @return IPromise + */ + addCustomFields(newFields: Contracts.CustomTestFieldDefinition[], project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {Contracts.CustomTestFieldScope} scopeFilter + * @return IPromise + */ + queryCustomFields(project: string, scopeFilter: Contracts.CustomTestFieldScope): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunLogs(project: string, runId: number): IPromise; + /** + * @param {Contracts.PlanUpdateModel} testPlan + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestPlan(testPlan: Contracts.PlanUpdateModel, project: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @return IPromise + */ + getPlanById(project: string, planId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {string} owner + * @param {number} skip + * @param {number} top + * @param {boolean} includePlanDetails + * @param {boolean} filterActivePlans + * @return IPromise + */ + getPlans(project: string, owner?: string, skip?: number, top?: number, includePlanDetails?: boolean, filterActivePlans?: boolean): IPromise; + /** + * @param {Contracts.PlanUpdateModel} planUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @return IPromise + */ + updateTestPlan(planUpdateModel: Contracts.PlanUpdateModel, project: string, planId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {number} pointIds + * @param {string} witFields + * @return IPromise + */ + getPoint(project: string, planId: number, suiteId: number, pointIds: number, witFields?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} witFields + * @param {string} configurationId + * @param {string} testCaseId + * @param {string} testPointIds + * @param {boolean} includePointDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPoints(project: string, planId: number, suiteId: number, witFields?: string, configurationId?: string, testCaseId?: string, testPointIds?: string, includePointDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {Contracts.PointUpdateModel} pointUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} pointIds + * @return IPromise + */ + updateTestPoints(pointUpdateModel: Contracts.PointUpdateModel, project: string, planId: number, suiteId: number, pointIds: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @param {number} testResultId + * @param {number} recentDays + * @return IPromise + */ + queryTestResultRecentBugs(project: string, testRunId: number, testResultId: number, recentDays?: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} sourceWorkflow + * @param {boolean} includeFailureDetails + * @param {Contracts.BuildReference} buildToCompare + * @return IPromise + */ + queryReportForBuild(project: string, buildId: number, sourceWorkflow: string, includeFailureDetails: boolean, buildToCompare: Contracts.BuildReference): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ResultRetentionSettings} retentionSettings + * @param {string} project - Project ID or project name + * @return IPromise + */ + createResultRetentionSettings(retentionSettings: Contracts.ResultRetentionSettings, project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteResultRetentionSettings(project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getResultRetentionSettings(project: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ResultRetentionSettings} retentionSettings + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateResultRetentionSettings(retentionSettings: Contracts.ResultRetentionSettings, project: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestResultCreateModel[]} resultCreateModels + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + addTestResultsToTestRun(resultCreateModels: Contracts.TestResultCreateModel[], project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestCaseResultUpdateModel} resultUpdateModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number[]} resultIds + * @return IPromise + */ + bulkUpdateTestResults(resultUpdateModel: Contracts.TestCaseResultUpdateModel, project: string, runId: number, resultIds: number[]): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {boolean} includeIterationDetails + * @return IPromise + */ + getTestCaseResultById(project: string, runId: number, testCaseResultId: number, includeIterationDetails: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {boolean} includeIterationDetails + * @return IPromise + */ + getTestCaseResults(project: string, runId: number, includeIterationDetails: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {Contracts.ResultDetails} detailsToInclude + * @return IPromise + */ + getTestResultById(project: string, runId: number, testCaseResultId: number, detailsToInclude?: Contracts.ResultDetails): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {Contracts.ResultDetails} detailsToInclude + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestResults(project: string, runId: number, detailsToInclude?: Contracts.ResultDetails, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestCaseResultUpdateModel[]} resultUpdateModels + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + updateTestResults(resultUpdateModels: Contracts.TestCaseResultUpdateModel[], project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.QueryModel} query + * @param {string} project - Project ID or project name + * @param {boolean} includeResultDetails + * @param {boolean} includeIterationDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestResultsByQuery(query: Contracts.QueryModel, project: string, includeResultDetails?: boolean, includeIterationDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {boolean} includeActionResults + * @return IPromise + */ + getTestIteration(project: string, runId: number, testCaseResultId: number, iterationId: number, includeActionResults?: boolean): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {boolean} includeActionResults + * @return IPromise + */ + getTestIterations(project: string, runId: number, testCaseResultId: number, includeActionResults?: boolean): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {string} actionPath + * @return IPromise + */ + getActionResults(project: string, runId: number, testCaseResultId: number, iterationId: number, actionPath?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {string} paramName + * @return IPromise + */ + getResultParameters(project: string, runId: number, testCaseResultId: number, iterationId: number, paramName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @param {number} testResultId + * @param {number} historyDays + * @param {number} top + * @return IPromise + */ + queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays?: number, top?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunStatistics(project: string, runId: number): IPromise; + /** + * @param {Contracts.RunCreateModel} testRun + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestRun(testRun: Contracts.RunCreateModel, project: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + deleteTestRun(project: string, runId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunById(project: string, runId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {string} buildUri + * @param {string} owner + * @param {string} tmiRunId + * @param {number} planId + * @param {boolean} includeRunDetails + * @param {boolean} automated + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestRuns(project: string, buildUri?: string, owner?: string, tmiRunId?: string, planId?: number, includeRunDetails?: boolean, automated?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {Contracts.RunUpdateModel} runUpdateModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + updateTestRun(runUpdateModel: Contracts.RunUpdateModel, project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.QueryModel} query + * @param {string} project - Project ID or project name + * @param {boolean} includeRunDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestRunsByQuery(query: Contracts.QueryModel, project: string, includeRunDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} testCaseIds + * @return IPromise + */ + addTestCasesToSuite(project: string, planId: number, suiteId: number, testCaseIds: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {number} testCaseIds + * @return IPromise + */ + getTestCaseById(project: string, planId: number, suiteId: number, testCaseIds: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + getTestCases(project: string, planId: number, suiteId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} testCaseIds + * @return IPromise + */ + removeTestCasesFromSuiteUrl(project: string, planId: number, suiteId: number, testCaseIds: string): IPromise; + /** + * @param {Contracts.SuiteCreateModel} testSuite + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + createTestSuite(testSuite: Contracts.SuiteCreateModel, project: string, planId: number, suiteId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + deleteTestSuite(project: string, planId: number, suiteId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {boolean} includeChildSuites + * @return IPromise + */ + getTestSuiteById(project: string, planId: number, suiteId: number, includeChildSuites?: boolean): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {boolean} includeSuites + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestSuitesForPlan(project: string, planId: number, includeSuites?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {Contracts.SuiteUpdateModel} suiteUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + updateTestSuite(suiteUpdateModel: Contracts.SuiteUpdateModel, project: string, planId: number, suiteId: number): IPromise; + /** + * @param {number} testCaseId + * @return IPromise + */ + getSuitesByTestCaseId(testCaseId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.BuildReference} build + * @param {string} project - Project ID or project name + * @param {string} sourceWorkflow + * @param {Contracts.BuildReference} buildToCompare + * @return IPromise + */ + queryFailureDetailsForBuild(build: Contracts.BuildReference, project: string, sourceWorkflow: string, buildToCompare: Contracts.BuildReference): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @return IPromise + */ + queryFailureDetailsForTestRun(project: string, testRunId: number): IPromise; + /** + * @param {Contracts.TestSettings} testSettings + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestSettings(testSettings: Contracts.TestSettings, project: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} testSettingsId + * @return IPromise + */ + deleteTestSettings(project: string, testSettingsId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} testSettingsId + * @return IPromise + */ + getTestSettingsById(project: string, testSettingsId: number): IPromise; +} +export class TestHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @return IPromise + */ + createTestResultAttachment(attachmentRequestModel: Contracts.TestAttachmentRequestModel, project: string, runId: number, testCaseResultId: number): IPromise; + /** + * [Preview API] Returns a test result attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @return IPromise + */ + getTestResultAttachmentContent(project: string, runId: number, testCaseResultId: number, attachmentId: number): IPromise; + /** + * [Preview API] Returns a test result attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @return IPromise + */ + getTestResultAttachmentZip(project: string, runId: number, testCaseResultId: number, attachmentId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + createTestRunAttachment(attachmentRequestModel: Contracts.TestAttachmentRequestModel, project: string, runId: number): IPromise; + /** + * [Preview API] Returns a test run attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} attachmentId + * @return IPromise + */ + getTestRunAttachmentContent(project: string, runId: number, attachmentId: number): IPromise; + /** + * [Preview API] Returns a test run attachment + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} attachmentId + * @return IPromise + */ + getTestRunAttachmentZip(project: string, runId: number, attachmentId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} flags + * @return IPromise + */ + getBuildCodeCoverage(project: string, buildId: number, flags: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} deltaBuildId + * @return IPromise + */ + getCodeCoverageSummary(project: string, buildId: number, deltaBuildId?: number): IPromise; + /** + * [Preview API] http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary + * + * @param {Contracts.CodeCoverageData} coverageData + * @param {string} project - Project ID or project name + * @param {number} buildId + * @return IPromise + */ + updateCodeCoverageSummary(coverageData: Contracts.CodeCoverageData, project: string, buildId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} flags + * @return IPromise + */ + getTestRunCodeCoverage(project: string, runId: number, flags: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.CustomTestFieldDefinition[]} newFields + * @param {string} project - Project ID or project name + * @return IPromise + */ + addCustomFields(newFields: Contracts.CustomTestFieldDefinition[], project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {Contracts.CustomTestFieldScope} scopeFilter + * @return IPromise + */ + queryCustomFields(project: string, scopeFilter: Contracts.CustomTestFieldScope): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunLogs(project: string, runId: number): IPromise; + /** + * @param {Contracts.PlanUpdateModel} testPlan + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestPlan(testPlan: Contracts.PlanUpdateModel, project: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @return IPromise + */ + getPlanById(project: string, planId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {string} owner + * @param {number} skip + * @param {number} top + * @param {boolean} includePlanDetails + * @param {boolean} filterActivePlans + * @return IPromise + */ + getPlans(project: string, owner?: string, skip?: number, top?: number, includePlanDetails?: boolean, filterActivePlans?: boolean): IPromise; + /** + * @param {Contracts.PlanUpdateModel} planUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @return IPromise + */ + updateTestPlan(planUpdateModel: Contracts.PlanUpdateModel, project: string, planId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {number} pointIds + * @param {string} witFields + * @return IPromise + */ + getPoint(project: string, planId: number, suiteId: number, pointIds: number, witFields?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} witFields + * @param {string} configurationId + * @param {string} testCaseId + * @param {string} testPointIds + * @param {boolean} includePointDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPoints(project: string, planId: number, suiteId: number, witFields?: string, configurationId?: string, testCaseId?: string, testPointIds?: string, includePointDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {Contracts.PointUpdateModel} pointUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} pointIds + * @return IPromise + */ + updateTestPoints(pointUpdateModel: Contracts.PointUpdateModel, project: string, planId: number, suiteId: number, pointIds: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @param {number} testResultId + * @param {number} recentDays + * @return IPromise + */ + queryTestResultRecentBugs(project: string, testRunId: number, testResultId: number, recentDays?: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} sourceWorkflow + * @param {boolean} includeFailureDetails + * @param {Contracts.BuildReference} buildToCompare + * @return IPromise + */ + queryReportForBuild(project: string, buildId: number, sourceWorkflow: string, includeFailureDetails: boolean, buildToCompare: Contracts.BuildReference): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestResultCreateModel[]} resultCreateModels + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + addTestResultsToTestRun(resultCreateModels: Contracts.TestResultCreateModel[], project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestCaseResultUpdateModel} resultUpdateModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number[]} resultIds + * @return IPromise + */ + bulkUpdateTestResults(resultUpdateModel: Contracts.TestCaseResultUpdateModel, project: string, runId: number, resultIds: number[]): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {boolean} includeIterationDetails + * @return IPromise + */ + getTestCaseResultById(project: string, runId: number, testCaseResultId: number, includeIterationDetails: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {boolean} includeIterationDetails + * @return IPromise + */ + getTestCaseResults(project: string, runId: number, includeIterationDetails: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {Contracts.ResultDetails} detailsToInclude + * @return IPromise + */ + getTestResultById(project: string, runId: number, testCaseResultId: number, detailsToInclude?: Contracts.ResultDetails): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {Contracts.ResultDetails} detailsToInclude + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestResults(project: string, runId: number, detailsToInclude?: Contracts.ResultDetails, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestCaseResultUpdateModel[]} resultUpdateModels + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + updateTestResults(resultUpdateModels: Contracts.TestCaseResultUpdateModel[], project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.QueryModel} query + * @param {string} project - Project ID or project name + * @param {boolean} includeResultDetails + * @param {boolean} includeIterationDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestResultsByQuery(query: Contracts.QueryModel, project: string, includeResultDetails?: boolean, includeIterationDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {boolean} includeActionResults + * @return IPromise + */ + getTestIteration(project: string, runId: number, testCaseResultId: number, iterationId: number, includeActionResults?: boolean): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {boolean} includeActionResults + * @return IPromise + */ + getTestIterations(project: string, runId: number, testCaseResultId: number, includeActionResults?: boolean): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {string} actionPath + * @return IPromise + */ + getActionResults(project: string, runId: number, testCaseResultId: number, iterationId: number, actionPath?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {string} paramName + * @return IPromise + */ + getResultParameters(project: string, runId: number, testCaseResultId: number, iterationId: number, paramName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @param {number} testResultId + * @param {number} historyDays + * @param {number} top + * @return IPromise + */ + queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays?: number, top?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunStatistics(project: string, runId: number): IPromise; + /** + * @param {Contracts.RunCreateModel} testRun + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestRun(testRun: Contracts.RunCreateModel, project: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + deleteTestRun(project: string, runId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + getTestRunById(project: string, runId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {string} buildUri + * @param {string} owner + * @param {string} tmiRunId + * @param {number} planId + * @param {boolean} includeRunDetails + * @param {boolean} automated + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestRuns(project: string, buildUri?: string, owner?: string, tmiRunId?: string, planId?: number, includeRunDetails?: boolean, automated?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {Contracts.RunUpdateModel} runUpdateModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @return IPromise + */ + updateTestRun(runUpdateModel: Contracts.RunUpdateModel, project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.QueryModel} query + * @param {string} project - Project ID or project name + * @param {boolean} includeRunDetails + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestRunsByQuery(query: Contracts.QueryModel, project: string, includeRunDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} testCaseIds + * @return IPromise + */ + addTestCasesToSuite(project: string, planId: number, suiteId: number, testCaseIds: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {number} testCaseIds + * @return IPromise + */ + getTestCaseById(project: string, planId: number, suiteId: number, testCaseIds: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + getTestCases(project: string, planId: number, suiteId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {string} testCaseIds + * @return IPromise + */ + removeTestCasesFromSuiteUrl(project: string, planId: number, suiteId: number, testCaseIds: string): IPromise; + /** + * @param {Contracts.SuiteCreateModel} testSuite + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + createTestSuite(testSuite: Contracts.SuiteCreateModel, project: string, planId: number, suiteId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + deleteTestSuite(project: string, planId: number, suiteId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @param {boolean} includeChildSuites + * @return IPromise + */ + getTestSuiteById(project: string, planId: number, suiteId: number, includeChildSuites?: boolean): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {boolean} includeSuites + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestSuitesForPlan(project: string, planId: number, includeSuites?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {Contracts.SuiteUpdateModel} suiteUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + updateTestSuite(suiteUpdateModel: Contracts.SuiteUpdateModel, project: string, planId: number, suiteId: number): IPromise; + /** + * @param {number} testCaseId + * @return IPromise + */ + getSuitesByTestCaseId(testCaseId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.BuildReference} build + * @param {string} project - Project ID or project name + * @param {string} sourceWorkflow + * @param {Contracts.BuildReference} buildToCompare + * @return IPromise + */ + queryFailureDetailsForBuild(build: Contracts.BuildReference, project: string, sourceWorkflow: string, buildToCompare: Contracts.BuildReference): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testRunId + * @return IPromise + */ + queryFailureDetailsForTestRun(project: string, testRunId: number): IPromise; + /** + * @param {Contracts.TestSettings} testSettings + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestSettings(testSettings: Contracts.TestSettings, project: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} testSettingsId + * @return IPromise + */ + deleteTestSettings(project: string, testSettingsId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} testSettingsId + * @return IPromise + */ + getTestSettingsById(project: string, testSettingsId: number): IPromise; +} +export class TestHttpClient extends TestHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return TestHttpClient2_1 + */ +export function getClient(): TestHttpClient2_1; +} +declare module "TFS/VersionControl/Contracts" { +import TFS_Core_Contracts = require("TFS/Core/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +export interface AssociatedWorkItem { + assignedTo: string; + id: number; + state: string; + title: string; + /** + * REST url + */ + url: string; + webUrl: string; + workItemType: string; +} +export interface Change { + changeType: VersionControlChangeType; + item: T; + newContent: ItemContent; + sourceServerItem: string; + url: string; +} +export interface ChangeCountDictionary { +} +export interface ChangeList { + allChangesIncluded: boolean; + changeCounts: { + [key: number]: number; + }; + changes: Change[]; + comment: string; + commentTruncated: boolean; + creationDate: Date; + notes: CheckinNote[]; + owner: string; + ownerDisplayName: string; + ownerId: string; + sortDate: Date; + version: string; +} +/** + * Criteria used in a search for change lists + */ +export interface ChangeListSearchCriteria { + /** + * If provided, a version descriptor to compare against base + */ + compareVersion: string; + /** + * If true, don't include delete history entries + */ + excludeDeletes: boolean; + /** + * Whether or not to follow renames for the given item being queried + */ + followRenames: boolean; + /** + * If provided, only include history entries created after this date (string) + */ + fromDate: string; + /** + * If provided, a version descriptor for the earliest change list to include + */ + fromVersion: string; + /** + * Path of item to search under + */ + itemPath: string; + /** + * Version of the items to search + */ + itemVersion: string; + /** + * Number of results to skip (used when clicking more...) + */ + skip: number; + /** + * If provided, only include history entries created before this date (string) + */ + toDate: string; + /** + * If provided, the maximum number of history entries to return + */ + top: number; + /** + * If provided, a version descriptor for the latest change list to include + */ + toVersion: string; + /** + * Alias or display name of user who made the changes + */ + user: string; +} +export interface CheckinNote { + name: string; + value: string; +} +export interface FileContentMetadata { + contentType: string; + encoding: number; + extension: string; + fileName: string; + isBinary: boolean; + isImage: boolean; + vsLink: string; +} +export interface GitBaseVersionDescriptor extends GitVersionDescriptor { + /** + * Version string identifier (name of tag/branch, SHA1 of commit) + */ + baseVersion: string; + /** + * Version options - Specify additional modifiers to version (e.g Previous) + */ + baseVersionOptions: GitVersionOptions; + /** + * Version type (branch, tag, or commit). Determines how Id is interpreted + */ + baseVersionType: GitVersionType; +} +export interface GitBlobRef { + _links: any; + /** + * SHA1 hash of git object + */ + objectId: string; + /** + * Size of blob content (in bytes) + */ + size: number; + url: string; +} +export interface GitBranchStats { + aheadCount: number; + behindCount: number; + commit: GitCommitRef; + isBaseVersion: boolean; + name: string; +} +export interface GitChange extends Change { +} +export interface GitCommit extends GitCommitRef { + push: GitPushRef; + treeId: string; +} +export interface GitCommitChanges { + changeCounts: ChangeCountDictionary; + changes: GitChange[]; +} +export interface GitCommitDiffs { + aheadCount: number; + allChangesIncluded: boolean; + baseCommit: string; + behindCount: number; + changeCounts: { + [key: number]: number; + }; + changes: GitChange[]; + commonCommit: string; + targetCommit: string; +} +export interface GitCommitRef { + _links: any; + author: GitUserDate; + changeCounts: ChangeCountDictionary; + changes: GitChange[]; + comment: string; + commentTruncated: boolean; + commitId: string; + committer: GitUserDate; + parents: string[]; + remoteUrl: string; + url: string; +} +export interface GitCommitToCreate { + baseRef: GitRef; + comment: string; + pathActions: GitPathAction[]; +} +export interface GitHistoryQueryResults extends HistoryQueryResults { + /** + * Seed commit used for querying history. Used for skip feature. + */ + startingCommitId: string; + unpopulatedCount: number; + unprocessedCount: number; +} +export interface GitItem extends ItemModel { + /** + * SHA1 of commit item was fetched at + */ + commitId: string; + /** + * Type of object (Commit, Tree, Blob, Tag, ...) + */ + gitObjectType: GitObjectType; + /** + * Shallow ref to commit that last changed this item Only populated if latestProcessedChange is requested May not be accurate if latest change is not yet cached + */ + latestProcessedChange: GitCommitRef; + /** + * Git object id + */ + objectId: string; + /** + * Git object id + */ + originalObjectId: string; +} +export interface GitItemDescriptor { + /** + * Path to item + */ + path: string; + /** + * Specifies whether to include children (OneLevel), all descendants (Full), or None + */ + recursionLevel: VersionControlRecursionType; + /** + * Version string (interpretation based on VersionType defined in subclass + */ + version: string; + /** + * Version modifiers (e.g. previous) + */ + versionOptions: GitVersionOptions; + /** + * How to interpret version (branch,tag,commit) + */ + versionType: GitVersionType; +} +export interface GitItemRequestData { + /** + * Whether to include metadata for all items + */ + includeContentMetadata: boolean; + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; + /** + * Collection of items to fetch, including path, version, and recursion level + */ + itemDescriptors: GitItemDescriptor[]; + /** + * Whether to include shallow ref to commit that last changed each item + */ + latestProcessedChange: boolean; +} +/** + * Encapsulates the reference metadata of a Git media object. + */ +export interface GitMediaObjectRef { + /** + * Gets or sets the reference links of the Git media object. + */ + _links: any; + /** + * Gets or sets the Git media object identifier. This Id property duplicates the Oid property, but is required by the VSO REST specification. + */ + id: string; + /** + * Gets or sets the Git media object identifier. This property exists for adherence to the GitHub Git Media contract. + */ + oid: string; + /** + * Gets or sets the size of the Git media object in bytes. This property exists for adherence to the GitHub Git Media contract. + */ + size: number; + /** + * Gets or sets the URL for the Git media object. + */ + url: string; +} +export enum GitObjectType { + Bad = 0, + Commit = 1, + Tree = 2, + Blob = 3, + Tag = 4, + Ext2 = 5, + OfsDelta = 6, + RefDelta = 7, +} +export interface GitPathAction { + action: GitPathActions; + base64Content: string; + path: string; + rawTextContent: string; + targetPath: string; +} +export enum GitPathActions { + None = 0, + Edit = 1, + Delete = 2, + Add = 3, + Rename = 4, +} +export interface GitPullRequest { + _links: any; + closedDate: Date; + codeReviewId: number; + commits: GitCommitRef[]; + completionOptions: GitPullRequestCompletionOptions; + createdBy: VSS_Common_Contracts.IdentityRef; + creationDate: Date; + description: string; + lastMergeCommit: GitCommitRef; + lastMergeSourceCommit: GitCommitRef; + lastMergeTargetCommit: GitCommitRef; + mergeId: string; + mergeStatus: PullRequestAsyncStatus; + pullRequestId: number; + remoteUrl: string; + repository: GitRepository; + reviewers: IdentityRefWithVote[]; + sourceRefName: string; + status: PullRequestStatus; + targetRefName: string; + title: string; + upgraded: boolean; + url: string; +} +export interface GitPullRequestCompletionOptions { + deleteSourceBranch: boolean; + mergeCommitMessage: string; +} +export interface GitPullRequestSearchCriteria { + creatorId: string; + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; + repositoryId: string; + reviewerId: string; + sourceRefName: string; + status: PullRequestStatus; + targetRefName: string; +} +export interface GitPush extends GitPushRef { + commits: GitCommitRef[]; + refUpdates: GitRefUpdate[]; + repository: GitRepository; +} +export interface GitPushEventData { + afterId: string; + beforeId: string; + branch: string; + commits: GitCommit[]; + repository: GitRepository; +} +export interface GitPushRef { + _links: any; + date: Date; + pushCorrelationId: string; + pushedBy: VSS_Common_Contracts.IdentityRef; + pushId: number; + url: string; +} +export interface GitPushSearchCriteria { + fromDate: Date; + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; + includeRefUpdates: boolean; + pusherId: string; + refName: string; + toDate: Date; +} +export interface GitQueryCommitsCriteria { + /** + * Number of entries to skip + */ + $skip: number; + /** + * Maximum number of entries to retrieve + */ + $top: number; + /** + * Alias or display name of the author + */ + author: string; + /** + * If provided, the earliest commit in the graph to search + */ + compareVersion: GitVersionDescriptor; + /** + * If true, don't include delete history entries + */ + excludeDeletes: boolean; + /** + * If provided, a lower bound for filtering commits alphabetically + */ + fromCommitId: string; + /** + * If provided, only include history entries created after this date (string) + */ + fromDate: string; + /** + * If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. + */ + ids: string[]; + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; + /** + * Path of item to search under + */ + itemPath: string; + /** + * If provided, identifies the commit or branch to search + */ + itemVersion: GitVersionDescriptor; + /** + * If provided, an upper bound for filtering commits alphabetically + */ + toCommitId: string; + /** + * If provided, only include history entries created before this date (string) + */ + toDate: string; + /** + * Alias or display name of the committer + */ + user: string; +} +export interface GitRef { + _links: any; + isLockedBy: VSS_Common_Contracts.IdentityRef; + name: string; + objectId: string; + url: string; +} +export interface GitRefUpdate { + name: string; + newObjectId: string; + oldObjectId: string; + repositoryId: string; +} +export enum GitRefUpdateMode { + /** + * Indicates the Git protocol model where any refs that can be updated will be updated, but any failures will not prevent other updates from succeeding. + */ + BestEffort = 0, + /** + * Indicates that all ref updates must succeed or none will succeed. All ref updates will be atomically written. If any failure is encountered, previously successful updates will be rolled back and the entire operation will fail. + */ + AllOrNone = 1, +} +export interface GitRefUpdateResult { + /** + * Custom message for the result object For instance, Reason for failing. + */ + customMessage: string; + /** + * Ref name + */ + name: string; + /** + * New object ID + */ + newObjectId: string; + /** + * Old object ID + */ + oldObjectId: string; + /** + * Name of the plugin that rejected the updated. + */ + rejectedBy: string; + /** + * Repository ID + */ + repositoryId: string; + /** + * True if the ref update succeeded, false otherwise + */ + success: boolean; + /** + * Status of the update from the TFS server. + */ + updateStatus: GitRefUpdateStatus; +} +export interface GitRefUpdateResultSet { + countFailed: number; + countSucceeded: number; + pushCorrelationId: string; + pushIds: { + [key: number]: number; + }; + pushTime: Date; + results: GitRefUpdateResult[]; +} +export enum GitRefUpdateStatus { + /** + * Indicates that the ref update request was completed successfully. + */ + Succeeded = 0, + /** + * Indicates that the ref update request could not be completed because part of the graph would be disconnected by this change, and the caller does not have ForcePush permission on the repository. + */ + ForcePushRequired = 1, + /** + * Indicates that the ref update request could not be completed because the old object ID presented in the request was not the object ID of the ref when the database attempted the update. The most likely scenario is that the caller lost a race to update the ref. + */ + StaleOldObjectId = 2, + /** + * Indicates that the ref update request could not be completed because the ref name presented in the request was not valid. + */ + InvalidRefName = 3, + /** + * The request was not processed + */ + Unprocessed = 4, + /** + * The ref update request could not be completed because the new object ID for the ref could not be resolved to a commit object (potentially through any number of tags) + */ + UnresolvableToCommit = 5, + /** + * The ref update request could not be completed because the user lacks write permissions required to write this ref + */ + WritePermissionRequired = 6, + /** + * The ref update request could not be completed because the user lacks note creation permissions required to write this note + */ + ManageNotePermissionRequired = 7, + /** + * The ref update request could not be completed because the user lacks the permission to create a branch + */ + CreateBranchPermissionRequired = 8, + /** + * The ref update request could not be completed because the user lacks the permission to create a tag + */ + CreateTagPermissionRequired = 9, + /** + * The ref update could not be completed because it was rejected by the plugin. + */ + RejectedByPlugin = 10, + /** + * The ref update could not be completed because the ref is locked by another user. + */ + Locked = 11, + /** + * The ref update could not be completed because, in case-insensitive mode, the ref name conflicts with an existing, differently-cased ref name. + */ + RefNameConflict = 12, + /** + * The ref update could not be completed because it was rejected by policy. + */ + RejectedByPolicy = 13, + /** + * Indicates that the ref update request was completed successfully, but the ref doesn't actually exist so no changes were made. This should only happen during deletes. + */ + SucceededNonExistentRef = 14, + /** + * Indicates that the ref update request was completed successfully, but the passed-in ref was corrupt - as in, the old object ID was bad. This should only happen during deletes. + */ + SucceededCorruptRef = 15, +} +export interface GitRepository { + _links: any; + defaultBranch: string; + id: string; + name: string; + project: TFS_Core_Contracts.TeamProjectReference; + remoteUrl: string; + url: string; +} +export enum GitRepositoryPermissions { + None = 0, + Administer = 1, + GenericRead = 2, + GenericContribute = 4, + ForcePush = 8, + CreateBranch = 16, + CreateTag = 32, + ManageNote = 64, + PolicyExempt = 128, + /** + * This defines the set of bits that are valid for the git permission space. When reading or writing git permissions, these are the only bits paid attention too. + */ + All = 255, + BranchLevelPermissions = 141, +} +export interface GitTargetVersionDescriptor extends GitVersionDescriptor { + /** + * Version string identifier (name of tag/branch, SHA1 of commit) + */ + targetVersion: string; + /** + * Version options - Specify additional modifiers to version (e.g Previous) + */ + targetVersionOptions: GitVersionOptions; + /** + * Version type (branch, tag, or commit). Determines how Id is interpreted + */ + targetVersionType: GitVersionType; +} +export interface GitTreeEntryRef { + /** + * Blob or tree + */ + gitObjectType: GitObjectType; + /** + * Mode represented as octal string + */ + mode: string; + /** + * SHA1 hash of git object + */ + objectId: string; + /** + * Path relative to parent tree object + */ + relativePath: string; + /** + * Size of content + */ + size: number; + /** + * url to retrieve tree or blob + */ + url: string; +} +export interface GitTreeRef { + _links: any; + /** + * SHA1 hash of git object + */ + objectId: string; + /** + * Sum of sizes of all children + */ + size: number; + /** + * Blobs and trees under this tree + */ + treeEntries: GitTreeEntryRef[]; + /** + * Url to tree + */ + url: string; +} +export interface GitUserDate { + date: Date; + email: string; + name: string; +} +export interface GitVersionDescriptor { + /** + * Version string identifier (name of tag/branch/index, SHA1 of commit) + */ + version: string; + /** + * Version options - Specify additional modifiers to version (e.g Previous) + */ + versionOptions: GitVersionOptions; + /** + * Version type (branch, tag, commit, or index). Determines how Id is interpreted + */ + versionType: GitVersionType; +} +export enum GitVersionOptions { + /** + * Not specified + */ + None = 0, + /** + * Commit that changed item prior to the current version + */ + PreviousChange = 1, + /** + * First parent of commit (HEAD^) + */ + FirstParent = 2, +} +export enum GitVersionType { + /** + * Interpret the version as a branch name + */ + Branch = 0, + /** + * Interpret the version as a tag name + */ + Tag = 1, + /** + * Interpret the version as a commit ID (SHA1) + */ + Commit = 2, + /** + * Interpret the version as an index name + */ + Index = 3, +} +export interface HistoryEntry { + /** + * The Change list (changeset/commit/shelveset) for this point in history + */ + changeList: ChangeList; + /** + * The change made to the item from this change list (only relevant for File history, not folders) + */ + itemChangeType: VersionControlChangeType; + /** + * The path of the item at this point in history (only relevant for File history, not folders) + */ + serverItem: string; +} +export interface HistoryQueryResults { + /** + * True if there are more results available to fetch (we're returning the max # of items requested) A more RESTy solution would be to include a Link header + */ + moreResultsAvailable: boolean; + /** + * The history entries (results) from this query + */ + results: HistoryEntry[]; +} +export interface IdentityRefWithVote extends VSS_Common_Contracts.IdentityRef { + isRequired: boolean; + reviewerUrl: string; + vote: number; + votedFor: IdentityRefWithVote[]; +} +export interface IncludedGitCommit { + commitId: string; + commitTime: Date; + parentCommitIds: string[]; + repositoryId: string; +} +export interface ItemContent { + content: string; + contentType: ItemContentType; +} +export enum ItemContentType { + RawText = 0, + Base64Encoded = 1, +} +/** + * Optional details to include when returning an item model + */ +export interface ItemDetailsOptions { + /** + * If true, include metadata about the file type + */ + includeContentMetadata: boolean; + /** + * Specifies whether to include children (OneLevel), all descendants (Full) or None for folder items + */ + recursionLevel: VersionControlRecursionType; +} +export interface ItemModel { + _links: any; + contentMetadata: FileContentMetadata; + isFolder: boolean; + isSymLink: boolean; + path: string; + url: string; +} +export enum PullRequestAsyncStatus { + NotSet = 0, + Queued = 1, + Conflicts = 2, + Succeeded = 3, + RejectedByPolicy = 4, + Failure = 5, +} +export enum PullRequestStatus { + NotSet = 0, + Active = 1, + Abandoned = 2, + Completed = 3, + All = 4, +} +export interface TfvcBranch extends TfvcBranchRef { + children: TfvcBranch[]; + mappings: TfvcBranchMapping[]; + parent: TfvcShallowBranchRef; + relatedBranches: TfvcShallowBranchRef[]; +} +export interface TfvcBranchMapping { + depth: string; + serverItem: string; + type: string; +} +export interface TfvcBranchRef extends TfvcShallowBranchRef { + _links: any; + createdDate: Date; + description: string; + isDeleted: boolean; + owner: VSS_Common_Contracts.IdentityRef; + url: string; +} +export interface TfvcChange extends Change { + /** + * List of merge sources in case of rename or branch creation. + */ + mergeSources: TfvcMergeSource[]; + /** + * Version at which a (shelved) change was pended against + */ + pendingVersion: number; +} +export interface TfvcChangeset extends TfvcChangesetRef { + accountId: string; + changes: TfvcChange[]; + checkinNotes: CheckinNote[]; + collectionId: string; + hasMoreChanges: boolean; + policyOverride: TfvcPolicyOverrideInfo; + teamProjectIds: string[]; + workItems: AssociatedWorkItem[]; +} +export interface TfvcChangesetRef { + _links: any; + author: VSS_Common_Contracts.IdentityRef; + changesetId: number; + checkedInBy: VSS_Common_Contracts.IdentityRef; + comment: string; + commentTruncated: boolean; + createdDate: Date; + url: string; +} +/** + * Criteria used in a search for change lists + */ +export interface TfvcChangesetSearchCriteria { + /** + * Alias or display name of user who made the changes + */ + author: string; + /** + * Whether or not to follow renames for the given item being queried + */ + followRenames: boolean; + /** + * If provided, only include changesets created after this date (string) Think of a better name for this. + */ + fromDate: string; + /** + * If provided, only include changesets after this changesetID + */ + fromId: number; + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; + /** + * Path of item to search under + */ + path: string; + /** + * If provided, only include changesets created before this date (string) Think of a better name for this. + */ + toDate: string; + /** + * If provided, a version descriptor for the latest change list to include + */ + toId: number; +} +export interface TfvcChangesetsRequestData { + changesetIds: number[]; + commentLength: number; + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; +} +export interface TfvcCheckinEventData { + changeset: TfvcChangeset; + project: TFS_Core_Contracts.TeamProjectReference; +} +export interface TfvcHistoryEntry extends HistoryEntry { + /** + * The encoding of the item at this point in history (only relevant for File history, not folders) + */ + encoding: number; + /** + * The file id of the item at this point in history (only relevant for File history, not folders) + */ + fileId: number; +} +export interface TfvcItem extends ItemModel { + changeDate: Date; + deletionId: number; + isBranch: boolean; + isPendingChange: boolean; + version: number; +} +/** + * Item path and Version descriptor properties + */ +export interface TfvcItemDescriptor { + path: string; + recursionLevel: VersionControlRecursionType; + version: string; + versionOption: TfvcVersionOption; + versionType: TfvcVersionType; +} +export interface TfvcItemRequestData { + /** + * If true, include metadata about the file type + */ + includeContentMetadata: boolean; + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; + itemDescriptors: TfvcItemDescriptor[]; +} +export interface TfvcLabel extends TfvcLabelRef { + items: TfvcItem[]; +} +export interface TfvcLabelRef { + _links: any; + description: string; + id: number; + labelScope: string; + modifiedDate: Date; + name: string; + owner: VSS_Common_Contracts.IdentityRef; + url: string; +} +export interface TfvcLabelRequestData { + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; + itemLabelFilter: string; + labelScope: string; + maxItemCount: number; + name: string; + owner: string; +} +export interface TfvcMergeSource { + /** + * Indicates if this a rename source. If false, it is a merge source. + */ + isRename: boolean; + /** + * The server item of the merge source + */ + serverItem: string; + /** + * Start of the version range + */ + versionFrom: number; + /** + * End of the version range + */ + versionTo: number; +} +export interface TfvcPolicyFailureInfo { + message: string; + policyName: string; +} +export interface TfvcPolicyOverrideInfo { + comment: string; + policyFailures: TfvcPolicyFailureInfo[]; +} +export interface TfvcShallowBranchRef { + path: string; +} +export interface TfvcShelveset extends TfvcShelvesetRef { + changes: TfvcChange[]; + notes: CheckinNote[]; + policyOverride: TfvcPolicyOverrideInfo; + workItems: AssociatedWorkItem[]; +} +export interface TfvcShelvesetRef { + _links: any; + comment: string; + commentTruncated: boolean; + createdDate: Date; + id: string; + name: string; + owner: VSS_Common_Contracts.IdentityRef; + url: string; +} +export interface TfvcShelvesetRequestData { + /** + * Whether to include policyOverride and notes + */ + includeDetails: boolean; + /** + * Whether to include the _links field on the shallow references + */ + includeLinks: boolean; + /** + * Whether to include workItems + */ + includeWorkItems: boolean; + /** + * Max number of changes to include + */ + maxChangeCount: number; + /** + * Max length of comment + */ + maxCommentLength: number; + /** + * Shelveset's name + */ + name: string; + /** + * Owner's ID. Could be a name or a guid. + */ + owner: string; +} +export interface TfvcVersionDescriptor { + version: string; + versionOption: TfvcVersionOption; + versionType: TfvcVersionType; +} +export enum TfvcVersionOption { + None = 0, + Previous = 1, + UseRename = 2, +} +export enum TfvcVersionType { + None = 0, + Changeset = 1, + Shelveset = 2, + Change = 3, + Date = 4, + Latest = 5, + Tip = 6, + MergeSource = 7, +} +export interface UpdateRefsRequest { + refUpdateRequests: GitRefUpdate[]; + updateMode: GitRefUpdateMode; +} +export enum VersionControlChangeType { + None = 0, + Add = 1, + Edit = 2, + Encoding = 4, + Rename = 8, + Delete = 16, + Undelete = 32, + Branch = 64, + Merge = 128, + Lock = 256, + Rollback = 512, + SourceRename = 1024, + TargetRename = 2048, + Property = 4096, + All = 8191, +} +export interface VersionControlProjectInfo { + project: TFS_Core_Contracts.TeamProjectReference; + supportsGit: boolean; + supportsTFVC: boolean; +} +export enum VersionControlRecursionType { + None = 0, + OneLevel = 1, + Full = 120, +} +export var TypeInfo: { + AssociatedWorkItem: { + fields: any; + }; + Change: { + fields: any; + }; + ChangeCountDictionary: { + fields: any; + }; + ChangeList: { + fields: any; + }; + ChangeListSearchCriteria: { + fields: any; + }; + CheckinNote: { + fields: any; + }; + FileContentMetadata: { + fields: any; + }; + GitBaseVersionDescriptor: { + fields: any; + }; + GitBlobRef: { + fields: any; + }; + GitBranchStats: { + fields: any; + }; + GitChange: { + fields: any; + }; + GitCommit: { + fields: any; + }; + GitCommitChanges: { + fields: any; + }; + GitCommitDiffs: { + fields: any; + }; + GitCommitRef: { + fields: any; + }; + GitCommitToCreate: { + fields: any; + }; + GitHistoryQueryResults: { + fields: any; + }; + GitItem: { + fields: any; + }; + GitItemDescriptor: { + fields: any; + }; + GitItemRequestData: { + fields: any; + }; + GitMediaObjectRef: { + fields: any; + }; + GitObjectType: { + enumValues: { + "bad": number; + "commit": number; + "tree": number; + "blob": number; + "tag": number; + "ext2": number; + "ofsDelta": number; + "refDelta": number; + }; + }; + GitPathAction: { + fields: any; + }; + GitPathActions: { + enumValues: { + "none": number; + "edit": number; + "delete": number; + "add": number; + "rename": number; + }; + }; + GitPullRequest: { + fields: any; + }; + GitPullRequestCompletionOptions: { + fields: any; + }; + GitPullRequestSearchCriteria: { + fields: any; + }; + GitPush: { + fields: any; + }; + GitPushEventData: { + fields: any; + }; + GitPushRef: { + fields: any; + }; + GitPushSearchCriteria: { + fields: any; + }; + GitQueryCommitsCriteria: { + fields: any; + }; + GitRef: { + fields: any; + }; + GitRefUpdate: { + fields: any; + }; + GitRefUpdateMode: { + enumValues: { + "bestEffort": number; + "allOrNone": number; + }; + }; + GitRefUpdateResult: { + fields: any; + }; + GitRefUpdateResultSet: { + fields: any; + }; + GitRefUpdateStatus: { + enumValues: { + "succeeded": number; + "forcePushRequired": number; + "staleOldObjectId": number; + "invalidRefName": number; + "unprocessed": number; + "unresolvableToCommit": number; + "writePermissionRequired": number; + "manageNotePermissionRequired": number; + "createBranchPermissionRequired": number; + "createTagPermissionRequired": number; + "rejectedByPlugin": number; + "locked": number; + "refNameConflict": number; + "rejectedByPolicy": number; + "succeededNonExistentRef": number; + "succeededCorruptRef": number; + }; + }; + GitRepository: { + fields: any; + }; + GitRepositoryPermissions: { + enumValues: { + "none": number; + "administer": number; + "genericRead": number; + "genericContribute": number; + "forcePush": number; + "createBranch": number; + "createTag": number; + "manageNote": number; + "policyExempt": number; + "all": number; + "branchLevelPermissions": number; + }; + }; + GitTargetVersionDescriptor: { + fields: any; + }; + GitTreeEntryRef: { + fields: any; + }; + GitTreeRef: { + fields: any; + }; + GitUserDate: { + fields: any; + }; + GitVersionDescriptor: { + fields: any; + }; + GitVersionOptions: { + enumValues: { + "none": number; + "previousChange": number; + "firstParent": number; + }; + }; + GitVersionType: { + enumValues: { + "branch": number; + "tag": number; + "commit": number; + "index": number; + }; + }; + HistoryEntry: { + fields: any; + }; + HistoryQueryResults: { + fields: any; + }; + IdentityRefWithVote: { + fields: any; + }; + IncludedGitCommit: { + fields: any; + }; + ItemContent: { + fields: any; + }; + ItemContentType: { + enumValues: { + "rawText": number; + "base64Encoded": number; + }; + }; + ItemDetailsOptions: { + fields: any; + }; + ItemModel: { + fields: any; + }; + PullRequestAsyncStatus: { + enumValues: { + "notSet": number; + "queued": number; + "conflicts": number; + "succeeded": number; + "rejectedByPolicy": number; + "failure": number; + }; + }; + PullRequestStatus: { + enumValues: { + "notSet": number; + "active": number; + "abandoned": number; + "completed": number; + "all": number; + }; + }; + TfvcBranch: { + fields: any; + }; + TfvcBranchMapping: { + fields: any; + }; + TfvcBranchRef: { + fields: any; + }; + TfvcChange: { + fields: any; + }; + TfvcChangeset: { + fields: any; + }; + TfvcChangesetRef: { + fields: any; + }; + TfvcChangesetSearchCriteria: { + fields: any; + }; + TfvcChangesetsRequestData: { + fields: any; + }; + TfvcCheckinEventData: { + fields: any; + }; + TfvcHistoryEntry: { + fields: any; + }; + TfvcItem: { + fields: any; + }; + TfvcItemDescriptor: { + fields: any; + }; + TfvcItemRequestData: { + fields: any; + }; + TfvcLabel: { + fields: any; + }; + TfvcLabelRef: { + fields: any; + }; + TfvcLabelRequestData: { + fields: any; + }; + TfvcMergeSource: { + fields: any; + }; + TfvcPolicyFailureInfo: { + fields: any; + }; + TfvcPolicyOverrideInfo: { + fields: any; + }; + TfvcShallowBranchRef: { + fields: any; + }; + TfvcShelveset: { + fields: any; + }; + TfvcShelvesetRef: { + fields: any; + }; + TfvcShelvesetRequestData: { + fields: any; + }; + TfvcVersionDescriptor: { + fields: any; + }; + TfvcVersionOption: { + enumValues: { + "none": number; + "previous": number; + "useRename": number; + }; + }; + TfvcVersionType: { + enumValues: { + "none": number; + "changeset": number; + "shelveset": number; + "change": number; + "date": number; + "latest": number; + "tip": number; + "mergeSource": number; + }; + }; + UpdateRefsRequest: { + fields: any; + }; + VersionControlChangeType: { + enumValues: { + "none": number; + "add": number; + "edit": number; + "encoding": number; + "rename": number; + "delete": number; + "undelete": number; + "branch": number; + "merge": number; + "lock": number; + "rollback": number; + "sourceRename": number; + "targetRename": number; + "property": number; + "all": number; + }; + }; + VersionControlProjectInfo: { + fields: any; + }; + VersionControlRecursionType: { + enumValues: { + "none": number; + "oneLevel": number; + "full": number; + }; + }; +}; +} +declare module "TFS/VersionControl/Controls" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +export interface IHistoryList { + /** + * Query the history by providing certain searchCriteria + * @param itemPath itemPath for control to search history in Git and Tfvc + * @param fromVersion fromId for control to search history in Git and Tfvc + * @param toVersion toId for control to search history in Git and Tfvc + * @param repositoryId Optional repository Id for control to search history in Git + */ + createHistoryList(itemPath: string, fromVersion: string, toVersion: string, repositoryId?: string): any; +} +/** +* Control showing the history list control +*/ +export module HistoryList { + var contributionId: string; + /** + * Create an instance of the history list control + * + * @param $container Container element to create the history list control in + * @param options History list control options + * @param webContext Optional web context to scope the control to + */ + function create($container: JQuery, options?: any, webContext?: Contracts_Platform.WebContext): IPromise; +} +} +declare module "TFS/VersionControl/GitRestClient" { +import Contracts = require("TFS/VersionControl/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class GitHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlob(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * [Preview API] Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlobContent(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * [Preview API] Gets one or more blobs in a zip file download. + * + * @param {string[]} blobIds + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @param {string} filename + * @return IPromise + */ + getBlobsZip(blobIds: string[], repositoryId: string, project?: string, filename?: string): IPromise; + /** + * [Preview API] Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlobZip(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * [Preview API] Retrieve statistics about a single branch. + * + * @param {string} repositoryId - Friendly name or guid of repository + * @param {string} name - Name of the branch + * @param {string} project - Project ID or project name + * @param {Contracts.GitVersionDescriptor} baseVersionDescriptor + * @return IPromise + */ + getBranch(repositoryId: string, name: string, project?: string, baseVersionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * [Preview API] Retrieve statistics about all branches within a repository. + * + * @param {string} repositoryId - Friendly name or guid of repository + * @param {string} project - Project ID or project name + * @param {Contracts.GitVersionDescriptor} baseVersionDescriptor + * @return IPromise + */ + getBranches(repositoryId: string, project?: string, baseVersionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * [Preview API] Retrieve changes for a particular commit. + * + * @param {string} commitId - The id of the commit. + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} top - The maximum number of changes to return. + * @param {number} skip - The number of changes to skip. + * @return IPromise + */ + getChanges(commitId: string, repositoryId: string, project?: string, top?: number, skip?: number): IPromise; + /** + * [Preview API] Retrieve a particular commit. + * + * @param {string} commitId - The id of the commit. + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} changeCount - The number of changes to include in the result. + * @return IPromise + */ + getCommit(commitId: string, repositoryId: string, project?: string, changeCount?: number): IPromise; + /** + * [Preview API] Retrieve git commits for a project + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {Contracts.GitQueryCommitsCriteria} searchCriteria + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getCommits(repositoryId: string, searchCriteria: Contracts.GitQueryCommitsCriteria, project?: string, skip?: number, top?: number): IPromise; + /** + * [Preview API] Retrieve a list of commits associated with a particular push. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {number} pushId - The id of the push. + * @param {string} project - Project ID or project name + * @param {number} top - The maximum number of commits to return ("get the top x commits"). + * @param {number} skip - The number of commits to skip. + * @param {boolean} includeLinks + * @return IPromise + */ + getPushCommits(repositoryId: string, pushId: number, project?: string, top?: number, skip?: number, includeLinks?: boolean): IPromise; + /** + * [Preview API] Retrieve git commits for a project + * + * @param {Contracts.GitQueryCommitsCriteria} searchCriteria - Search options + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getCommitsBatch(searchCriteria: Contracts.GitQueryCommitsCriteria, repositoryId: string, project?: string, skip?: number, top?: number): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItem(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemContent(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {boolean} includeLinks + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItems(repositoryId: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, includeLinks?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemText(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemZip(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * [Preview API] Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path + * + * @param {Contracts.GitItemRequestData} requestData + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatch(requestData: Contracts.GitItemRequestData, repositoryId: string, project?: string): IPromise; + /** + * [Preview API] Retrieve pull request's commits + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getPullRequestCommits(repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * [Preview API] Adds a reviewer to a git pull request + * + * @param {Contracts.IdentityRefWithVote} reviewer + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequestReviewer(reviewer: Contracts.IdentityRefWithVote, repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * [Preview API] Adds reviewers to a git pull request + * + * @param {VSS_Common_Contracts.IdentityRef[]} reviewers + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequestReviewers(reviewers: VSS_Common_Contracts.IdentityRef[], repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * [Preview API] Adds reviewers to a git pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deletePullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * [Preview API] Retrieve a reviewer from a pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getPullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * [Preview API] Retrieve a pull request reviewers + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getPullRequestReviewers(repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * [Preview API] Query pull requests by project + * + * @param {string} project - Project ID or project name + * @param {Contracts.GitPullRequestSearchCriteria} searchCriteria + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPullRequestsByProject(project: string, searchCriteria: Contracts.GitPullRequestSearchCriteria, maxCommentLength?: number, skip?: number, top?: number): IPromise; + /** + * [Preview API] Create a git pull request + * + * @param {Contracts.GitPullRequest} gitPullRequestToCreate + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequest(gitPullRequestToCreate: Contracts.GitPullRequest, repositoryId: string, project?: string): IPromise; + /** + * [Preview API] Retrieve a pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @param {boolean} includeCommits + * @return IPromise + */ + getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean): IPromise; + /** + * [Preview API] Query for pull requests + * + * @param {string} repositoryId + * @param {Contracts.GitPullRequestSearchCriteria} searchCriteria + * @param {string} project - Project ID or project name + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPullRequests(repositoryId: string, searchCriteria: Contracts.GitPullRequestSearchCriteria, project?: string, maxCommentLength?: number, skip?: number, top?: number): IPromise; + /** + * [Preview API] Updates a pull request + * + * @param {Contracts.GitPullRequest} gitPullRequestToUpdate + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updatePullRequest(gitPullRequestToUpdate: Contracts.GitPullRequest, repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * [Preview API] Retrieve a pull request work items + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @param {number} commitsTop + * @param {number} commitsSkip + * @return IPromise + */ + getPullRequestWorkItems(repositoryId: string, pullRequestId: number, project?: string, commitsTop?: number, commitsSkip?: number): IPromise; + /** + * [Preview API] Push changes to the repository. + * + * @param {Contracts.GitPush} push + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, a project-scoped route must be used. + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPush(push: Contracts.GitPush, repositoryId: string, project?: string): IPromise; + /** + * [Preview API] Retrieve a particular push. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {number} pushId - The id of the push. + * @param {string} project - Project ID or project name + * @param {number} includeCommits - The number of commits to include in the result. + * @param {boolean} includeRefUpdates + * @return IPromise + */ + getPush(repositoryId: string, pushId: number, project?: string, includeCommits?: number, includeRefUpdates?: boolean): IPromise; + /** + * [Preview API] Retrieves pushes associated with the specified repository. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @param {Contracts.GitPushSearchCriteria} searchCriteria + * @return IPromise + */ + getPushes(repositoryId: string, project?: string, skip?: number, top?: number, searchCriteria?: Contracts.GitPushSearchCriteria): IPromise; + /** + * [Preview API] Queries the provided repository for its refs and returns them. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {string} filter - [optional] A filter to apply to the refs. + * @param {boolean} includeLinks - [optional] Specifies if referenceLinks should be included in the result. default is false. + * @return IPromise + */ + getRefs(repositoryId: string, project?: string, filter?: string, includeLinks?: boolean): IPromise; + /** + * [Preview API] Creates or updates refs with the given information + * + * @param {Contracts.GitRefUpdate[]} refUpdates - List of ref updates to attempt to perform + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {string} projectId - The id of the project. + * @return IPromise + */ + updateRefs(refUpdates: Contracts.GitRefUpdate[], repositoryId: string, project?: string, projectId?: string): IPromise; + /** + * [Preview API] Create a git repository + * + * @param {Contracts.GitRepository} gitRepositoryToCreate + * @param {string} project - Project ID or project name + * @return IPromise + */ + createRepository(gitRepositoryToCreate: Contracts.GitRepository, project?: string): IPromise; + /** + * [Preview API] Delete a git repository + * + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteRepository(repositoryId: string, project?: string): IPromise; + /** + * [Preview API] Retrieve git repositories. + * + * @param {string} project - Project ID or project name + * @param {boolean} includeLinks + * @return IPromise + */ + getRepositories(project?: string, includeLinks?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getRepository(repositoryId: string, project?: string): IPromise; + /** + * [Preview API] Updates the Git repository with the single populated change in the specified repository information. + * + * @param {Contracts.GitRepository} newRepositoryInfo + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateRepository(newRepositoryInfo: Contracts.GitRepository, repositoryId: string, project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {string} projectId + * @param {boolean} recursive + * @param {string} fileName + * @return IPromise + */ + getTree(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {string} projectId + * @param {boolean} recursive + * @param {string} fileName + * @return IPromise + */ + getTreeZip(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): IPromise; +} +export class GitHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlob(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlobContent(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * Gets one or more blobs in a zip file download. + * + * @param {string[]} blobIds + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @param {string} filename + * @return IPromise + */ + getBlobsZip(blobIds: string[], repositoryId: string, project?: string, filename?: string): IPromise; + /** + * Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlobZip(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * Retrieve statistics about a single branch. + * + * @param {string} repositoryId - Friendly name or guid of repository + * @param {string} name - Name of the branch + * @param {string} project - Project ID or project name + * @param {Contracts.GitVersionDescriptor} baseVersionDescriptor + * @return IPromise + */ + getBranch(repositoryId: string, name: string, project?: string, baseVersionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Retrieve statistics about all branches within a repository. + * + * @param {string} repositoryId - Friendly name or guid of repository + * @param {string} project - Project ID or project name + * @param {Contracts.GitVersionDescriptor} baseVersionDescriptor + * @return IPromise + */ + getBranches(repositoryId: string, project?: string, baseVersionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Retrieve changes for a particular commit. + * + * @param {string} commitId - The id of the commit. + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} top - The maximum number of changes to return. + * @param {number} skip - The number of changes to skip. + * @return IPromise + */ + getChanges(commitId: string, repositoryId: string, project?: string, top?: number, skip?: number): IPromise; + /** + * Retrieve a particular commit. + * + * @param {string} commitId - The id of the commit. + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} changeCount - The number of changes to include in the result. + * @return IPromise + */ + getCommit(commitId: string, repositoryId: string, project?: string, changeCount?: number): IPromise; + /** + * Retrieve git commits for a project + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {Contracts.GitQueryCommitsCriteria} searchCriteria + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getCommits(repositoryId: string, searchCriteria: Contracts.GitQueryCommitsCriteria, project?: string, skip?: number, top?: number): IPromise; + /** + * Retrieve a list of commits associated with a particular push. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {number} pushId - The id of the push. + * @param {string} project - Project ID or project name + * @param {number} top - The maximum number of commits to return ("get the top x commits"). + * @param {number} skip - The number of commits to skip. + * @param {boolean} includeLinks + * @return IPromise + */ + getPushCommits(repositoryId: string, pushId: number, project?: string, top?: number, skip?: number, includeLinks?: boolean): IPromise; + /** + * Retrieve git commits for a project + * + * @param {Contracts.GitQueryCommitsCriteria} searchCriteria - Search options + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getCommitsBatch(searchCriteria: Contracts.GitQueryCommitsCriteria, repositoryId: string, project?: string, skip?: number, top?: number): IPromise; + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItem(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemContent(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {boolean} includeLinks + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItems(repositoryId: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, includeLinks?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemText(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemZip(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path + * + * @param {Contracts.GitItemRequestData} requestData + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatch(requestData: Contracts.GitItemRequestData, repositoryId: string, project?: string): IPromise; + /** + * [Preview API] Retrieve pull request's commits + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getPullRequestCommits(repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * Adds a reviewer to a git pull request + * + * @param {Contracts.IdentityRefWithVote} reviewer + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequestReviewer(reviewer: Contracts.IdentityRefWithVote, repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * Adds reviewers to a git pull request + * + * @param {VSS_Common_Contracts.IdentityRef[]} reviewers + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequestReviewers(reviewers: VSS_Common_Contracts.IdentityRef[], repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * Adds reviewers to a git pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deletePullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * Retrieve a reviewer from a pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getPullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * Retrieve a pull request reviewers + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getPullRequestReviewers(repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * Create a git pull request + * + * @param {Contracts.GitPullRequest} gitPullRequestToCreate + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequest(gitPullRequestToCreate: Contracts.GitPullRequest, repositoryId: string, project?: string): IPromise; + /** + * Retrieve a pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @param {boolean} includeCommits + * @return IPromise + */ + getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean): IPromise; + /** + * Query for pull requests + * + * @param {string} repositoryId + * @param {Contracts.GitPullRequestSearchCriteria} searchCriteria + * @param {string} project - Project ID or project name + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPullRequests(repositoryId: string, searchCriteria: Contracts.GitPullRequestSearchCriteria, project?: string, maxCommentLength?: number, skip?: number, top?: number): IPromise; + /** + * Updates a pull request + * + * @param {Contracts.GitPullRequest} gitPullRequestToUpdate + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updatePullRequest(gitPullRequestToUpdate: Contracts.GitPullRequest, repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * [Preview API] Query pull requests by project + * + * @param {string} project - Project ID or project name + * @param {Contracts.GitPullRequestSearchCriteria} searchCriteria + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPullRequestsByProject(project: string, searchCriteria: Contracts.GitPullRequestSearchCriteria, maxCommentLength?: number, skip?: number, top?: number): IPromise; + /** + * [Preview API] Retrieve a pull request work items + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @param {number} commitsTop + * @param {number} commitsSkip + * @return IPromise + */ + getPullRequestWorkItems(repositoryId: string, pullRequestId: number, project?: string, commitsTop?: number, commitsSkip?: number): IPromise; + /** + * Push changes to the repository. + * + * @param {Contracts.GitPush} push + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, a project-scoped route must be used. + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPush(push: Contracts.GitPush, repositoryId: string, project?: string): IPromise; + /** + * Retrieve a particular push. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {number} pushId - The id of the push. + * @param {string} project - Project ID or project name + * @param {number} includeCommits - The number of commits to include in the result. + * @param {boolean} includeRefUpdates + * @return IPromise + */ + getPush(repositoryId: string, pushId: number, project?: string, includeCommits?: number, includeRefUpdates?: boolean): IPromise; + /** + * Retrieves pushes associated with the specified repository. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @param {Contracts.GitPushSearchCriteria} searchCriteria + * @return IPromise + */ + getPushes(repositoryId: string, project?: string, skip?: number, top?: number, searchCriteria?: Contracts.GitPushSearchCriteria): IPromise; + /** + * Queries the provided repository for its refs and returns them. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {string} filter - [optional] A filter to apply to the refs. + * @param {boolean} includeLinks - [optional] Specifies if referenceLinks should be included in the result. default is false. + * @return IPromise + */ + getRefs(repositoryId: string, project?: string, filter?: string, includeLinks?: boolean): IPromise; + /** + * Creates or updates refs with the given information + * + * @param {Contracts.GitRefUpdate[]} refUpdates - List of ref updates to attempt to perform + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {string} projectId - The id of the project. + * @return IPromise + */ + updateRefs(refUpdates: Contracts.GitRefUpdate[], repositoryId: string, project?: string, projectId?: string): IPromise; + /** + * Create a git repository + * + * @param {Contracts.GitRepository} gitRepositoryToCreate + * @param {string} project - Project ID or project name + * @return IPromise + */ + createRepository(gitRepositoryToCreate: Contracts.GitRepository, project?: string): IPromise; + /** + * Delete a git repository + * + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteRepository(repositoryId: string, project?: string): IPromise; + /** + * Retrieve git repositories. + * + * @param {string} project - Project ID or project name + * @param {boolean} includeLinks + * @return IPromise + */ + getRepositories(project?: string, includeLinks?: boolean): IPromise; + /** + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getRepository(repositoryId: string, project?: string): IPromise; + /** + * Updates the Git repository with the single populated change in the specified repository information. + * + * @param {Contracts.GitRepository} newRepositoryInfo + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateRepository(newRepositoryInfo: Contracts.GitRepository, repositoryId: string, project?: string): IPromise; + /** + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {string} projectId + * @param {boolean} recursive + * @param {string} fileName + * @return IPromise + */ + getTree(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): IPromise; + /** + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {string} projectId + * @param {boolean} recursive + * @param {string} fileName + * @return IPromise + */ + getTreeZip(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): IPromise; +} +export class GitHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlob(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlobContent(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * Gets one or more blobs in a zip file download. + * + * @param {string[]} blobIds + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @param {string} filename + * @return IPromise + */ + getBlobsZip(blobIds: string[], repositoryId: string, project?: string, filename?: string): IPromise; + /** + * Gets a single blob. + * + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {boolean} download + * @param {string} fileName + * @return IPromise + */ + getBlobZip(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): IPromise; + /** + * Retrieve statistics about a single branch. + * + * @param {string} repositoryId - Friendly name or guid of repository + * @param {string} name - Name of the branch + * @param {string} project - Project ID or project name + * @param {Contracts.GitVersionDescriptor} baseVersionDescriptor + * @return IPromise + */ + getBranch(repositoryId: string, name: string, project?: string, baseVersionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Retrieve statistics about all branches within a repository. + * + * @param {string} repositoryId - Friendly name or guid of repository + * @param {string} project - Project ID or project name + * @param {Contracts.GitVersionDescriptor} baseVersionDescriptor + * @return IPromise + */ + getBranches(repositoryId: string, project?: string, baseVersionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Retrieve changes for a particular commit. + * + * @param {string} commitId - The id of the commit. + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} top - The maximum number of changes to return. + * @param {number} skip - The number of changes to skip. + * @return IPromise + */ + getChanges(commitId: string, repositoryId: string, project?: string, top?: number, skip?: number): IPromise; + /** + * Retrieve a particular commit. + * + * @param {string} commitId - The id of the commit. + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} changeCount - The number of changes to include in the result. + * @return IPromise + */ + getCommit(commitId: string, repositoryId: string, project?: string, changeCount?: number): IPromise; + /** + * Retrieve git commits for a project + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {Contracts.GitQueryCommitsCriteria} searchCriteria + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getCommits(repositoryId: string, searchCriteria: Contracts.GitQueryCommitsCriteria, project?: string, skip?: number, top?: number): IPromise; + /** + * Retrieve a list of commits associated with a particular push. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {number} pushId - The id of the push. + * @param {string} project - Project ID or project name + * @param {number} top - The maximum number of commits to return ("get the top x commits"). + * @param {number} skip - The number of commits to skip. + * @param {boolean} includeLinks + * @return IPromise + */ + getPushCommits(repositoryId: string, pushId: number, project?: string, top?: number, skip?: number, includeLinks?: boolean): IPromise; + /** + * Retrieve git commits for a project + * + * @param {Contracts.GitQueryCommitsCriteria} searchCriteria - Search options + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getCommitsBatch(searchCriteria: Contracts.GitQueryCommitsCriteria, repositoryId: string, project?: string, skip?: number, top?: number): IPromise; + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItem(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemContent(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {boolean} includeLinks + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItems(repositoryId: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, includeLinks?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemText(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeContentMetadata + * @param {boolean} latestProcessedChange + * @param {boolean} download + * @param {Contracts.GitVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemZip(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: Contracts.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: Contracts.GitVersionDescriptor): IPromise; + /** + * Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path + * + * @param {Contracts.GitItemRequestData} requestData + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatch(requestData: Contracts.GitItemRequestData, repositoryId: string, project?: string): IPromise; + /** + * Adds a reviewer to a git pull request + * + * @param {Contracts.IdentityRefWithVote} reviewer + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequestReviewer(reviewer: Contracts.IdentityRefWithVote, repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * Adds reviewers to a git pull request + * + * @param {VSS_Common_Contracts.IdentityRef[]} reviewers + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequestReviewers(reviewers: VSS_Common_Contracts.IdentityRef[], repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * Adds reviewers to a git pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deletePullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * Retrieve a reviewer from a pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} reviewerId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getPullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): IPromise; + /** + * Retrieve a pull request reviewers + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getPullRequestReviewers(repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * Create a git pull request + * + * @param {Contracts.GitPullRequest} gitPullRequestToCreate + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPullRequest(gitPullRequestToCreate: Contracts.GitPullRequest, repositoryId: string, project?: string): IPromise; + /** + * Retrieve a pull request + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @param {boolean} includeCommits + * @return IPromise + */ + getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean): IPromise; + /** + * Query for pull requests + * + * @param {string} repositoryId + * @param {Contracts.GitPullRequestSearchCriteria} searchCriteria + * @param {string} project - Project ID or project name + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPullRequests(repositoryId: string, searchCriteria: Contracts.GitPullRequestSearchCriteria, project?: string, maxCommentLength?: number, skip?: number, top?: number): IPromise; + /** + * Updates a pull request + * + * @param {Contracts.GitPullRequest} gitPullRequestToUpdate + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updatePullRequest(gitPullRequestToUpdate: Contracts.GitPullRequest, repositoryId: string, pullRequestId: number, project?: string): IPromise; + /** + * [Preview API] Query pull requests by project + * + * @param {string} project - Project ID or project name + * @param {Contracts.GitPullRequestSearchCriteria} searchCriteria + * @param {number} maxCommentLength + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getPullRequestsByProject(project: string, searchCriteria: Contracts.GitPullRequestSearchCriteria, maxCommentLength?: number, skip?: number, top?: number): IPromise; + /** + * [Preview API] Retrieve a pull request work items + * + * @param {string} repositoryId + * @param {number} pullRequestId + * @param {string} project - Project ID or project name + * @param {number} commitsTop + * @param {number} commitsSkip + * @return IPromise + */ + getPullRequestWorkItems(repositoryId: string, pullRequestId: number, project?: string, commitsTop?: number, commitsSkip?: number): IPromise; + /** + * Push changes to the repository. + * + * @param {Contracts.GitPush} push + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, a project-scoped route must be used. + * @param {string} project - Project ID or project name + * @return IPromise + */ + createPush(push: Contracts.GitPush, repositoryId: string, project?: string): IPromise; + /** + * Retrieve a particular push. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {number} pushId - The id of the push. + * @param {string} project - Project ID or project name + * @param {number} includeCommits - The number of commits to include in the result. + * @param {boolean} includeRefUpdates + * @return IPromise + */ + getPush(repositoryId: string, pushId: number, project?: string, includeCommits?: number, includeRefUpdates?: boolean): IPromise; + /** + * Retrieves pushes associated with the specified repository. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @param {Contracts.GitPushSearchCriteria} searchCriteria + * @return IPromise + */ + getPushes(repositoryId: string, project?: string, skip?: number, top?: number, searchCriteria?: Contracts.GitPushSearchCriteria): IPromise; + /** + * Queries the provided repository for its refs and returns them. + * + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {string} filter - [optional] A filter to apply to the refs. + * @param {boolean} includeLinks - [optional] Specifies if referenceLinks should be included in the result. default is false. + * @return IPromise + */ + getRefs(repositoryId: string, project?: string, filter?: string, includeLinks?: boolean): IPromise; + /** + * Creates or updates refs with the given information + * + * @param {Contracts.GitRefUpdate[]} refUpdates - List of ref updates to attempt to perform + * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + * @param {string} project - Project ID or project name + * @param {string} projectId - The id of the project. + * @return IPromise + */ + updateRefs(refUpdates: Contracts.GitRefUpdate[], repositoryId: string, project?: string, projectId?: string): IPromise; + /** + * Create a git repository + * + * @param {Contracts.GitRepository} gitRepositoryToCreate + * @param {string} project - Project ID or project name + * @return IPromise + */ + createRepository(gitRepositoryToCreate: Contracts.GitRepository, project?: string): IPromise; + /** + * Delete a git repository + * + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + deleteRepository(repositoryId: string, project?: string): IPromise; + /** + * Retrieve git repositories. + * + * @param {string} project - Project ID or project name + * @param {boolean} includeLinks + * @return IPromise + */ + getRepositories(project?: string, includeLinks?: boolean): IPromise; + /** + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getRepository(repositoryId: string, project?: string): IPromise; + /** + * Updates the Git repository with the single populated change in the specified repository information. + * + * @param {Contracts.GitRepository} newRepositoryInfo + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateRepository(newRepositoryInfo: Contracts.GitRepository, repositoryId: string, project?: string): IPromise; + /** + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {string} projectId + * @param {boolean} recursive + * @param {string} fileName + * @return IPromise + */ + getTree(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): IPromise; + /** + * @param {string} repositoryId + * @param {string} sha1 + * @param {string} project - Project ID or project name + * @param {string} projectId + * @param {boolean} recursive + * @param {string} fileName + * @return IPromise + */ + getTreeZip(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): IPromise; +} +export class GitHttpClient extends GitHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return GitHttpClient2_1 + */ +export function getClient(): GitHttpClient2_1; +} +declare module "TFS/VersionControl/TfvcRestClient" { +import TFS_VersionControl_Contracts = require("TFS/VersionControl/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class TfvcHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] Get a single branch hierarchy at the given path with parents or children (if specified) + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {boolean} includeParent + * @param {boolean} includeChildren + * @return IPromise + */ + getBranch(path: string, project?: string, includeParent?: boolean, includeChildren?: boolean): IPromise; + /** + * [Preview API] Get a collection of branch roots -- first-level children, branches with no parents + * + * @param {string} project - Project ID or project name + * @param {boolean} includeParent + * @param {boolean} includeChildren + * @param {boolean} includeDeleted + * @param {boolean} includeLinks + * @return IPromise + */ + getBranches(project?: string, includeParent?: boolean, includeChildren?: boolean, includeDeleted?: boolean, includeLinks?: boolean): IPromise; + /** + * [Preview API] Get branch hierarchies below the specified scopePath + * + * @param {string} scopePath + * @param {string} project - Project ID or project name + * @param {boolean} includeDeleted + * @param {boolean} includeLinks + * @return IPromise + */ + getBranchRefs(scopePath: string, project?: string, includeDeleted?: boolean, includeLinks?: boolean): IPromise; + /** + * [Preview API] Retrieve Tfvc changes for a given changeset + * + * @param {number} id + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getChangesetChanges(id?: number, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {TFS_VersionControl_Contracts.TfvcChangeset} changeset + * @param {string} project - Project ID or project name + * @return IPromise + */ + createChangeset(changeset: TFS_VersionControl_Contracts.TfvcChangeset, project?: string): IPromise; + /** + * [Preview API] Retrieve a Tfvc Changeset + * + * @param {number} id + * @param {string} project - Project ID or project name + * @param {number} maxChangeCount + * @param {boolean} includeDetails + * @param {boolean} includeWorkItems + * @param {number} maxCommentLength + * @param {boolean} includeSourceRename + * @param {number} skip + * @param {number} top + * @param {string} orderby + * @param {TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria} searchCriteria + * @return IPromise + */ + getChangeset(id: number, project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria): IPromise; + /** + * [Preview API] Retrieve Tfvc changesets + * + * @param {string} project - Project ID or project name + * @param {number} maxChangeCount + * @param {boolean} includeDetails + * @param {boolean} includeWorkItems + * @param {number} maxCommentLength + * @param {boolean} includeSourceRename + * @param {number} skip + * @param {number} top + * @param {string} orderby + * @param {TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria} searchCriteria + * @return IPromise + */ + getChangesets(project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria): IPromise; + /** + * [Preview API] + * + * @param {TFS_VersionControl_Contracts.TfvcChangesetsRequestData} changesetsRequestData + * @return IPromise + */ + getBatchedChangesets(changesetsRequestData: TFS_VersionControl_Contracts.TfvcChangesetsRequestData): IPromise; + /** + * [Preview API] + * + * @param {number} id + * @return IPromise + */ + getChangesetWorkItems(id?: number): IPromise; + /** + * [Preview API] Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. + * + * @param {TFS_VersionControl_Contracts.TfvcItemRequestData} itemRequestData + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatch(itemRequestData: TFS_VersionControl_Contracts.TfvcItemRequestData, project?: string): IPromise; + /** + * [Preview API] Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. + * + * @param {TFS_VersionControl_Contracts.TfvcItemRequestData} itemRequestData + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatchZip(itemRequestData: TFS_VersionControl_Contracts.TfvcItemRequestData, project?: string): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItem(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemContent(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * [Preview API] Get a list of Tfvc items + * + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeLinks + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItems(project?: string, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, includeLinks?: boolean, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemText(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * [Preview API] Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemZip(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * [Preview API] Get items under a label. + * + * @param {string} labelId - Unique identifier of label + * @param {number} top - Max number of items to return + * @param {number} skip - Number of items to skip + * @return IPromise + */ + getLabelItems(labelId: string, top?: number, skip?: number): IPromise; + /** + * [Preview API] Get a single deep label. + * + * @param {string} labelId - Unique identifier of label + * @param {TFS_VersionControl_Contracts.TfvcLabelRequestData} requestData - maxItemCount + * @param {string} project - Project ID or project name + * @return IPromise + */ + getLabel(labelId: string, requestData: TFS_VersionControl_Contracts.TfvcLabelRequestData, project?: string): IPromise; + /** + * [Preview API] Get a collection of shallow label references. + * + * @param {TFS_VersionControl_Contracts.TfvcLabelRequestData} requestData - labelScope, name, owner, and itemLabelFilter + * @param {string} project - Project ID or project name + * @param {number} top - Max number of labels to return + * @param {number} skip - Number of labels to skip + * @return IPromise + */ + getLabels(requestData: TFS_VersionControl_Contracts.TfvcLabelRequestData, project?: string, top?: number, skip?: number): IPromise; + /** + * [Obsolete - Use the Projects API instead] Retrieve the version control information for a given Team Project + * + * @param {string} projectId - The id (or name) of the team project + * @param {string} project - Project ID or project name + * @return IPromise + */ + getProjectInfo(projectId: string, project?: string): IPromise; + /** + * [Obsolete - Use the Projects API instead] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getProjectInfos(project?: string): IPromise; + /** + * [Preview API] Get changes included in a shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @param {number} top - Max number of changes to return + * @param {number} skip - Number of changes to skip + * @return IPromise + */ + getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): IPromise; + /** + * [Preview API] Get a single deep shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @param {TFS_VersionControl_Contracts.TfvcShelvesetRequestData} requestData - includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength + * @return IPromise + */ + getShelveset(shelvesetId: string, requestData: TFS_VersionControl_Contracts.TfvcShelvesetRequestData): IPromise; + /** + * [Preview API] Return a collection of shallow shelveset references. + * + * @param {TFS_VersionControl_Contracts.TfvcShelvesetRequestData} requestData - name, owner, and maxCommentLength + * @param {number} top - Max number of shelvesets to return + * @param {number} skip - Number of shelvesets to skip + * @return IPromise + */ + getShelvesets(requestData: TFS_VersionControl_Contracts.TfvcShelvesetRequestData, top?: number, skip?: number): IPromise; + /** + * [Preview API] Get work items associated with a shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @return IPromise + */ + getShelvesetWorkItems(shelvesetId: string): IPromise; +} +export class TfvcHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * Get a single branch hierarchy at the given path with parents or children (if specified) + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {boolean} includeParent + * @param {boolean} includeChildren + * @return IPromise + */ + getBranch(path: string, project?: string, includeParent?: boolean, includeChildren?: boolean): IPromise; + /** + * Get a collection of branch roots -- first-level children, branches with no parents + * + * @param {string} project - Project ID or project name + * @param {boolean} includeParent + * @param {boolean} includeChildren + * @param {boolean} includeDeleted + * @param {boolean} includeLinks + * @return IPromise + */ + getBranches(project?: string, includeParent?: boolean, includeChildren?: boolean, includeDeleted?: boolean, includeLinks?: boolean): IPromise; + /** + * Get branch hierarchies below the specified scopePath + * + * @param {string} scopePath + * @param {string} project - Project ID or project name + * @param {boolean} includeDeleted + * @param {boolean} includeLinks + * @return IPromise + */ + getBranchRefs(scopePath: string, project?: string, includeDeleted?: boolean, includeLinks?: boolean): IPromise; + /** + * Retrieve Tfvc changes for a given changeset + * + * @param {number} id + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getChangesetChanges(id?: number, skip?: number, top?: number): IPromise; + /** + * @param {TFS_VersionControl_Contracts.TfvcChangeset} changeset + * @param {string} project - Project ID or project name + * @return IPromise + */ + createChangeset(changeset: TFS_VersionControl_Contracts.TfvcChangeset, project?: string): IPromise; + /** + * Retrieve a Tfvc Changeset + * + * @param {number} id + * @param {string} project - Project ID or project name + * @param {number} maxChangeCount + * @param {boolean} includeDetails + * @param {boolean} includeWorkItems + * @param {number} maxCommentLength + * @param {boolean} includeSourceRename + * @param {number} skip + * @param {number} top + * @param {string} orderby + * @param {TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria} searchCriteria + * @return IPromise + */ + getChangeset(id: number, project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria): IPromise; + /** + * Retrieve Tfvc changesets + * + * @param {string} project - Project ID or project name + * @param {number} maxChangeCount + * @param {boolean} includeDetails + * @param {boolean} includeWorkItems + * @param {number} maxCommentLength + * @param {boolean} includeSourceRename + * @param {number} skip + * @param {number} top + * @param {string} orderby + * @param {TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria} searchCriteria + * @return IPromise + */ + getChangesets(project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria): IPromise; + /** + * @param {TFS_VersionControl_Contracts.TfvcChangesetsRequestData} changesetsRequestData + * @return IPromise + */ + getBatchedChangesets(changesetsRequestData: TFS_VersionControl_Contracts.TfvcChangesetsRequestData): IPromise; + /** + * @param {number} id + * @return IPromise + */ + getChangesetWorkItems(id?: number): IPromise; + /** + * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. + * + * @param {TFS_VersionControl_Contracts.TfvcItemRequestData} itemRequestData + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatch(itemRequestData: TFS_VersionControl_Contracts.TfvcItemRequestData, project?: string): IPromise; + /** + * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. + * + * @param {TFS_VersionControl_Contracts.TfvcItemRequestData} itemRequestData + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatchZip(itemRequestData: TFS_VersionControl_Contracts.TfvcItemRequestData, project?: string): IPromise; + /** + * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItem(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemContent(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get a list of Tfvc items + * + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeLinks + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItems(project?: string, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, includeLinks?: boolean, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemText(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemZip(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get items under a label. + * + * @param {string} labelId - Unique identifier of label + * @param {number} top - Max number of items to return + * @param {number} skip - Number of items to skip + * @return IPromise + */ + getLabelItems(labelId: string, top?: number, skip?: number): IPromise; + /** + * Get a single deep label. + * + * @param {string} labelId - Unique identifier of label + * @param {TFS_VersionControl_Contracts.TfvcLabelRequestData} requestData - maxItemCount + * @param {string} project - Project ID or project name + * @return IPromise + */ + getLabel(labelId: string, requestData: TFS_VersionControl_Contracts.TfvcLabelRequestData, project?: string): IPromise; + /** + * Get a collection of shallow label references. + * + * @param {TFS_VersionControl_Contracts.TfvcLabelRequestData} requestData - labelScope, name, owner, and itemLabelFilter + * @param {string} project - Project ID or project name + * @param {number} top - Max number of labels to return + * @param {number} skip - Number of labels to skip + * @return IPromise + */ + getLabels(requestData: TFS_VersionControl_Contracts.TfvcLabelRequestData, project?: string, top?: number, skip?: number): IPromise; + /** + * [Obsolete - Use the Projects API instead] Retrieve the version control information for a given Team Project + * + * @param {string} projectId - The id (or name) of the team project + * @param {string} project - Project ID or project name + * @return IPromise + */ + getProjectInfo(projectId: string, project?: string): IPromise; + /** + * [Obsolete - Use the Projects API instead] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getProjectInfos(project?: string): IPromise; + /** + * Get changes included in a shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @param {number} top - Max number of changes to return + * @param {number} skip - Number of changes to skip + * @return IPromise + */ + getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): IPromise; + /** + * Get a single deep shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @param {TFS_VersionControl_Contracts.TfvcShelvesetRequestData} requestData - includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength + * @return IPromise + */ + getShelveset(shelvesetId: string, requestData: TFS_VersionControl_Contracts.TfvcShelvesetRequestData): IPromise; + /** + * Return a collection of shallow shelveset references. + * + * @param {TFS_VersionControl_Contracts.TfvcShelvesetRequestData} requestData - name, owner, and maxCommentLength + * @param {number} top - Max number of shelvesets to return + * @param {number} skip - Number of shelvesets to skip + * @return IPromise + */ + getShelvesets(requestData: TFS_VersionControl_Contracts.TfvcShelvesetRequestData, top?: number, skip?: number): IPromise; + /** + * Get work items associated with a shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @return IPromise + */ + getShelvesetWorkItems(shelvesetId: string): IPromise; +} +export class TfvcHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * Get a single branch hierarchy at the given path with parents or children (if specified) + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {boolean} includeParent + * @param {boolean} includeChildren + * @return IPromise + */ + getBranch(path: string, project?: string, includeParent?: boolean, includeChildren?: boolean): IPromise; + /** + * Get a collection of branch roots -- first-level children, branches with no parents + * + * @param {string} project - Project ID or project name + * @param {boolean} includeParent + * @param {boolean} includeChildren + * @param {boolean} includeDeleted + * @param {boolean} includeLinks + * @return IPromise + */ + getBranches(project?: string, includeParent?: boolean, includeChildren?: boolean, includeDeleted?: boolean, includeLinks?: boolean): IPromise; + /** + * Get branch hierarchies below the specified scopePath + * + * @param {string} scopePath + * @param {string} project - Project ID or project name + * @param {boolean} includeDeleted + * @param {boolean} includeLinks + * @return IPromise + */ + getBranchRefs(scopePath: string, project?: string, includeDeleted?: boolean, includeLinks?: boolean): IPromise; + /** + * Retrieve Tfvc changes for a given changeset + * + * @param {number} id + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getChangesetChanges(id?: number, skip?: number, top?: number): IPromise; + /** + * @param {TFS_VersionControl_Contracts.TfvcChangeset} changeset + * @param {string} project - Project ID or project name + * @return IPromise + */ + createChangeset(changeset: TFS_VersionControl_Contracts.TfvcChangeset, project?: string): IPromise; + /** + * Retrieve a Tfvc Changeset + * + * @param {number} id + * @param {string} project - Project ID or project name + * @param {number} maxChangeCount + * @param {boolean} includeDetails + * @param {boolean} includeWorkItems + * @param {number} maxCommentLength + * @param {boolean} includeSourceRename + * @param {number} skip + * @param {number} top + * @param {string} orderby + * @param {TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria} searchCriteria + * @return IPromise + */ + getChangeset(id: number, project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria): IPromise; + /** + * Retrieve Tfvc changesets + * + * @param {string} project - Project ID or project name + * @param {number} maxChangeCount + * @param {boolean} includeDetails + * @param {boolean} includeWorkItems + * @param {number} maxCommentLength + * @param {boolean} includeSourceRename + * @param {number} skip + * @param {number} top + * @param {string} orderby + * @param {TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria} searchCriteria + * @return IPromise + */ + getChangesets(project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria): IPromise; + /** + * @param {TFS_VersionControl_Contracts.TfvcChangesetsRequestData} changesetsRequestData + * @return IPromise + */ + getBatchedChangesets(changesetsRequestData: TFS_VersionControl_Contracts.TfvcChangesetsRequestData): IPromise; + /** + * @param {number} id + * @return IPromise + */ + getChangesetWorkItems(id?: number): IPromise; + /** + * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. + * + * @param {TFS_VersionControl_Contracts.TfvcItemRequestData} itemRequestData + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatch(itemRequestData: TFS_VersionControl_Contracts.TfvcItemRequestData, project?: string): IPromise; + /** + * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. + * + * @param {TFS_VersionControl_Contracts.TfvcItemRequestData} itemRequestData + * @param {string} project - Project ID or project name + * @return IPromise + */ + getItemsBatchZip(itemRequestData: TFS_VersionControl_Contracts.TfvcItemRequestData, project?: string): IPromise; + /** + * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItem(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemContent(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get a list of Tfvc items + * + * @param {string} project - Project ID or project name + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {boolean} includeLinks + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItems(project?: string, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, includeLinks?: boolean, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemText(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} path + * @param {string} project - Project ID or project name + * @param {string} fileName + * @param {boolean} download + * @param {string} scopePath + * @param {TFS_VersionControl_Contracts.VersionControlRecursionType} recursionLevel + * @param {TFS_VersionControl_Contracts.TfvcVersionDescriptor} versionDescriptor + * @return IPromise + */ + getItemZip(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TFS_VersionControl_Contracts.VersionControlRecursionType, versionDescriptor?: TFS_VersionControl_Contracts.TfvcVersionDescriptor): IPromise; + /** + * Get items under a label. + * + * @param {string} labelId - Unique identifier of label + * @param {number} top - Max number of items to return + * @param {number} skip - Number of items to skip + * @return IPromise + */ + getLabelItems(labelId: string, top?: number, skip?: number): IPromise; + /** + * Get a single deep label. + * + * @param {string} labelId - Unique identifier of label + * @param {TFS_VersionControl_Contracts.TfvcLabelRequestData} requestData - maxItemCount + * @param {string} project - Project ID or project name + * @return IPromise + */ + getLabel(labelId: string, requestData: TFS_VersionControl_Contracts.TfvcLabelRequestData, project?: string): IPromise; + /** + * Get a collection of shallow label references. + * + * @param {TFS_VersionControl_Contracts.TfvcLabelRequestData} requestData - labelScope, name, owner, and itemLabelFilter + * @param {string} project - Project ID or project name + * @param {number} top - Max number of labels to return + * @param {number} skip - Number of labels to skip + * @return IPromise + */ + getLabels(requestData: TFS_VersionControl_Contracts.TfvcLabelRequestData, project?: string, top?: number, skip?: number): IPromise; + /** + * [Obsolete - Use the Projects API instead] Retrieve the version control information for a given Team Project + * + * @param {string} projectId - The id (or name) of the team project + * @param {string} project - Project ID or project name + * @return IPromise + */ + getProjectInfo(projectId: string, project?: string): IPromise; + /** + * [Obsolete - Use the Projects API instead] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getProjectInfos(project?: string): IPromise; + /** + * Get changes included in a shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @param {number} top - Max number of changes to return + * @param {number} skip - Number of changes to skip + * @return IPromise + */ + getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): IPromise; + /** + * Get a single deep shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @param {TFS_VersionControl_Contracts.TfvcShelvesetRequestData} requestData - includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength + * @return IPromise + */ + getShelveset(shelvesetId: string, requestData: TFS_VersionControl_Contracts.TfvcShelvesetRequestData): IPromise; + /** + * Return a collection of shallow shelveset references. + * + * @param {TFS_VersionControl_Contracts.TfvcShelvesetRequestData} requestData - name, owner, and maxCommentLength + * @param {number} top - Max number of shelvesets to return + * @param {number} skip - Number of shelvesets to skip + * @return IPromise + */ + getShelvesets(requestData: TFS_VersionControl_Contracts.TfvcShelvesetRequestData, top?: number, skip?: number): IPromise; + /** + * Get work items associated with a shelveset. + * + * @param {string} shelvesetId - Shelveset's unique ID + * @return IPromise + */ + getShelvesetWorkItems(shelvesetId: string): IPromise; +} +export class TfvcHttpClient extends TfvcHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return TfvcHttpClient2_1 + */ +export function getClient(): TfvcHttpClient2_1; +} +declare module "TFS/VersionControl/UIContracts" { +import VCContracts = require("TFS/VersionControl/Contracts"); +export interface ISourceItem extends VCContracts.ItemModel { + sourceProvider: string; + item: VCContracts.GitItem | VCContracts.TfvcItem; +} +export interface SourceItemContext { + item: ISourceItem; + version: string; + gitRepository?: VCContracts.GitRepository; +} +export interface GitBranchContext { + repository: VCContracts.GitRepository; + ref: VCContracts.GitRef; + view: { + refresh: () => void; + }; +} +export interface GitBranchDiffContext { + gitBranchDiff: VCContracts.GitCommitDiffs; + repository: VCContracts.GitRepository; + view: { + refresh: () => void; + }; +} +export interface ChangeListSourceItemContext { + change: VCContracts.GitChange | VCContracts.TfvcChange; + changeList: VCContracts.ChangeList | VCContracts.ChangeList; +} +} +declare module "TFS/WorkItemTracking/Contracts" { +export interface AttachmentReference { + id: string; + url: string; +} +export interface FieldDependentRule extends WorkItemTrackingResource { + dependentFields: WorkItemFieldReference[]; +} +export interface FieldsToEvaluate { + fields: string[]; + fieldUpdates: { + [key: string]: any; + }; + fieldValues: { + [key: string]: any; + }; + rulesFrom: string[]; +} +export enum FieldType { + String = 0, + Integer = 1, + DateTime = 2, + PlainText = 3, + Html = 4, + TreePath = 5, + History = 6, + Double = 7, + Guid = 8, + Boolean = 9, +} +export enum FieldUsage { + None = 0, + WorkItem = 1, + WorkItemLink = 2, + Tree = 3, + WorkItemTypeExtension = 4, +} +export interface IdentityReference { + id: string; + name: string; + url: string; +} +export interface Link { + attributes: { + [key: string]: any; + }; + rel: string; + title: string; + url: string; +} +export enum LinkQueryMode { + WorkItems = 0, + LinksOneHopMustContain = 1, + LinksOneHopMayContain = 2, + LinksOneHopDoesNotContain = 3, + LinksRecursiveMustContain = 4, + LinksRecursiveMayContain = 5, + LinksRecursiveDoesNotContain = 6, +} +export enum LogicalOperation { + NONE = 0, + AND = 1, + OR = 2, +} +export interface ProjectReference { + id: string; + name: string; + url: string; +} +export enum ProvisioningActionType { + Import = 0, + Validate = 1, +} +export interface ProvisioningResult { + provisioningImportEvents: string[]; +} +export enum QueryExpand { + None = 0, + Wiql = 1, + Clauses = 2, + All = 3, +} +export interface QueryHierarchyItem extends WorkItemTrackingResource { + children: QueryHierarchyItem[]; + clauses: WorkItemQueryClause; + columns: WorkItemFieldReference[]; + filterOptions: LinkQueryMode; + hasChildren: boolean; + id: string; + isDeleted: boolean; + isFolder: boolean; + isInvalidSyntax: boolean; + isPublic: boolean; + linkClauses: WorkItemQueryClause; + name: string; + path: string; + queryType: QueryType; + sortColumns: WorkItemQuerySortColumn[]; + sourceClauses: WorkItemQueryClause; + targetClauses: WorkItemQueryClause; + wiql: string; +} +export enum QueryResultType { + WorkItem = 1, + WorkItemLink = 2, +} +export enum QueryType { + Flat = 1, + Tree = 2, + OneHop = 3, +} +export interface ReportingWorkItemLink { + changedDate: Date; + isActive: boolean; + rel: string; + sourceId: number; + targetId: number; +} +export interface ReportingWorkItemLinksBatch extends StreamedBatch { +} +export interface ReportingWorkItemRevisionsBatch extends StreamedBatch { +} +export interface ReportingWorkItemRevisionsFilter { + /** + * A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. + */ + fields: string[]; + /** + * Return an identity reference instead of a string value for identity fields. + */ + includeIdentityRef: boolean; + /** + * A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. + */ + types: string[]; +} +export interface StreamedBatch { + isLastBatch: boolean; + nextLink: string; + values: T[]; +} +export enum TemplateType { + WorkItemType = 0, + GlobalWorkflow = 1, +} +export enum TreeNodeStructureType { + Area = 0, + Iteration = 1, +} +export enum TreeStructureGroup { + Areas = 0, + Iterations = 1, +} +export interface Wiql { + query: string; +} +export interface WorkItem extends WorkItemTrackingResource { + fields: { + [key: string]: any; + }; + id: number; + relations: WorkItemRelation[]; + rev: number; +} +export interface WorkItemClassificationNode extends WorkItemTrackingResource { + attributes: { + [key: string]: any; + }; + children: WorkItemClassificationNode[]; + id: number; + name: string; + structureType: TreeNodeStructureType; +} +export enum WorkItemExpand { + None = 0, + Relations = 1, + Fields = 2, + All = 3, +} +export interface WorkItemField extends WorkItemTrackingResource { + name: string; + readOnly: boolean; + referenceName: string; + supportedOperations: WorkItemFieldOperation[]; + type: FieldType; +} +export interface WorkItemFieldOperation { + name: string; + referenceName: string; +} +export interface WorkItemFieldReference { + name: string; + referenceName: string; + url: string; +} +export interface WorkItemFieldUpdate { + newValue: any; + oldValue: any; +} +export interface WorkItemHistory extends WorkItemTrackingResource { + rev: number; + revisedBy: IdentityReference; + revisedDate: Date; + value: string; +} +export interface WorkItemLink { + rel: string; + source: WorkItemReference; + target: WorkItemReference; +} +export interface WorkItemQueryClause { + clauses: WorkItemQueryClause[]; + field: WorkItemFieldReference; + fieldValue: WorkItemFieldReference; + isFieldValue: boolean; + logicalOperator: LogicalOperation; + operator: WorkItemFieldOperation; + value: string; +} +export interface WorkItemQueryResult { + asOf: Date; + columns: WorkItemFieldReference[]; + queryResultType: QueryResultType; + queryType: QueryType; + sortColumns: WorkItemQuerySortColumn[]; + workItemRelations: WorkItemLink[]; + workItems: WorkItemReference[]; +} +export interface WorkItemQuerySortColumn { + descending: boolean; + field: WorkItemFieldReference; +} +export interface WorkItemReference { + id: number; + url: string; +} +export interface WorkItemRelation extends Link { +} +export interface WorkItemRelationType extends WorkItemTrackingReference { + attributes: { + [key: string]: any; + }; +} +export interface WorkItemRelationUpdates { + added: WorkItemRelation[]; + removed: WorkItemRelation[]; + updated: WorkItemRelation[]; +} +export interface WorkItemRevisionReference extends WorkItemReference { + rev: number; +} +export interface WorkItemTrackingReference extends WorkItemTrackingResource { + name: string; + referenceName: string; +} +export interface WorkItemTrackingResource extends WorkItemTrackingResourceReference { + _links: any; +} +export interface WorkItemTrackingResourceReference { + url: string; +} +export interface WorkItemType extends WorkItemTrackingResource { + description: string; + fields: WorkItemTypeFieldInstance[]; + name: string; + xmlForm: string; +} +export interface WorkItemTypeCategory extends WorkItemTrackingResource { + defaultWorkItemType: WorkItemTypeReference; + name: string; + referenceName: string; + workItemTypes: WorkItemTypeReference[]; +} +export interface WorkItemTypeFieldInstance { + field: WorkItemFieldReference; + helpText: string; +} +export interface WorkItemTypeReference extends WorkItemTrackingResourceReference { + name: string; +} +export interface WorkItemTypeTemplate { + template: string; +} +export interface WorkItemTypeTemplateUpdateModel { + actionType: ProvisioningActionType; + methodology: string; + template: string; + templateType: TemplateType; +} +export interface WorkItemUpdate extends WorkItemTrackingResourceReference { + fields: { + [key: string]: WorkItemFieldUpdate; + }; + id: number; + relations: WorkItemRelationUpdates; + rev: number; + revisedBy: IdentityReference; + revisedDate: Date; + workItemId: number; +} +export var TypeInfo: { + AttachmentReference: { + fields: any; + }; + FieldDependentRule: { + fields: any; + }; + FieldsToEvaluate: { + fields: any; + }; + FieldType: { + enumValues: { + "string": number; + "integer": number; + "dateTime": number; + "plainText": number; + "html": number; + "treePath": number; + "history": number; + "double": number; + "guid": number; + "boolean": number; + }; + }; + FieldUsage: { + enumValues: { + "none": number; + "workItem": number; + "workItemLink": number; + "tree": number; + "workItemTypeExtension": number; + }; + }; + IdentityReference: { + fields: any; + }; + Link: { + fields: any; + }; + LinkQueryMode: { + enumValues: { + "workItems": number; + "linksOneHopMustContain": number; + "linksOneHopMayContain": number; + "linksOneHopDoesNotContain": number; + "linksRecursiveMustContain": number; + "linksRecursiveMayContain": number; + "linksRecursiveDoesNotContain": number; + }; + }; + LogicalOperation: { + enumValues: { + "nONE": number; + "aND": number; + "oR": number; + }; + }; + ProjectReference: { + fields: any; + }; + ProvisioningActionType: { + enumValues: { + "import": number; + "validate": number; + }; + }; + ProvisioningResult: { + fields: any; + }; + QueryExpand: { + enumValues: { + "none": number; + "wiql": number; + "clauses": number; + "all": number; + }; + }; + QueryHierarchyItem: { + fields: any; + }; + QueryResultType: { + enumValues: { + "workItem": number; + "workItemLink": number; + }; + }; + QueryType: { + enumValues: { + "flat": number; + "tree": number; + "oneHop": number; + }; + }; + ReportingWorkItemLink: { + fields: any; + }; + ReportingWorkItemLinksBatch: { + fields: any; + }; + ReportingWorkItemRevisionsBatch: { + fields: any; + }; + ReportingWorkItemRevisionsFilter: { + fields: any; + }; + StreamedBatch: { + fields: any; + }; + TemplateType: { + enumValues: { + "workItemType": number; + "globalWorkflow": number; + }; + }; + TreeNodeStructureType: { + enumValues: { + "area": number; + "iteration": number; + }; + }; + TreeStructureGroup: { + enumValues: { + "areas": number; + "iterations": number; + }; + }; + Wiql: { + fields: any; + }; + WorkItem: { + fields: any; + }; + WorkItemClassificationNode: { + fields: any; + }; + WorkItemExpand: { + enumValues: { + "none": number; + "relations": number; + "fields": number; + "all": number; + }; + }; + WorkItemField: { + fields: any; + }; + WorkItemFieldOperation: { + fields: any; + }; + WorkItemFieldReference: { + fields: any; + }; + WorkItemFieldUpdate: { + fields: any; + }; + WorkItemHistory: { + fields: any; + }; + WorkItemLink: { + fields: any; + }; + WorkItemQueryClause: { + fields: any; + }; + WorkItemQueryResult: { + fields: any; + }; + WorkItemQuerySortColumn: { + fields: any; + }; + WorkItemReference: { + fields: any; + }; + WorkItemRelation: { + fields: any; + }; + WorkItemRelationType: { + fields: any; + }; + WorkItemRelationUpdates: { + fields: any; + }; + WorkItemRevisionReference: { + fields: any; + }; + WorkItemTrackingReference: { + fields: any; + }; + WorkItemTrackingResource: { + fields: any; + }; + WorkItemTrackingResourceReference: { + fields: any; + }; + WorkItemType: { + fields: any; + }; + WorkItemTypeCategory: { + fields: any; + }; + WorkItemTypeFieldInstance: { + fields: any; + }; + WorkItemTypeReference: { + fields: any; + }; + WorkItemTypeTemplate: { + fields: any; + }; + WorkItemTypeTemplateUpdateModel: { + fields: any; + }; + WorkItemUpdate: { + fields: any; + }; +}; +} +declare module "TFS/WorkItemTracking/ExtensionContracts" { +/** +* Interface defining the arguments for notifications sent by the ActiveWorkItemService +*/ +export interface IWorkItemChangedArgs { + /** + * Id of the work item. + */ + id: number; +} +/** +* Interface defining the arguments for the 'onLoaded' notification sent by the ActiveWorkItemService +*/ +export interface IWorkItemLoadedArgs extends IWorkItemChangedArgs { + /** + * 'true' if the work item is a 'new', unsaved work item, 'false' otherwise. + */ + isNew: boolean; +} +/** +* Interface defining the arguments for the 'onFieldChanged' notification sent by the ActiveWorkItemService +*/ +export interface IWorkItemFieldChangedArgs extends IWorkItemChangedArgs { + /** + * Set of fields that have been changed. 'key' is the field reference name. + */ + changedFields: { + [key: string]: any; + }; +} +/** +* Interface defining notifications provided by the ActiveWorkItemService +*/ +export interface IWorkItemNotificationListener { + /** + * Called when an extension is loaded + * + * @param workItemLoadedArgs Information about the work item that was loaded. + */ + onLoaded(workItemLoadedArgs: IWorkItemLoadedArgs): void; + /** + * Called when a field is modified + * + * @param fieldChangedArgs Information about the work item that was modified and the fields that were changed. + */ + onFieldChanged(fieldChangedArgs: IWorkItemFieldChangedArgs): void; + /** + * Called when a work item is saved + * + * @param savedEventArgs Information about the work item that was saved. + */ + onSaved(savedEventArgs: IWorkItemChangedArgs): void; + /** + * Called when a work item is refreshed + * + * @param refreshEventArgs Information about the work item that was refreshed. + */ + onRefreshed(refreshEventArgs: IWorkItemChangedArgs): void; + /** + * Called when a work item is reset (undo back to unchanged state) + * + * @param undoEventArgs Information about the work item that was reset. + */ + onReset(undoEventArgs: IWorkItemChangedArgs): void; + /** + * Called when a work item is unloaded + * + * @param unloadedEventArgs Information about the work item that was saved. + */ + onUnloaded(unloadedEventArgs: IWorkItemChangedArgs): void; +} +} +declare module "TFS/WorkItemTracking/ProcessContracts" { +import VSS_Identities_Contracts = require("VSS/Identities/Contracts"); +export interface AttachmentReference { + id: string; + url: string; +} +export enum ClauseType { + SourceClause = 0, + TargetClause = 1, + LinkClause = 2, +} +export interface ConstantSetReference { + direct: boolean; + excludeGroups: boolean; + handle: number; + id: number; + identityDescriptor: VSS_Identities_Contracts.IdentityDescriptor; + includeTop: boolean; + teamFoundationId: string; +} +export interface FieldDependentRule extends WorkItemTrackingResource { + dependentFields: WorkItemFieldReference[]; +} +export enum FieldType { + String = 1, + Integer = 2, + DateTime = 3, + PlainText = 5, + Html = 7, + TreePath = 8, + History = 9, + Double = 10, + Guid = 11, + Boolean = 12, +} +export enum FieldUsage { + None = 0, + WorkItem = 1, + WorkItemLink = 2, + Tree = 4, + WorkItemTypeExtension = 8, +} +export interface IdentityReference { + id: string; + name: string; + url: string; +} +export interface JsonBatchHttpRequest { +} +export interface JsonBatchHttpResponse { +} +export interface JsonHttpRequest { + body: any; + headers: { + [key: string]: string; + }; + method: string; + uri: string; +} +export interface JsonHttpResponse { + body: string; + code: number; + headers: { + [key: string]: string; + }; +} +export interface Link { + attributes: { + [key: string]: any; + }; + rel: string; + title: string; + url: string; +} +export enum LinkQueryMode { + WorkItems = 0, + LinksOneHopMustContain = 1, + LinksOneHopMayContain = 2, + LinksOneHopDoesNotContain = 3, + LinksRecursiveMustContain = 4, + LinksRecursiveMayContain = 5, + LinksRecursiveDoesNotContain = 6, +} +export enum LogicalOperation { + NONE = 0, + AND = 1, + OR = 2, +} +export interface MapCase extends MapValues { + value: string; +} +export interface MapValues { + default: string; + values: string[]; +} +export interface ProcessField { + description: string; + id: string; + name: string; + type: string; + url: string; +} +export interface ProcessFieldRule { + rule: string; + value: string; +} +export interface ProcessWorkItemTypeField { + id: string; + rules: ProcessFieldRule[]; + url: string; +} +export interface ProcessWorkItemTypeModel { + description: string; + id: string; + /** + * Parent WIT Id/Internal ReferenceName that it inherits from + */ + inherits: string; + name: string; + url: string; +} +export interface ProvisioningResult { + provisioningImportEvents: string[]; +} +export enum QueryExpand { + None = 0, + Wiql = 1, + Clauses = 2, + All = 3, +} +export interface QueryHierarchyItem extends WorkItemTrackingResource { + children: QueryHierarchyItem[]; + clauses: WorkItemQueryClause; + columns: WorkItemFieldReference[]; + filterOptions: LinkQueryMode; + hasChildren: boolean; + id: string; + isDeleted: boolean; + isFolder: boolean; + isInvalidSyntax: boolean; + isPublic: boolean; + linkClauses: WorkItemQueryClause; + name: string; + path: string; + queryType: QueryType; + sortColumns: WorkItemQuerySortColumn[]; + sourceClauses: WorkItemQueryClause; + targetClauses: WorkItemQueryClause; + wiql: string; +} +export enum QueryResultType { + WorkItem = 1, + WorkItemLink = 2, +} +export enum QueryType { + Flat = 1, + Tree = 2, + OneHop = 3, +} +export interface ReportingWorkItemLink { + changedDate: Date; + isActive: boolean; + rel: string; + sourceId: number; + targetId: number; +} +export interface ReportingWorkItemLinksBatch extends StreamedBatch { +} +export interface ReportingWorkItemRevisionsBatch extends StreamedBatch { +} +export interface ReportingWorkItemRevisionsFilter { + fields: string[]; + includeIdentityRef: boolean; + types: string[]; +} +export enum RuleEnginePhase { + None = 0, + CopyRules = 1, + DefaultRules = 2, + OtherRules = 4, +} +export enum RuleValueFrom { + Value = 1, + CurrentValue = 2, + OriginalValue = 4, + OtherFieldCurrentValue = 8, + OtherFieldOriginalValue = 16, + CurrentUser = 32, + Clock = 64, +} +export enum ServerDefaultType { + ServerDateTime = 1, + CallerIdentity = 2, + RandomGuid = 3, +} +export interface StreamedBatch { + isLastBatch: boolean; + nextLink: string; + values: T[]; +} +export enum TemplateType { + WorkItemType = 0, + GlobalWorkflow = 1, +} +export enum TreeNodeStructureType { + Area = 1, + Iteration = 2, +} +export enum TreeStructureGroup { + Areas = 1, + Iterations = 2, +} +export interface WorkItem extends WorkItemTrackingResource { + fields: { + [key: string]: any; + }; + id: number; + relations: WorkItemRelation[]; + rev: number; +} +export interface WorkItemClassificationNode extends WorkItemTrackingResource { + attributes: { + [key: string]: any; + }; + children: WorkItemClassificationNode[]; + hasChildren: boolean; + id: number; + name: string; + structureType: TreeNodeStructureType; +} +export enum WorkItemExpand { + None = 0, + Relations = 1, + Fields = 2, + Links = 3, + All = 4, +} +export interface WorkItemField extends WorkItemTrackingResource { + name: string; + readOnly: boolean; + referenceName: string; + supportedOperations: WorkItemFieldOperation[]; + type: FieldType; +} +export interface WorkItemFieldOperation { + name: string; + referenceName: string; +} +export interface WorkItemFieldReference { + name: string; + referenceName: string; + url: string; +} +export interface WorkItemFieldUpdate { + newValue: any; + oldValue: any; +} +export interface WorkItemHistory extends WorkItemTrackingResource { + rev: number; + revisedBy: IdentityReference; + revisedDate: Date; + value: string; +} +export interface WorkItemLink { + rel: string; + source: WorkItemReference; + target: WorkItemReference; +} +export interface WorkItemQueryClause { + clauses: WorkItemQueryClause[]; + field: WorkItemFieldReference; + fieldValue: WorkItemFieldReference; + isFieldValue: boolean; + logicalOperator: LogicalOperation; + operator: WorkItemFieldOperation; + value: string; +} +export interface WorkItemQueryResult { + asOf: Date; + columns: WorkItemFieldReference[]; + queryResultType: QueryResultType; + queryType: QueryType; + sortColumns: WorkItemQuerySortColumn[]; + workItemRelations: WorkItemLink[]; + workItems: WorkItemReference[]; +} +export interface WorkItemQuerySortColumn { + descending: boolean; + field: WorkItemFieldReference; +} +export interface WorkItemReference { + id: number; + url: string; +} +export interface WorkItemRelation extends Link { +} +export interface WorkItemRelationType extends WorkItemTrackingReference { + attributes: { + [key: string]: any; + }; +} +export enum WorkItemRelationTypeUsage { + WorkItemLink = 0, + ResourceLink = 1, +} +export interface WorkItemRelationUpdates { + added: WorkItemRelation[]; + removed: WorkItemRelation[]; + updated: WorkItemRelation[]; +} +export interface WorkItemRevisionReference extends WorkItemReference { + rev: number; +} +export interface WorkItemRule { + cases: MapCase[]; + checkOriginalValue: boolean; + else: MapValues; + field: string; + fields: string[]; + for: string; + from: ServerDefaultType; + inverse: boolean; + name: WorkItemRuleName; + not: string; + phase: RuleEnginePhase; + ruleWeight: number; + sets: ConstantSetReference[]; + subRules: WorkItemRule[]; + value: string; + valueFrom: RuleValueFrom; + values: string[]; +} +export enum WorkItemRuleName { + Block = 0, + Required = 1, + ReadOnly = 2, + Empty = 3, + Frozen = 4, + CannotLoseValue = 5, + OtherField = 6, + ValidUser = 7, + AllowExistingValue = 8, + Match = 9, + AllowedValues = 10, + SuggestedValues = 11, + ProhibitedValues = 12, + Default = 13, + Copy = 14, + ServerDefault = 15, + Map = 16, + When = 17, + WhenWas = 18, + WhenChanged = 19, + WhenBecameNonEmpty = 20, + WhenRemainedNonEmpty = 21, + Computed = 22, + Trigger = 23, + Collection = 24, + Project = 25, + WorkItemType = 26, +} +export interface WorkItemStateTransition { + actions: string[]; + to: string; +} +export interface WorkItemTrackingReference extends WorkItemTrackingResource { + name: string; + referenceName: string; +} +export interface WorkItemTrackingResource extends WorkItemTrackingResourceReference { + _links: any; +} +export interface WorkItemTrackingResourceReference { + url: string; +} +export interface WorkItemType extends WorkItemTrackingResource { + description: string; + fieldInstances: WorkItemTypeFieldInstance[]; + name: string; + transitions: { + [key: string]: WorkItemStateTransition[]; + }; + xmlForm: string; +} +export interface WorkItemTypeCategory extends WorkItemTrackingResource { + defaultWorkItemType: WorkItemTypeReference; + name: string; + referenceName: string; + workItemTypes: WorkItemTypeReference[]; +} +export interface WorkItemTypeFieldInstance extends WorkItemFieldReference { + helpText: string; + rules: WorkItemRule[]; +} +export interface WorkItemTypeReference extends WorkItemTrackingResourceReference { + name: string; +} +export interface WorkItemTypeTemplate { + template: string; +} +export interface WorkItemUpdate extends WorkItemTrackingResource { + fields: { + [key: string]: WorkItemFieldUpdate; + }; + id: number; + relations: WorkItemRelationUpdates; + rev: number; + revisedBy: IdentityReference; + revisedDate: Date; + workItemId: number; +} +export enum WorkItemUpdateType { + Create = 0, + Update = 1, +} +export var TypeInfo: { + AttachmentReference: { + fields: any; + }; + ClauseType: { + enumValues: { + "sourceClause": number; + "targetClause": number; + "linkClause": number; + }; + }; + ConstantSetReference: { + fields: any; + }; + FieldDependentRule: { + fields: any; + }; + FieldType: { + enumValues: { + "string": number; + "integer": number; + "dateTime": number; + "plainText": number; + "html": number; + "treePath": number; + "history": number; + "double": number; + "guid": number; + "boolean": number; + }; + }; + FieldUsage: { + enumValues: { + "none": number; + "workItem": number; + "workItemLink": number; + "tree": number; + "workItemTypeExtension": number; + }; + }; + IdentityReference: { + fields: any; + }; + JsonBatchHttpRequest: { + fields: any; + }; + JsonBatchHttpResponse: { + fields: any; + }; + JsonHttpRequest: { + fields: any; + }; + JsonHttpResponse: { + fields: any; + }; + Link: { + fields: any; + }; + LinkQueryMode: { + enumValues: { + "workItems": number; + "linksOneHopMustContain": number; + "linksOneHopMayContain": number; + "linksOneHopDoesNotContain": number; + "linksRecursiveMustContain": number; + "linksRecursiveMayContain": number; + "linksRecursiveDoesNotContain": number; + }; + }; + LogicalOperation: { + enumValues: { + "nONE": number; + "aND": number; + "oR": number; + }; + }; + MapCase: { + fields: any; + }; + MapValues: { + fields: any; + }; + ProcessField: { + fields: any; + }; + ProcessFieldRule: { + fields: any; + }; + ProcessWorkItemTypeField: { + fields: any; + }; + ProcessWorkItemTypeModel: { + fields: any; + }; + ProvisioningResult: { + fields: any; + }; + QueryExpand: { + enumValues: { + "none": number; + "wiql": number; + "clauses": number; + "all": number; + }; + }; + QueryHierarchyItem: { + fields: any; + }; + QueryResultType: { + enumValues: { + "workItem": number; + "workItemLink": number; + }; + }; + QueryType: { + enumValues: { + "flat": number; + "tree": number; + "oneHop": number; + }; + }; + ReportingWorkItemLink: { + fields: any; + }; + ReportingWorkItemLinksBatch: { + fields: any; + }; + ReportingWorkItemRevisionsBatch: { + fields: any; + }; + ReportingWorkItemRevisionsFilter: { + fields: any; + }; + RuleEnginePhase: { + enumValues: { + "none": number; + "copyRules": number; + "defaultRules": number; + "otherRules": number; + }; + }; + RuleValueFrom: { + enumValues: { + "value": number; + "currentValue": number; + "originalValue": number; + "otherFieldCurrentValue": number; + "otherFieldOriginalValue": number; + "currentUser": number; + "clock": number; + }; + }; + ServerDefaultType: { + enumValues: { + "serverDateTime": number; + "callerIdentity": number; + "randomGuid": number; + }; + }; + StreamedBatch: { + fields: any; + }; + TemplateType: { + enumValues: { + "workItemType": number; + "globalWorkflow": number; + }; + }; + TreeNodeStructureType: { + enumValues: { + "area": number; + "iteration": number; + }; + }; + TreeStructureGroup: { + enumValues: { + "areas": number; + "iterations": number; + }; + }; + WorkItem: { + fields: any; + }; + WorkItemClassificationNode: { + fields: any; + }; + WorkItemExpand: { + enumValues: { + "none": number; + "relations": number; + "fields": number; + "links": number; + "all": number; + }; + }; + WorkItemField: { + fields: any; + }; + WorkItemFieldOperation: { + fields: any; + }; + WorkItemFieldReference: { + fields: any; + }; + WorkItemFieldUpdate: { + fields: any; + }; + WorkItemHistory: { + fields: any; + }; + WorkItemLink: { + fields: any; + }; + WorkItemQueryClause: { + fields: any; + }; + WorkItemQueryResult: { + fields: any; + }; + WorkItemQuerySortColumn: { + fields: any; + }; + WorkItemReference: { + fields: any; + }; + WorkItemRelation: { + fields: any; + }; + WorkItemRelationType: { + fields: any; + }; + WorkItemRelationTypeUsage: { + enumValues: { + "workItemLink": number; + "resourceLink": number; + }; + }; + WorkItemRelationUpdates: { + fields: any; + }; + WorkItemRevisionReference: { + fields: any; + }; + WorkItemRule: { + fields: any; + }; + WorkItemRuleName: { + enumValues: { + "block": number; + "required": number; + "readOnly": number; + "empty": number; + "frozen": number; + "cannotLoseValue": number; + "otherField": number; + "validUser": number; + "allowExistingValue": number; + "match": number; + "allowedValues": number; + "suggestedValues": number; + "prohibitedValues": number; + "default": number; + "copy": number; + "serverDefault": number; + "map": number; + "when": number; + "whenWas": number; + "whenChanged": number; + "whenBecameNonEmpty": number; + "whenRemainedNonEmpty": number; + "computed": number; + "trigger": number; + "collection": number; + "project": number; + "workItemType": number; + }; + }; + WorkItemStateTransition: { + fields: any; + }; + WorkItemTrackingReference: { + fields: any; + }; + WorkItemTrackingResource: { + fields: any; + }; + WorkItemTrackingResourceReference: { + fields: any; + }; + WorkItemType: { + fields: any; + }; + WorkItemTypeCategory: { + fields: any; + }; + WorkItemTypeFieldInstance: { + fields: any; + }; + WorkItemTypeReference: { + fields: any; + }; + WorkItemTypeTemplate: { + fields: any; + }; + WorkItemUpdate: { + fields: any; + }; + WorkItemUpdateType: { + enumValues: { + "create": number; + "update": number; + }; + }; +}; +} +declare module "TFS/WorkItemTracking/ProcessDefinitionsContracts" { +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_Identities_Contracts = require("VSS/Identities/Contracts"); +export interface AttachmentReference { + id: string; + url: string; +} +export enum ClauseType { + SourceClause = 0, + TargetClause = 1, + LinkClause = 2, +} +export interface ConstantSetReference { + direct: boolean; + excludeGroups: boolean; + handle: number; + id: number; + identityDescriptor: VSS_Identities_Contracts.IdentityDescriptor; + includeTop: boolean; + teamFoundationId: string; +} +/** + * Represent a control in the form. + */ +export interface Control { + /** + * Type of the control. + */ + controlType: string; + /** + * Id for the control + */ + id: string; + /** + * Label for the field + */ + label: string; + /** + * Inner text of the control. + */ + metadata: string; + /** + * Order in which the control should appear in its group. + */ + order: number; + /** + * A value indicating if the control is readonly. + */ + readOnly: boolean; + /** + * A value indicating if the control should be hidden or not. + */ + visible: boolean; + /** + * Watermark text for the textbox. + */ + watermark: string; +} +export interface FieldData { + label: string; + order: number; + readOnly: boolean; + visible: boolean; +} +export interface FieldDependentRule extends WorkItemTrackingResource { + dependentFields: WorkItemFieldReference[]; +} +export interface FieldModel { + description: string; + id: string; + name: string; + type: string; + url: string; +} +export interface FieldRuleModel { + rule: string; + value: string; +} +export enum FieldType { + String = 1, + Integer = 2, + DateTime = 3, + PlainText = 5, + Html = 7, + TreePath = 8, + History = 9, + Double = 10, + Guid = 11, + Boolean = 12, +} +export interface FieldUpdate { + description: string; + id: string; +} +export enum FieldUsage { + None = 0, + WorkItem = 1, + WorkItemLink = 2, + Tree = 4, + WorkItemTypeExtension = 8, +} +/** + * Represent a group in the form that holds controls in it. + */ +export interface Group { + /** + * Controls to be put in the group. + */ + controls: Control[]; + /** + * Id for the group + */ + id: string; + /** + * Label for the group. + */ + label: string; + /** + * Order in which the group should appear in the section. + */ + order: number; + /** + * A value indicating if the group should be hidden or not. + */ + visible: boolean; +} +export interface IdentityReference { + id: string; + name: string; + url: string; +} +export interface JsonBatchHttpRequest { +} +export interface JsonBatchHttpResponse { +} +export interface JsonHttpRequest { + body: any; + headers: { + [key: string]: string; + }; + method: string; + uri: string; +} +export interface JsonHttpResponse { + body: string; + code: number; + headers: { + [key: string]: string; + }; +} +export interface Link { + attributes: { + [key: string]: any; + }; + rel: string; + title: string; + url: string; +} +export enum LinkQueryMode { + WorkItems = 0, + LinksOneHopMustContain = 1, + LinksOneHopMayContain = 2, + LinksOneHopDoesNotContain = 3, + LinksRecursiveMustContain = 4, + LinksRecursiveMayContain = 5, + LinksRecursiveDoesNotContain = 6, +} +export enum LogicalOperation { + NONE = 0, + AND = 1, + OR = 2, +} +export interface MapCase extends MapValues { + value: string; +} +export interface MapValues { + default: string; + values: string[]; +} +export interface ProvisioningResult { + provisioningImportEvents: string[]; +} +export enum QueryExpand { + None = 0, + Wiql = 1, + Minimal = 2, + Clauses = 3, + All = 4, +} +export interface QueryHierarchyItem extends WorkItemTrackingResource { + children: QueryHierarchyItem[]; + clauses: WorkItemQueryClause; + columns: WorkItemFieldReference[]; + createdBy: VSS_Common_Contracts.IdentityRef; + createdDate: Date; + filterOptions: LinkQueryMode; + hasChildren: boolean; + id: string; + isDeleted: boolean; + isFolder: boolean; + isInvalidSyntax: boolean; + isPublic: boolean; + lastModifiedBy: VSS_Common_Contracts.IdentityRef; + lastModifiedDate: Date; + linkClauses: WorkItemQueryClause; + name: string; + path: string; + queryType: QueryType; + sortColumns: WorkItemQuerySortColumn[]; + sourceClauses: WorkItemQueryClause; + targetClauses: WorkItemQueryClause; + wiql: string; +} +export enum QueryResultType { + WorkItem = 1, + WorkItemLink = 2, +} +export enum QueryType { + Flat = 1, + Tree = 2, + OneHop = 3, +} +export interface ReportingWorkItemLink { + changedDate: Date; + isActive: boolean; + rel: string; + sourceId: number; + targetId: number; +} +export interface ReportingWorkItemLinksBatch extends StreamedBatch { +} +export interface ReportingWorkItemRevisionsBatch extends StreamedBatch { +} +export interface ReportingWorkItemRevisionsFilter { + /** + * A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. + */ + fields: string[]; + /** + * Return an identity reference instead of a string value for identity fields. + */ + includeIdentityRef: boolean; + /** + * A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. + */ + types: string[]; +} +export enum RuleEnginePhase { + None = 0, + CopyRules = 1, + DefaultRules = 2, + OtherRules = 4, +} +export enum RuleValueFrom { + Value = 1, + CurrentValue = 2, + OriginalValue = 4, + OtherFieldCurrentValue = 8, + OtherFieldOriginalValue = 16, + CurrentUser = 32, + Clock = 64, +} +export enum ServerDefaultType { + ServerDateTime = 1, + CallerIdentity = 2, + RandomGuid = 3, +} +export interface StreamedBatch { + isLastBatch: boolean; + nextLink: string; + values: T[]; +} +export enum TemplateType { + WorkItemType = 0, + GlobalWorkflow = 1, +} +export enum TreeNodeStructureType { + Area = 1, + Iteration = 2, +} +export enum TreeStructureGroup { + Areas = 1, + Iterations = 2, +} +export interface WorkItem extends WorkItemTrackingResource { + fields: { + [key: string]: any; + }; + id: number; + relations: WorkItemRelation[]; + rev: number; +} +export interface WorkItemClassificationNode extends WorkItemTrackingResource { + attributes: { + [key: string]: any; + }; + children: WorkItemClassificationNode[]; + hasChildren: boolean; + id: number; + name: string; + structureType: TreeNodeStructureType; +} +export enum WorkItemExpand { + None = 0, + Relations = 1, + Fields = 2, + Links = 3, + All = 4, +} +export interface WorkItemField extends WorkItemTrackingResource { + name: string; + readOnly: boolean; + referenceName: string; + supportedOperations: WorkItemFieldOperation[]; + type: FieldType; +} +export interface WorkItemFieldOperation { + name: string; + referenceName: string; +} +export interface WorkItemFieldReference { + name: string; + referenceName: string; + url: string; +} +export interface WorkItemFieldUpdate { + newValue: any; + oldValue: any; +} +export interface WorkItemHistory extends WorkItemTrackingResource { + rev: number; + revisedBy: IdentityReference; + revisedDate: Date; + value: string; +} +export interface WorkItemLink { + rel: string; + source: WorkItemReference; + target: WorkItemReference; +} +export interface WorkItemQueryClause { + clauses: WorkItemQueryClause[]; + field: WorkItemFieldReference; + fieldValue: WorkItemFieldReference; + isFieldValue: boolean; + logicalOperator: LogicalOperation; + operator: WorkItemFieldOperation; + value: string; +} +export interface WorkItemQueryResult { + asOf: Date; + columns: WorkItemFieldReference[]; + queryResultType: QueryResultType; + queryType: QueryType; + sortColumns: WorkItemQuerySortColumn[]; + workItemRelations: WorkItemLink[]; + workItems: WorkItemReference[]; +} +export interface WorkItemQuerySortColumn { + descending: boolean; + field: WorkItemFieldReference; +} +export interface WorkItemReference { + id: number; + url: string; +} +export interface WorkItemRelation extends Link { +} +export interface WorkItemRelationType extends WorkItemTrackingReference { + attributes: { + [key: string]: any; + }; +} +export enum WorkItemRelationTypeUsage { + WorkItemLink = 0, + ResourceLink = 1, +} +export interface WorkItemRelationUpdates { + added: WorkItemRelation[]; + removed: WorkItemRelation[]; + updated: WorkItemRelation[]; +} +export interface WorkItemRevisionReference extends WorkItemReference { + rev: number; +} +export interface WorkItemRule { + cases: MapCase[]; + checkOriginalValue: boolean; + else: MapValues; + field: string; + fields: string[]; + for: string; + from: ServerDefaultType; + inverse: boolean; + name: WorkItemRuleName; + not: string; + phase: RuleEnginePhase; + ruleWeight: number; + sets: ConstantSetReference[]; + subRules: WorkItemRule[]; + value: string; + valueFrom: RuleValueFrom; + values: string[]; +} +export enum WorkItemRuleName { + Block = 0, + Required = 1, + ReadOnly = 2, + Empty = 3, + Frozen = 4, + CannotLoseValue = 5, + OtherField = 6, + ValidUser = 7, + AllowExistingValue = 8, + Match = 9, + AllowedValues = 10, + SuggestedValues = 11, + ProhibitedValues = 12, + Default = 13, + Copy = 14, + ServerDefault = 15, + Map = 16, + When = 17, + WhenWas = 18, + WhenChanged = 19, + WhenBecameNonEmpty = 20, + WhenRemainedNonEmpty = 21, + Computed = 22, + Trigger = 23, + Collection = 24, + Project = 25, + WorkItemType = 26, +} +export interface WorkItemStateTransition { + actions: string[]; + to: string; +} +export interface WorkItemTrackingReference extends WorkItemTrackingResource { + name: string; + referenceName: string; +} +export interface WorkItemTrackingResource extends WorkItemTrackingResourceReference { + _links: any; +} +export interface WorkItemTrackingResourceReference { + url: string; +} +export interface WorkItemType extends WorkItemTrackingResource { + description: string; + fieldInstances: WorkItemTypeFieldInstance[]; + name: string; + transitions: { + [key: string]: WorkItemStateTransition[]; + }; + xmlForm: string; +} +export interface WorkItemTypeCategory extends WorkItemTrackingResource { + defaultWorkItemType: WorkItemTypeReference; + name: string; + referenceName: string; + workItemTypes: WorkItemTypeReference[]; +} +export interface WorkItemTypeFieldInstance extends WorkItemFieldReference { + helpText: string; + rules: WorkItemRule[]; +} +export interface WorkItemTypeFieldModel { + id: string; + rules: FieldRuleModel[]; + url: string; +} +export interface WorkItemTypeModel { + description: string; + id: string; + /** + * Parent WIT Id/Internal ReferenceName that it inherits from + */ + inherits: string; + name: string; + url: string; +} +export interface WorkItemTypeReference extends WorkItemTrackingResourceReference { + name: string; +} +export interface WorkItemTypeTemplate { + template: string; +} +export interface WorkItemUpdate extends WorkItemTrackingResource { + fields: { + [key: string]: WorkItemFieldUpdate; + }; + id: number; + relations: WorkItemRelationUpdates; + rev: number; + revisedBy: IdentityReference; + revisedDate: Date; + workItemId: number; +} +export enum WorkItemUpdateType { + Create = 0, + Update = 1, +} +export var TypeInfo: { + AttachmentReference: { + fields: any; + }; + ClauseType: { + enumValues: { + "sourceClause": number; + "targetClause": number; + "linkClause": number; + }; + }; + ConstantSetReference: { + fields: any; + }; + Control: { + fields: any; + }; + FieldData: { + fields: any; + }; + FieldDependentRule: { + fields: any; + }; + FieldModel: { + fields: any; + }; + FieldRuleModel: { + fields: any; + }; + FieldType: { + enumValues: { + "string": number; + "integer": number; + "dateTime": number; + "plainText": number; + "html": number; + "treePath": number; + "history": number; + "double": number; + "guid": number; + "boolean": number; + }; + }; + FieldUpdate: { + fields: any; + }; + FieldUsage: { + enumValues: { + "none": number; + "workItem": number; + "workItemLink": number; + "tree": number; + "workItemTypeExtension": number; + }; + }; + Group: { + fields: any; + }; + IdentityReference: { + fields: any; + }; + JsonBatchHttpRequest: { + fields: any; + }; + JsonBatchHttpResponse: { + fields: any; + }; + JsonHttpRequest: { + fields: any; + }; + JsonHttpResponse: { + fields: any; + }; + Link: { + fields: any; + }; + LinkQueryMode: { + enumValues: { + "workItems": number; + "linksOneHopMustContain": number; + "linksOneHopMayContain": number; + "linksOneHopDoesNotContain": number; + "linksRecursiveMustContain": number; + "linksRecursiveMayContain": number; + "linksRecursiveDoesNotContain": number; + }; + }; + LogicalOperation: { + enumValues: { + "nONE": number; + "aND": number; + "oR": number; + }; + }; + MapCase: { + fields: any; + }; + MapValues: { + fields: any; + }; + ProvisioningResult: { + fields: any; + }; + QueryExpand: { + enumValues: { + "none": number; + "wiql": number; + "minimal": number; + "clauses": number; + "all": number; + }; + }; + QueryHierarchyItem: { + fields: any; + }; + QueryResultType: { + enumValues: { + "workItem": number; + "workItemLink": number; + }; + }; + QueryType: { + enumValues: { + "flat": number; + "tree": number; + "oneHop": number; + }; + }; + ReportingWorkItemLink: { + fields: any; + }; + ReportingWorkItemLinksBatch: { + fields: any; + }; + ReportingWorkItemRevisionsBatch: { + fields: any; + }; + ReportingWorkItemRevisionsFilter: { + fields: any; + }; + RuleEnginePhase: { + enumValues: { + "none": number; + "copyRules": number; + "defaultRules": number; + "otherRules": number; + }; + }; + RuleValueFrom: { + enumValues: { + "value": number; + "currentValue": number; + "originalValue": number; + "otherFieldCurrentValue": number; + "otherFieldOriginalValue": number; + "currentUser": number; + "clock": number; + }; + }; + ServerDefaultType: { + enumValues: { + "serverDateTime": number; + "callerIdentity": number; + "randomGuid": number; + }; + }; + StreamedBatch: { + fields: any; + }; + TemplateType: { + enumValues: { + "workItemType": number; + "globalWorkflow": number; + }; + }; + TreeNodeStructureType: { + enumValues: { + "area": number; + "iteration": number; + }; + }; + TreeStructureGroup: { + enumValues: { + "areas": number; + "iterations": number; + }; + }; + WorkItem: { + fields: any; + }; + WorkItemClassificationNode: { + fields: any; + }; + WorkItemExpand: { + enumValues: { + "none": number; + "relations": number; + "fields": number; + "links": number; + "all": number; + }; + }; + WorkItemField: { + fields: any; + }; + WorkItemFieldOperation: { + fields: any; + }; + WorkItemFieldReference: { + fields: any; + }; + WorkItemFieldUpdate: { + fields: any; + }; + WorkItemHistory: { + fields: any; + }; + WorkItemLink: { + fields: any; + }; + WorkItemQueryClause: { + fields: any; + }; + WorkItemQueryResult: { + fields: any; + }; + WorkItemQuerySortColumn: { + fields: any; + }; + WorkItemReference: { + fields: any; + }; + WorkItemRelation: { + fields: any; + }; + WorkItemRelationType: { + fields: any; + }; + WorkItemRelationTypeUsage: { + enumValues: { + "workItemLink": number; + "resourceLink": number; + }; + }; + WorkItemRelationUpdates: { + fields: any; + }; + WorkItemRevisionReference: { + fields: any; + }; + WorkItemRule: { + fields: any; + }; + WorkItemRuleName: { + enumValues: { + "block": number; + "required": number; + "readOnly": number; + "empty": number; + "frozen": number; + "cannotLoseValue": number; + "otherField": number; + "validUser": number; + "allowExistingValue": number; + "match": number; + "allowedValues": number; + "suggestedValues": number; + "prohibitedValues": number; + "default": number; + "copy": number; + "serverDefault": number; + "map": number; + "when": number; + "whenWas": number; + "whenChanged": number; + "whenBecameNonEmpty": number; + "whenRemainedNonEmpty": number; + "computed": number; + "trigger": number; + "collection": number; + "project": number; + "workItemType": number; + }; + }; + WorkItemStateTransition: { + fields: any; + }; + WorkItemTrackingReference: { + fields: any; + }; + WorkItemTrackingResource: { + fields: any; + }; + WorkItemTrackingResourceReference: { + fields: any; + }; + WorkItemType: { + fields: any; + }; + WorkItemTypeCategory: { + fields: any; + }; + WorkItemTypeFieldInstance: { + fields: any; + }; + WorkItemTypeFieldModel: { + fields: any; + }; + WorkItemTypeModel: { + fields: any; + }; + WorkItemTypeReference: { + fields: any; + }; + WorkItemTypeTemplate: { + fields: any; + }; + WorkItemUpdate: { + fields: any; + }; + WorkItemUpdateType: { + enumValues: { + "create": number; + "update": number; + }; + }; +}; +} +declare module "TFS/WorkItemTracking/ProcessDefinitionsRestClient" { +import ProcessDefinitionsContracts = require("TFS/WorkItemTracking/ProcessDefinitionsContracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class WorkItemTrackingHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} processId + * @param {string} witRefName + * @param {string} groupId + * @param {string} fieldRefName + * @return IPromise + */ + removeFieldControlFromGroup(processId: string, witRefName: string, groupId: string, fieldRefName: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.Control} control + * @param {string} processId + * @param {string} witRefName + * @param {string} groupId + * @param {string} fieldRefName + * @param {string} removeFromGroupId + * @return IPromise + */ + setFieldControlInGroup(control: ProcessDefinitionsContracts.Control, processId: string, witRefName: string, groupId: string, fieldRefName: string, removeFromGroupId?: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.FieldModel} field + * @param {string} processId + * @return IPromise + */ + createField(field: ProcessDefinitionsContracts.FieldModel, processId: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.FieldUpdate} field + * @param {string} processId + * @return IPromise + */ + updateField(field: ProcessDefinitionsContracts.FieldUpdate, processId: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.Group} group + * @param {string} processId + * @param {string} witRefName + * @param {string} pageId + * @param {string} sectionId + * @return IPromise + */ + addGroup(group: ProcessDefinitionsContracts.Group, processId: string, witRefName: string, pageId: string, sectionId: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.Group} group + * @param {string} processId + * @param {string} witRefName + * @param {string} pageId + * @param {string} sectionId + * @param {string} groupId + * @return IPromise + */ + editGroup(group: ProcessDefinitionsContracts.Group, processId: string, witRefName: string, pageId: string, sectionId: string, groupId: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.WorkItemTypeFieldModel} field + * @param {string} processId + * @param {string} witRefName + * @return IPromise + */ + addWorkItemTypeField(field: ProcessDefinitionsContracts.WorkItemTypeFieldModel, processId: string, witRefName: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.WorkItemTypeModel} workitemType + * @param {string} processId + * @return IPromise + */ + createWorkItemType(workitemType: ProcessDefinitionsContracts.WorkItemTypeModel, processId: string): IPromise; + /** + * [Preview API] + * + * @param {string} processId + * @param {string} witRefName + * @param {string} field + * @return IPromise + */ + removeWorkItemTypeField(processId: string, witRefName: string, field: string): IPromise; +} +export class WorkItemTrackingHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} processId + * @param {string} witRefName + * @param {string} groupId + * @param {string} fieldRefName + * @return IPromise + */ + removeFieldControlFromGroup(processId: string, witRefName: string, groupId: string, fieldRefName: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.Control} control + * @param {string} processId + * @param {string} witRefName + * @param {string} groupId + * @param {string} fieldRefName + * @param {string} removeFromGroupId + * @return IPromise + */ + setFieldControlInGroup(control: ProcessDefinitionsContracts.Control, processId: string, witRefName: string, groupId: string, fieldRefName: string, removeFromGroupId?: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.FieldModel} field + * @param {string} processId + * @return IPromise + */ + createField(field: ProcessDefinitionsContracts.FieldModel, processId: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.FieldUpdate} field + * @param {string} processId + * @return IPromise + */ + updateField(field: ProcessDefinitionsContracts.FieldUpdate, processId: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.Group} group + * @param {string} processId + * @param {string} witRefName + * @param {string} pageId + * @param {string} sectionId + * @return IPromise + */ + addGroup(group: ProcessDefinitionsContracts.Group, processId: string, witRefName: string, pageId: string, sectionId: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.Group} group + * @param {string} processId + * @param {string} witRefName + * @param {string} pageId + * @param {string} sectionId + * @param {string} groupId + * @return IPromise + */ + editGroup(group: ProcessDefinitionsContracts.Group, processId: string, witRefName: string, pageId: string, sectionId: string, groupId: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.WorkItemTypeFieldModel} field + * @param {string} processId + * @param {string} witRefName + * @return IPromise + */ + addWorkItemTypeField(field: ProcessDefinitionsContracts.WorkItemTypeFieldModel, processId: string, witRefName: string): IPromise; + /** + * [Preview API] + * + * @param {ProcessDefinitionsContracts.WorkItemTypeModel} workitemType + * @param {string} processId + * @return IPromise + */ + createWorkItemType(workitemType: ProcessDefinitionsContracts.WorkItemTypeModel, processId: string): IPromise; + /** + * [Preview API] + * + * @param {string} processId + * @param {string} witRefName + * @param {string} field + * @return IPromise + */ + removeWorkItemTypeField(processId: string, witRefName: string, field: string): IPromise; +} +export class WorkItemTrackingHttpClient extends WorkItemTrackingHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return WorkItemTrackingHttpClient2_1 + */ +export function getClient(): WorkItemTrackingHttpClient2_1; +} +declare module "TFS/WorkItemTracking/ProcessRestClient" { +import ProcessContracts = require("TFS/WorkItemTracking/ProcessContracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class WorkItemTrackingHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} processId + * @param {string} witName + * @param {boolean} available + * @return IPromise + */ + getFields(processId: string, witName: string, available?: boolean): IPromise; +} +export class WorkItemTrackingHttpClient extends WorkItemTrackingHttpClient2_1 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return WorkItemTrackingHttpClient3 + */ +export function getClient(): WorkItemTrackingHttpClient2_1; +} +declare module "TFS/WorkItemTracking/RestClient" { +import Contracts = require("TFS/WorkItemTracking/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class WorkItemTrackingHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] Creates an attachment. + * + * @param {string} content - Content to upload + * @param {string} fileName + * @param {string} uploadType + * @return IPromise + */ + createAttachment(content: string, fileName?: string, uploadType?: string): IPromise; + /** + * [Preview API] Returns an attachment + * + * @param {string} id + * @param {string} fileName + * @return IPromise + */ + getAttachmentContent(id: string, fileName?: string): IPromise; + /** + * [Preview API] Returns an attachment + * + * @param {string} id + * @param {string} fileName + * @return IPromise + */ + getAttachmentZip(id: string, fileName?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} depth + * @return IPromise + */ + getRootNodes(project: string, depth?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.WorkItemClassificationNode} postedNode + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @return IPromise + */ + createOrUpdateClassificationNode(postedNode: Contracts.WorkItemClassificationNode, project: string, structureGroup: Contracts.TreeStructureGroup, path?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @param {number} reclassifyId + * @return IPromise + */ + deleteClassificationNode(project: string, structureGroup: Contracts.TreeStructureGroup, path?: string, reclassifyId?: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @param {number} depth + * @return IPromise + */ + getClassificationNode(project: string, structureGroup: Contracts.TreeStructureGroup, path?: string, depth?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.WorkItemClassificationNode} postedNode + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @return IPromise + */ + updateClassificationNode(postedNode: Contracts.WorkItemClassificationNode, project: string, structureGroup: Contracts.TreeStructureGroup, path?: string): IPromise; + /** + * [Preview API] + * + * @param {string} field + * @return IPromise + */ + getField(field: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getFields(): IPromise; + /** + * [Preview API] Returns history of all revision for a given work item ID + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getHistory(id: number, top?: number, skip?: number): IPromise; + /** + * [Preview API] Returns the history value of particular revision + * + * @param {number} id + * @param {number} revisionNumber + * @return IPromise + */ + getHistoryById(id: number, revisionNumber: number): IPromise; + /** + * [Preview API] Creates a query, or moves a query. + * + * @param {Contracts.QueryHierarchyItem} postedQuery - The query to create. + * @param {string} project - Project ID or project name + * @param {string} query - The parent path for the query to create. + * @return IPromise + */ + createQuery(postedQuery: Contracts.QueryHierarchyItem, project: string, query: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {string} query + * @return IPromise + */ + deleteQuery(project: string, query: string): IPromise; + /** + * [Preview API] Retrieves all queries the user has access to in the current project + * + * @param {string} project - Project ID or project name + * @param {Contracts.QueryExpand} expand + * @param {number} depth + * @param {boolean} includeDeleted + * @return IPromise + */ + getQueries(project: string, expand?: Contracts.QueryExpand, depth?: number, includeDeleted?: boolean): IPromise; + /** + * [Preview API] Retrieves a single query by project and either id or path + * + * @param {string} project - Project ID or project name + * @param {string} query + * @param {Contracts.QueryExpand} expand + * @param {number} depth + * @param {boolean} includeDeleted + * @return IPromise + */ + getQuery(project: string, query: string, expand?: Contracts.QueryExpand, depth?: number, includeDeleted?: boolean): IPromise; + /** + * [Preview API] + * + * @param {Contracts.QueryHierarchyItem} queryUpdate + * @param {string} project - Project ID or project name + * @param {string} query + * @param {boolean} undeleteDescendants + * @return IPromise + */ + updateQuery(queryUpdate: Contracts.QueryHierarchyItem, project: string, query: string, undeleteDescendants?: boolean): IPromise; + /** + * [Preview API] Returns a fully hydrated work item for the requested revision + * + * @param {number} id + * @param {number} revisionNumber + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getRevision(id: number, revisionNumber: number, expand?: Contracts.WorkItemExpand): IPromise; + /** + * [Preview API] Returns the list of fully hydrated work item revisions, paged. + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getRevisions(id: number, top?: number, skip?: number, expand?: Contracts.WorkItemExpand): IPromise; + /** + * [Preview API] Validates the fields values. + * + * @param {Contracts.FieldsToEvaluate} ruleEngineInput + * @return IPromise + */ + evaluateRulesOnField(ruleEngineInput: Contracts.FieldsToEvaluate): IPromise; + /** + * [Preview API] Returns a single update for a work item + * + * @param {number} id + * @param {number} updateNumber + * @return IPromise + */ + getUpdate(id: number, updateNumber: number): IPromise; + /** + * [Preview API] Returns a the deltas between work item revisions + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getUpdates(id: number, top?: number, skip?: number): IPromise; + /** + * [Preview API] Gets the results of the query. + * + * @param {Contracts.Wiql} wiql - The query containing the wiql. + * @param {string} project - Project ID or project name + * @param {string} team - Team ID or team name + * @return IPromise + */ + queryByWiql(wiql: Contracts.Wiql, project?: string, team?: string): IPromise; + /** + * [Preview API] Gets the results of the query by id. + * + * @param {string} id - The query id. + * @param {string} project - Project ID or project name + * @param {string} team - Team ID or team name + * @return IPromise + */ + queryById(id: string, project?: string, team?: string): IPromise; + /** + * [Preview API] Get a batch of work item links + * + * @param {string} project - Project ID or project name + * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of links. + * @param {Date} startDateTime - Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. + * @return IPromise + */ + getReportingLinks(project?: string, types?: string[], watermark?: number, startDateTime?: Date): IPromise; + /** + * [Preview API] Gets the work item relation types. + * + * @param {string} relation + * @return IPromise + */ + getRelationType(relation: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getRelationTypes(): IPromise; + /** + * [Preview API] Get a batch of work item revisions + * + * @param {string} project - Project ID or project name + * @param {string[]} fields - A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. + * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. + * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. + * @param {boolean} includeIdentityRef - Return an identity reference instead of a string value for identity fields. + * @return IPromise + */ + readReportingRevisionsGet(project?: string, fields?: string[], types?: string[], watermark?: number, startDateTime?: Date, includeIdentityRef?: boolean): IPromise; + /** + * [Preview API] Get a batch of work item revisions + * + * @param {Contracts.ReportingWorkItemRevisionsFilter} filter - An object that contains request settings: field filter, type filter, identity format + * @param {string} project - Project ID or project name + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. + * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. + * @return IPromise + */ + readReportingRevisionsPost(filter: Contracts.ReportingWorkItemRevisionsFilter, project?: string, watermark?: number, startDateTime?: Date): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {string} type + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + createWorkItem(document: VSS_Common_Contracts.JsonPatchDocument, type: string, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * [Preview API] Returns a single work item + * + * @param {number} id + * @param {string[]} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItem(id: number, fields?: string[], asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * [Preview API] Returns a list of work items + * + * @param {number[]} ids + * @param {string[]} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItems(ids: number[], fields?: string[], asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {number} id + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + updateWorkItem(document: VSS_Common_Contracts.JsonPatchDocument, id: number, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * [Preview API] Returns a single work item from a template + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {string} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItemTemplate(project: string, type: string, fields?: string, asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * [Obsolete - Use CreateWorkItem instead] + * + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {string} project - Project ID or project name + * @param {string} type + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + updateWorkItemTemplate(document: VSS_Common_Contracts.JsonPatchDocument, project: string, type: string, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWorkItemTypeCategories(project: string): IPromise; + /** + * [Preview API] Returns a the deltas between work item revisions + * + * @param {string} project - Project ID or project name + * @param {string} category + * @return IPromise + */ + getWorkItemTypeCategory(project: string, category: string): IPromise; + /** + * [Preview API] Returns a the deltas between work item revisions + * + * @param {string} project - Project ID or project name + * @param {string} type + * @return IPromise + */ + getWorkItemType(project: string, type: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWorkItemTypes(project: string): IPromise; + /** + * [Preview API] Returns the dependent fields for the corresponding workitem type and fieldname + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {string} field + * @return IPromise + */ + getDependentFields(project: string, type: string, field: string): IPromise; + /** + * [Preview API] Export work item type + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {boolean} exportGlobalLists + * @return IPromise + */ + exportWorkItemTypeDefinition(project?: string, type?: string, exportGlobalLists?: boolean): IPromise; + /** + * [Preview API] Add/updates a work item type + * + * @param {Contracts.WorkItemTypeTemplateUpdateModel} updateModel + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateWorkItemTypeDefinition(updateModel: Contracts.WorkItemTypeTemplateUpdateModel, project?: string): IPromise; +} +export class WorkItemTrackingHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * Creates an attachment. + * + * @param {string} content - Content to upload + * @param {string} fileName + * @param {string} uploadType + * @return IPromise + */ + createAttachment(content: string, fileName?: string, uploadType?: string): IPromise; + /** + * Returns an attachment + * + * @param {string} id + * @param {string} fileName + * @return IPromise + */ + getAttachmentContent(id: string, fileName?: string): IPromise; + /** + * Returns an attachment + * + * @param {string} id + * @param {string} fileName + * @return IPromise + */ + getAttachmentZip(id: string, fileName?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} depth + * @return IPromise + */ + getRootNodes(project: string, depth?: number): IPromise; + /** + * @param {Contracts.WorkItemClassificationNode} postedNode + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @return IPromise + */ + createOrUpdateClassificationNode(postedNode: Contracts.WorkItemClassificationNode, project: string, structureGroup: Contracts.TreeStructureGroup, path?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @param {number} reclassifyId + * @return IPromise + */ + deleteClassificationNode(project: string, structureGroup: Contracts.TreeStructureGroup, path?: string, reclassifyId?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @param {number} depth + * @return IPromise + */ + getClassificationNode(project: string, structureGroup: Contracts.TreeStructureGroup, path?: string, depth?: number): IPromise; + /** + * @param {Contracts.WorkItemClassificationNode} postedNode + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @return IPromise + */ + updateClassificationNode(postedNode: Contracts.WorkItemClassificationNode, project: string, structureGroup: Contracts.TreeStructureGroup, path?: string): IPromise; + /** + * @param {string} field + * @return IPromise + */ + getField(field: string): IPromise; + /** + * @return IPromise + */ + getFields(): IPromise; + /** + * Returns history of all revision for a given work item ID + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getHistory(id: number, top?: number, skip?: number): IPromise; + /** + * Returns the history value of particular revision + * + * @param {number} id + * @param {number} revisionNumber + * @return IPromise + */ + getHistoryById(id: number, revisionNumber: number): IPromise; + /** + * Creates a query, or moves a query. + * + * @param {Contracts.QueryHierarchyItem} postedQuery - The query to create. + * @param {string} project - Project ID or project name + * @param {string} query - The parent path for the query to create. + * @return IPromise + */ + createQuery(postedQuery: Contracts.QueryHierarchyItem, project: string, query: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {string} query + * @return IPromise + */ + deleteQuery(project: string, query: string): IPromise; + /** + * Retrieves all queries the user has access to in the current project + * + * @param {string} project - Project ID or project name + * @param {Contracts.QueryExpand} expand + * @param {number} depth + * @param {boolean} includeDeleted + * @return IPromise + */ + getQueries(project: string, expand?: Contracts.QueryExpand, depth?: number, includeDeleted?: boolean): IPromise; + /** + * Retrieves a single query by project and either id or path + * + * @param {string} project - Project ID or project name + * @param {string} query + * @param {Contracts.QueryExpand} expand + * @param {number} depth + * @param {boolean} includeDeleted + * @return IPromise + */ + getQuery(project: string, query: string, expand?: Contracts.QueryExpand, depth?: number, includeDeleted?: boolean): IPromise; + /** + * @param {Contracts.QueryHierarchyItem} queryUpdate + * @param {string} project - Project ID or project name + * @param {string} query + * @param {boolean} undeleteDescendants + * @return IPromise + */ + updateQuery(queryUpdate: Contracts.QueryHierarchyItem, project: string, query: string, undeleteDescendants?: boolean): IPromise; + /** + * Returns a fully hydrated work item for the requested revision + * + * @param {number} id + * @param {number} revisionNumber + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getRevision(id: number, revisionNumber: number, expand?: Contracts.WorkItemExpand): IPromise; + /** + * Returns the list of fully hydrated work item revisions, paged. + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getRevisions(id: number, top?: number, skip?: number, expand?: Contracts.WorkItemExpand): IPromise; + /** + * Validates the fields values. + * + * @param {Contracts.FieldsToEvaluate} ruleEngineInput + * @return IPromise + */ + evaluateRulesOnField(ruleEngineInput: Contracts.FieldsToEvaluate): IPromise; + /** + * Returns a single update for a work item + * + * @param {number} id + * @param {number} updateNumber + * @return IPromise + */ + getUpdate(id: number, updateNumber: number): IPromise; + /** + * Returns a the deltas between work item revisions + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getUpdates(id: number, top?: number, skip?: number): IPromise; + /** + * Gets the results of the query. + * + * @param {Contracts.Wiql} wiql - The query containing the wiql. + * @param {string} project - Project ID or project name + * @param {string} team - Team ID or team name + * @return IPromise + */ + queryByWiql(wiql: Contracts.Wiql, project?: string, team?: string): IPromise; + /** + * Gets the results of the query by id. + * + * @param {string} id - The query id. + * @param {string} project - Project ID or project name + * @param {string} team - Team ID or team name + * @return IPromise + */ + queryById(id: string, project?: string, team?: string): IPromise; + /** + * Get a batch of work item links + * + * @param {string} project - Project ID or project name + * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of links. + * @param {Date} startDateTime - Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. + * @return IPromise + */ + getReportingLinks(project?: string, types?: string[], watermark?: number, startDateTime?: Date): IPromise; + /** + * Gets the work item relation types. + * + * @param {string} relation + * @return IPromise + */ + getRelationType(relation: string): IPromise; + /** + * @return IPromise + */ + getRelationTypes(): IPromise; + /** + * Get a batch of work item revisions + * + * @param {string} project - Project ID or project name + * @param {string[]} fields - A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. + * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. + * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. + * @param {boolean} includeIdentityRef - Return an identity reference instead of a string value for identity fields. + * @return IPromise + */ + readReportingRevisionsGet(project?: string, fields?: string[], types?: string[], watermark?: number, startDateTime?: Date, includeIdentityRef?: boolean): IPromise; + /** + * Get a batch of work item revisions + * + * @param {Contracts.ReportingWorkItemRevisionsFilter} filter - An object that contains request settings: field filter, type filter, identity format + * @param {string} project - Project ID or project name + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. + * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. + * @return IPromise + */ + readReportingRevisionsPost(filter: Contracts.ReportingWorkItemRevisionsFilter, project?: string, watermark?: number, startDateTime?: Date): IPromise; + /** + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {string} type + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + createWorkItem(document: VSS_Common_Contracts.JsonPatchDocument, type: string, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * Returns a single work item + * + * @param {number} id + * @param {string[]} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItem(id: number, fields?: string[], asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * Returns a list of work items + * + * @param {number[]} ids + * @param {string[]} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItems(ids: number[], fields?: string[], asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {number} id + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + updateWorkItem(document: VSS_Common_Contracts.JsonPatchDocument, id: number, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * Returns a single work item from a template + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {string} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItemTemplate(project: string, type: string, fields?: string, asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {string} project - Project ID or project name + * @param {string} type + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + updateWorkItemTemplate(document: VSS_Common_Contracts.JsonPatchDocument, project: string, type: string, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWorkItemTypeCategories(project: string): IPromise; + /** + * Returns a the deltas between work item revisions + * + * @param {string} project - Project ID or project name + * @param {string} category + * @return IPromise + */ + getWorkItemTypeCategory(project: string, category: string): IPromise; + /** + * Returns a the deltas between work item revisions + * + * @param {string} project - Project ID or project name + * @param {string} type + * @return IPromise + */ + getWorkItemType(project: string, type: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWorkItemTypes(project: string): IPromise; + /** + * Returns the dependent fields for the corresponding workitem type and fieldname + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {string} field + * @return IPromise + */ + getDependentFields(project: string, type: string, field: string): IPromise; + /** + * Export work item type + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {boolean} exportGlobalLists + * @return IPromise + */ + exportWorkItemTypeDefinition(project?: string, type?: string, exportGlobalLists?: boolean): IPromise; + /** + * Add/updates a work item type + * + * @param {Contracts.WorkItemTypeTemplateUpdateModel} updateModel + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateWorkItemTypeDefinition(updateModel: Contracts.WorkItemTypeTemplateUpdateModel, project?: string): IPromise; +} +export class WorkItemTrackingHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * Creates an attachment. + * + * @param {string} content - Content to upload + * @param {string} fileName + * @param {string} uploadType + * @return IPromise + */ + createAttachment(content: string, fileName?: string, uploadType?: string): IPromise; + /** + * Returns an attachment + * + * @param {string} id + * @param {string} fileName + * @return IPromise + */ + getAttachmentContent(id: string, fileName?: string): IPromise; + /** + * Returns an attachment + * + * @param {string} id + * @param {string} fileName + * @return IPromise + */ + getAttachmentZip(id: string, fileName?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} depth + * @return IPromise + */ + getRootNodes(project: string, depth?: number): IPromise; + /** + * @param {Contracts.WorkItemClassificationNode} postedNode + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @return IPromise + */ + createOrUpdateClassificationNode(postedNode: Contracts.WorkItemClassificationNode, project: string, structureGroup: Contracts.TreeStructureGroup, path?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @param {number} reclassifyId + * @return IPromise + */ + deleteClassificationNode(project: string, structureGroup: Contracts.TreeStructureGroup, path?: string, reclassifyId?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @param {number} depth + * @return IPromise + */ + getClassificationNode(project: string, structureGroup: Contracts.TreeStructureGroup, path?: string, depth?: number): IPromise; + /** + * @param {Contracts.WorkItemClassificationNode} postedNode + * @param {string} project - Project ID or project name + * @param {Contracts.TreeStructureGroup} structureGroup + * @param {string} path + * @return IPromise + */ + updateClassificationNode(postedNode: Contracts.WorkItemClassificationNode, project: string, structureGroup: Contracts.TreeStructureGroup, path?: string): IPromise; + /** + * @param {string} field + * @return IPromise + */ + getField(field: string): IPromise; + /** + * @return IPromise + */ + getFields(): IPromise; + /** + * Returns history of all revision for a given work item ID + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getHistory(id: number, top?: number, skip?: number): IPromise; + /** + * Returns the history value of particular revision + * + * @param {number} id + * @param {number} revisionNumber + * @return IPromise + */ + getHistoryById(id: number, revisionNumber: number): IPromise; + /** + * Creates a query, or moves a query. + * + * @param {Contracts.QueryHierarchyItem} postedQuery - The query to create. + * @param {string} project - Project ID or project name + * @param {string} query - The parent path for the query to create. + * @return IPromise + */ + createQuery(postedQuery: Contracts.QueryHierarchyItem, project: string, query: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {string} query + * @return IPromise + */ + deleteQuery(project: string, query: string): IPromise; + /** + * Retrieves all queries the user has access to in the current project + * + * @param {string} project - Project ID or project name + * @param {Contracts.QueryExpand} expand + * @param {number} depth + * @param {boolean} includeDeleted + * @return IPromise + */ + getQueries(project: string, expand?: Contracts.QueryExpand, depth?: number, includeDeleted?: boolean): IPromise; + /** + * Retrieves a single query by project and either id or path + * + * @param {string} project - Project ID or project name + * @param {string} query + * @param {Contracts.QueryExpand} expand + * @param {number} depth + * @param {boolean} includeDeleted + * @return IPromise + */ + getQuery(project: string, query: string, expand?: Contracts.QueryExpand, depth?: number, includeDeleted?: boolean): IPromise; + /** + * @param {Contracts.QueryHierarchyItem} queryUpdate + * @param {string} project - Project ID or project name + * @param {string} query + * @param {boolean} undeleteDescendants + * @return IPromise + */ + updateQuery(queryUpdate: Contracts.QueryHierarchyItem, project: string, query: string, undeleteDescendants?: boolean): IPromise; + /** + * Returns a fully hydrated work item for the requested revision + * + * @param {number} id + * @param {number} revisionNumber + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getRevision(id: number, revisionNumber: number, expand?: Contracts.WorkItemExpand): IPromise; + /** + * Returns the list of fully hydrated work item revisions, paged. + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getRevisions(id: number, top?: number, skip?: number, expand?: Contracts.WorkItemExpand): IPromise; + /** + * Validates the fields values. + * + * @param {Contracts.FieldsToEvaluate} ruleEngineInput + * @return IPromise + */ + evaluateRulesOnField(ruleEngineInput: Contracts.FieldsToEvaluate): IPromise; + /** + * Returns a single update for a work item + * + * @param {number} id + * @param {number} updateNumber + * @return IPromise + */ + getUpdate(id: number, updateNumber: number): IPromise; + /** + * Returns a the deltas between work item revisions + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @return IPromise + */ + getUpdates(id: number, top?: number, skip?: number): IPromise; + /** + * Gets the results of the query. + * + * @param {Contracts.Wiql} wiql - The query containing the wiql. + * @param {string} project - Project ID or project name + * @param {string} team - Team ID or team name + * @return IPromise + */ + queryByWiql(wiql: Contracts.Wiql, project?: string, team?: string): IPromise; + /** + * Gets the results of the query by id. + * + * @param {string} id - The query id. + * @param {string} project - Project ID or project name + * @param {string} team - Team ID or team name + * @return IPromise + */ + queryById(id: string, project?: string, team?: string): IPromise; + /** + * Get a batch of work item links + * + * @param {string} project - Project ID or project name + * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of links. + * @param {Date} startDateTime - Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. + * @return IPromise + */ + getReportingLinks(project?: string, types?: string[], watermark?: number, startDateTime?: Date): IPromise; + /** + * Gets the work item relation types. + * + * @param {string} relation + * @return IPromise + */ + getRelationType(relation: string): IPromise; + /** + * @return IPromise + */ + getRelationTypes(): IPromise; + /** + * Get a batch of work item revisions + * + * @param {string} project - Project ID or project name + * @param {string[]} fields - A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. + * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. + * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. + * @param {boolean} includeIdentityRef - Return an identity reference instead of a string value for identity fields. + * @return IPromise + */ + readReportingRevisionsGet(project?: string, fields?: string[], types?: string[], watermark?: number, startDateTime?: Date, includeIdentityRef?: boolean): IPromise; + /** + * Get a batch of work item revisions + * + * @param {Contracts.ReportingWorkItemRevisionsFilter} filter - An object that contains request settings: field filter, type filter, identity format + * @param {string} project - Project ID or project name + * @param {number} watermark - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. + * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. + * @return IPromise + */ + readReportingRevisionsPost(filter: Contracts.ReportingWorkItemRevisionsFilter, project?: string, watermark?: number, startDateTime?: Date): IPromise; + /** + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {string} type + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + createWorkItem(document: VSS_Common_Contracts.JsonPatchDocument, type: string, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * Returns a single work item + * + * @param {number} id + * @param {string[]} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItem(id: number, fields?: string[], asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * Returns a list of work items + * + * @param {number[]} ids + * @param {string[]} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItems(ids: number[], fields?: string[], asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {number} id + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + updateWorkItem(document: VSS_Common_Contracts.JsonPatchDocument, id: number, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * Returns a single work item from a template + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {string} fields + * @param {Date} asOf + * @param {Contracts.WorkItemExpand} expand + * @return IPromise + */ + getWorkItemTemplate(project: string, type: string, fields?: string, asOf?: Date, expand?: Contracts.WorkItemExpand): IPromise; + /** + * @param {VSS_Common_Contracts.JsonPatchDocument} document + * @param {string} project - Project ID or project name + * @param {string} type + * @param {boolean} validateOnly + * @param {boolean} bypassRules + * @return IPromise + */ + updateWorkItemTemplate(document: VSS_Common_Contracts.JsonPatchDocument, project: string, type: string, validateOnly?: boolean, bypassRules?: boolean): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWorkItemTypeCategories(project: string): IPromise; + /** + * Returns a the deltas between work item revisions + * + * @param {string} project - Project ID or project name + * @param {string} category + * @return IPromise + */ + getWorkItemTypeCategory(project: string, category: string): IPromise; + /** + * Returns a the deltas between work item revisions + * + * @param {string} project - Project ID or project name + * @param {string} type + * @return IPromise + */ + getWorkItemType(project: string, type: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getWorkItemTypes(project: string): IPromise; + /** + * Returns the dependent fields for the corresponding workitem type and fieldname + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {string} field + * @return IPromise + */ + getDependentFields(project: string, type: string, field: string): IPromise; + /** + * Export work item type + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {boolean} exportGlobalLists + * @return IPromise + */ + exportWorkItemTypeDefinition(project?: string, type?: string, exportGlobalLists?: boolean): IPromise; + /** + * Add/updates a work item type + * + * @param {Contracts.WorkItemTypeTemplateUpdateModel} updateModel + * @param {string} project - Project ID or project name + * @return IPromise + */ + updateWorkItemTypeDefinition(updateModel: Contracts.WorkItemTypeTemplateUpdateModel, project?: string): IPromise; +} +export class WorkItemTrackingHttpClient extends WorkItemTrackingHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return WorkItemTrackingHttpClient2_1 + */ +export function getClient(): WorkItemTrackingHttpClient2_1; +} +declare module "TFS/WorkItemTracking/Services" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +import WitContracts = require("TFS/WorkItemTracking/Contracts"); +/** +* Host service for opening the work item form +*/ +export interface IWorkItemFormNavigationService { + /** + * Open the specified work item. The host page will display the work item in a dialog, + * or it may update the current page view, depending on the current page. + * + * @param workItemId The id of the work item to open + * @param openInNewTab If true, open the work item in a new tab + */ + openWorkItem(workItemId: number, openInNewTab?: boolean): any; + /** + * Open a new work item of the specified type. The host page will display the new work item in a dialog, + * or it may update the current page view, depending on the current page. + * + * @param workItemTypeName The name of the work item type to open + * @param initialValues (Optional) A dictionary of any initial field values to set after opening the new work item. + */ + openNewWorkItem(workItemTypeName: string, initialValues?: { + [fieldName: string]: any; + }): any; +} +/** +* Host service for opening the work item form +*/ +export module WorkItemFormNavigationService { + var contributionId: string; + /** + * Get an instance of the host work item service + * + * @param webContext Optional web context to scope the service to + */ + function getService(webContext?: Contracts_Platform.WebContext): IPromise; +} +/** +* Host service for interacting with the currently active work item form (work item currently displayed in the UI). +*/ +export interface IWorkItemFormService { + /** + * Gets id of active work item. + */ + getId(): number; + /** + * Gets active work item's latest revision. + */ + getRevision(): number; + /** + * Gets active work item fields. Returns an array of work item field. + */ + getFields(): WitContracts.WorkItemField[]; + /** + * Gets field value of active work item. Returns field value. + * + * @param fieldReferenceName Field reference name + * @param returnOriginalValue Optional setting to whether getting the unsaved values or not. Default is false. + */ + getFieldValue(fieldReferenceName: string, returnOriginalValue?: boolean): Object; + /** + * Gets field values of active work item. Returns a dictionary of field refName/values. + * + * @param fieldReferenceNames An arrary of field reference names + * @param returnOriginalValue Optional setting to whether getting the unsaved values or not. Default is false. + */ + getFieldValues(fieldReferenceNames: string[], returnOriginalValue?: boolean): IDictionaryStringTo; + /** + * Sets field value of active work item. Returns true if successfull. + * + * @param fieldReferenceName Field reference name + * @param value Field value + */ + setFieldValue(fieldReferenceName: string, value: Object): boolean; + /** + * Sets field values of active work item. Returns a dictionary of field refName/results. + * + * @param fields A dictionary of field refName/values + */ + setFieldValues(fields: IDictionaryStringTo): IDictionaryStringTo; + /** + * Returns true if active work item is dirty + */ + isDirty(): boolean; + /** + * Returns true if active work item is new + */ + isNew(): boolean; + /** + * Returns true if active work item fields are all valid + */ + isValid(): boolean; + /** + * Gets invalid fields. Returns an array of invalid work item fields. + * + */ + getInvalidFields(): WitContracts.WorkItemField[]; + /** + * Adds work item links to active work item + * + * @param workItemLinks Work item link to add. + */ + addWorkItemRelations(workItemRelations: WitContracts.WorkItemRelation[]): void; + /** + * Remove work item links from active work item + * + * @param workItemLinks Work item link to remove. + */ + removeWorkItemRelations(workItemRelations: WitContracts.WorkItemRelation[]): void; + /** + * Returns array of work item relations + */ + getWorkItemRelations(): WitContracts.WorkItemRelation[]; + /** + * Returns resource url of specified workitem + */ + getWorkItemResourceUrl(workItemId: number): string; + /** + * Returns array of work item relation types + */ + getWorkItemRelationTypes(): WitContracts.WorkItemRelationType[]; + /** + * Returns true if active work item available + */ + hasActiveWorkItem(): boolean; +} +export module WorkItemFormService { + var contributionId: string; + /** + * Get an instance of the host work item service + * + * @param webContext Optional web context to scope the service to + */ + function getService(webContext?: Contracts_Platform.WebContext): IPromise; +} +} +declare module "TFS/WorkItemTracking/UIContracts" { +import WitContracts = require("TFS/WorkItemTracking/Contracts"); +/** + * A query result in the WIT UI + */ +export interface QueryResultWorkItemContext { + columns: string[]; + rows: any[]; + query: WitContracts.QueryHierarchyItem; +} +/** + * A work item query in the WIT UI + */ +export interface WorkItemQueryContext { + query: WitContracts.QueryHierarchyItem; +} +} +declare module "TFS/Work/Contracts" { +import System_Contracts = require("VSS/Common/Contracts/System"); +export interface Activity { + capacityPerDay: number; + name: string; +} +export interface attribute { +} +export interface Board extends ShallowReference { + _links: any; + allowedMappings: { + [key: string]: { + [key: string]: string[]; + }; + }; + canEdit: boolean; + columns: BoardColumn[]; + isValid: boolean; + revision: number; + rows: BoardRow[]; +} +export interface BoardCardRuleSettings { + _links: any; + rules: { + [key: string]: Rule[]; + }; + url: string; +} +export interface BoardCardSettings { + cards: { + [key: string]: FieldSetting[]; + }; +} +export interface BoardChart extends BoardChartReference { + /** + * The links for the resource + */ + _links: any; + /** + * The settings for the resource + */ + settings: { + [key: string]: any; + }; +} +export interface BoardChartReference { + /** + * Name of the resource + */ + name: string; + /** + * Full http link to the resource + */ + url: string; +} +export interface BoardColumn { + columnType: BoardColumnType; + description: string; + id: string; + isSplit: boolean; + itemLimit: number; + name: string; + stateMappings: { + [key: string]: string; + }; +} +export enum BoardColumnType { + Incoming = 0, + InProgress = 1, + Outgoing = 2, +} +export interface BoardReference extends ShallowReference { +} +export interface BoardRow { + id: string; + name: string; +} +export interface BoardSuggestedValue { + name: string; +} +export enum BugsBehavior { + Off = 0, + AsRequirements = 1, + AsTasks = 2, +} +/** + * Expected data from PATCH + */ +export interface CapacityPatch { + activities: Activity[]; + daysOff: DateRange[]; +} +export interface DateRange { + /** + * End of the date range. + */ + end: Date; + /** + * Start of the date range. + */ + start: Date; +} +/** + * An abstracted reference to a field + */ +export interface FieldReference { + /** + * fieldRefName for the field + */ + referenceName: string; + /** + * Full http link to more information about the field + */ + url: string; +} +export interface FieldSetting { +} +export interface FilterClause { + fieldName: string; + index: number; + logicalOperator: string; + operator: string; + value: string; +} +export interface Member { + displayName: string; + id: string; + imageUrl: string; + uniqueName: string; + url: string; +} +export interface Rule { + clauses: FilterClause[]; + filter: string; + isEnabled: string; + name: string; + settings: attribute; +} +/** + * An abstracted reference to some other resource. This class is used to provide the board data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + */ +export interface ShallowReference { + /** + * Id of the resource + */ + id: string; + /** + * Name of the resource + */ + name: string; + /** + * Full http link to the resource + */ + url: string; +} +/** + * Represents a single TeamFieldValue + */ +export interface TeamFieldValue { + includeChildren: boolean; + value: string; +} +/** + * Essentially a collection of tem field values + */ +export interface TeamFieldValues extends TeamSettingsDataContractBase { + /** + * The default team field value + */ + defaultValue: string; + /** + * Shallow ref to the field being used as a team field + */ + field: FieldReference; + /** + * Collection of all valid team field values + */ + values: TeamFieldValue[]; +} +/** + * Expected data from PATCH + */ +export interface TeamFieldValuesPatch { + defaultValue: string; + values: TeamFieldValue[]; +} +export interface TeamIterationAttributes { + finishDate: Date; + startDate: Date; +} +/** + * Represents capacity for a specific team member + */ +export interface TeamMemberCapacity extends TeamSettingsDataContractBase { + /** + * Collection of capacities associated with the team member + */ + activities: Activity[]; + /** + * The days off associated with the team member + */ + daysOff: DateRange[]; + /** + * Shallow Ref to the associated team member + */ + teamMember: Member; +} +/** + * Data contract for TeamSettings + */ +export interface TeamSetting extends TeamSettingsDataContractBase { + /** + * Default Iteration + */ + backlogIteration: TeamSettingsIteration; + /** + * Information about categories that are visible on the backlog. + */ + backlogVisibilities: { + [key: string]: boolean; + }; + /** + * BugsBehavior (Off, AsTasks, AsRequirements, ...) + */ + bugsBehavior: BugsBehavior; + /** + * Days that the team is working + */ + workingDays: System_Contracts.DayOfWeek[]; +} +/** + * Base class for TeamSettings data contracts. Anything common goes here. + */ +export interface TeamSettingsDataContractBase { + /** + * Collection of links relevant to resource + */ + _links: any; + /** + * Full http link to the resource + */ + url: string; +} +export interface TeamSettingsDaysOff extends TeamSettingsDataContractBase { + daysOff: DateRange[]; +} +export interface TeamSettingsDaysOffPatch { + daysOff: DateRange[]; +} +/** + * Represents a shallow ref for a single iteration + */ +export interface TeamSettingsIteration extends TeamSettingsDataContractBase { + /** + * Attributes such as start and end date + */ + attributes: TeamIterationAttributes; + /** + * Id of the resource + */ + id: string; + /** + * Name of the resource + */ + name: string; + /** + * Relative path of the iteration + */ + path: string; +} +/** + * Data contract for what we expect to receive when PATCH + */ +export interface TeamSettingsPatch { + backlogIteration: string; + backlogVisibilities: { + [key: string]: boolean; + }; + bugsBehavior: BugsBehavior; + workingDays: System_Contracts.DayOfWeek[]; +} +export var TypeInfo: { + Activity: { + fields: any; + }; + attribute: { + fields: any; + }; + Board: { + fields: any; + }; + BoardCardRuleSettings: { + fields: any; + }; + BoardCardSettings: { + fields: any; + }; + BoardChart: { + fields: any; + }; + BoardChartReference: { + fields: any; + }; + BoardColumn: { + fields: any; + }; + BoardColumnType: { + enumValues: { + "incoming": number; + "inProgress": number; + "outgoing": number; + }; + }; + BoardReference: { + fields: any; + }; + BoardRow: { + fields: any; + }; + BoardSuggestedValue: { + fields: any; + }; + BugsBehavior: { + enumValues: { + "off": number; + "asRequirements": number; + "asTasks": number; + }; + }; + CapacityPatch: { + fields: any; + }; + DateRange: { + fields: any; + }; + FieldReference: { + fields: any; + }; + FieldSetting: { + fields: any; + }; + FilterClause: { + fields: any; + }; + Member: { + fields: any; + }; + Rule: { + fields: any; + }; + ShallowReference: { + fields: any; + }; + TeamFieldValue: { + fields: any; + }; + TeamFieldValues: { + fields: any; + }; + TeamFieldValuesPatch: { + fields: any; + }; + TeamIterationAttributes: { + fields: any; + }; + TeamMemberCapacity: { + fields: any; + }; + TeamSetting: { + fields: any; + }; + TeamSettingsDataContractBase: { + fields: any; + }; + TeamSettingsDaysOff: { + fields: any; + }; + TeamSettingsDaysOffPatch: { + fields: any; + }; + TeamSettingsIteration: { + fields: any; + }; + TeamSettingsPatch: { + fields: any; + }; +}; +} +declare module "TFS/Work/RestClient" { +import Contracts = require("TFS/Work/Contracts"); +import TFS_Core_Contracts = require("TFS/Core/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +export class WorkHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getColumnSuggestedValues(project?: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @return IPromise + */ + getRowSuggestedValues(project?: string): IPromise; + /** + * [Preview API] Get board API + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @return IPromise + */ + getBoard(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getBoards(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + getCapacities(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @param {string} teamMemberId + * @return IPromise + */ + getCapacity(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string, teamMemberId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TeamMemberCapacity[]} capacities + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + replaceCapacities(capacities: Contracts.TeamMemberCapacity[], teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.CapacityPatch} patch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @param {string} teamMemberId + * @return IPromise + */ + updateCapacity(patch: Contracts.CapacityPatch, teamContext: TFS_Core_Contracts.TeamContext, iterationId: string, teamMemberId: string): IPromise; + /** + * [Preview API] Get board card Rule settings for the board id or board by name + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardCardRuleSettings(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] Update board card Rule settings for the board id or board by name + * + * @param {Contracts.BoardCardRuleSettings} boardCardRuleSettings + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardCardRuleSettings(boardCardRuleSettings: Contracts.BoardCardRuleSettings, teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] Get board card settings for the board id or board by name + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardCardSettings(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] Update board card settings for the board id or board by name + * + * @param {Contracts.BoardCardSettings} boardCardSettingsToSave + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardCardSettings(boardCardSettingsToSave: Contracts.BoardCardSettings, teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] Get a board chart + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @param {string} name - The chart name + * @return IPromise + */ + getBoardChart(teamContext: TFS_Core_Contracts.TeamContext, board: string, name: string): IPromise; + /** + * [Preview API] Get board charts + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @return IPromise + */ + getBoardCharts(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] Update a board chart + * + * @param {Contracts.BoardChart} chart + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @param {string} name - The chart name + * @return IPromise + */ + updateBoardChart(chart: Contracts.BoardChart, teamContext: TFS_Core_Contracts.TeamContext, board: string, name: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardColumns(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.BoardColumn[]} boardColumns + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardColumns(boardColumns: Contracts.BoardColumn[], teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id + * @return IPromise + */ + deleteTeamIteration(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id + * @return IPromise + */ + getTeamIteration(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} timeframe + * @return IPromise + */ + getTeamIterations(teamContext: TFS_Core_Contracts.TeamContext, timeframe?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TeamSettingsIteration} iteration + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + postTeamIteration(iteration: Contracts.TeamSettingsIteration, teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardRows(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.BoardRow[]} boardRows + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardRows(boardRows: Contracts.BoardRow[], teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + getTeamDaysOff(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TeamSettingsDaysOffPatch} daysOffPatch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + updateTeamDaysOff(daysOffPatch: Contracts.TeamSettingsDaysOffPatch, teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getTeamFieldValues(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TeamFieldValuesPatch} patch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + updateTeamFieldValues(patch: Contracts.TeamFieldValuesPatch, teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * [Preview API] + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getTeamSettings(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TeamSettingsPatch} teamSettingsPatch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + updateTeamSettings(teamSettingsPatch: Contracts.TeamSettingsPatch, teamContext: TFS_Core_Contracts.TeamContext): IPromise; +} +export class WorkHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getColumnSuggestedValues(project?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getRowSuggestedValues(project?: string): IPromise; + /** + * Get board API + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @return IPromise + */ + getBoard(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getBoards(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + getCapacities(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @param {string} teamMemberId + * @return IPromise + */ + getCapacity(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string, teamMemberId: string): IPromise; + /** + * @param {Contracts.TeamMemberCapacity[]} capacities + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + replaceCapacities(capacities: Contracts.TeamMemberCapacity[], teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * @param {Contracts.CapacityPatch} patch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @param {string} teamMemberId + * @return IPromise + */ + updateCapacity(patch: Contracts.CapacityPatch, teamContext: TFS_Core_Contracts.TeamContext, iterationId: string, teamMemberId: string): IPromise; + /** + * [Preview API] Get board card Rule settings for the board id or board by name + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardCardRuleSettings(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] Update board card Rule settings for the board id or board by name + * + * @param {Contracts.BoardCardRuleSettings} boardCardRuleSettings + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardCardRuleSettings(boardCardRuleSettings: Contracts.BoardCardRuleSettings, teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * Get board card settings for the board id or board by name + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardCardSettings(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * Update board card settings for the board id or board by name + * + * @param {Contracts.BoardCardSettings} boardCardSettingsToSave + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardCardSettings(boardCardSettingsToSave: Contracts.BoardCardSettings, teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * Get a board chart + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @param {string} name - The chart name + * @return IPromise + */ + getBoardChart(teamContext: TFS_Core_Contracts.TeamContext, board: string, name: string): IPromise; + /** + * Get board charts + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @return IPromise + */ + getBoardCharts(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * Update a board chart + * + * @param {Contracts.BoardChart} chart + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @param {string} name - The chart name + * @return IPromise + */ + updateBoardChart(chart: Contracts.BoardChart, teamContext: TFS_Core_Contracts.TeamContext, board: string, name: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardColumns(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * @param {Contracts.BoardColumn[]} boardColumns + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardColumns(boardColumns: Contracts.BoardColumn[], teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id + * @return IPromise + */ + deleteTeamIteration(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id + * @return IPromise + */ + getTeamIteration(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} timeframe + * @return IPromise + */ + getTeamIterations(teamContext: TFS_Core_Contracts.TeamContext, timeframe?: string): IPromise; + /** + * @param {Contracts.TeamSettingsIteration} iteration + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + postTeamIteration(iteration: Contracts.TeamSettingsIteration, teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardRows(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * @param {Contracts.BoardRow[]} boardRows + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardRows(boardRows: Contracts.BoardRow[], teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + getTeamDaysOff(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * @param {Contracts.TeamSettingsDaysOffPatch} daysOffPatch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + updateTeamDaysOff(daysOffPatch: Contracts.TeamSettingsDaysOffPatch, teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getTeamFieldValues(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {Contracts.TeamFieldValuesPatch} patch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + updateTeamFieldValues(patch: Contracts.TeamFieldValuesPatch, teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getTeamSettings(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {Contracts.TeamSettingsPatch} teamSettingsPatch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + updateTeamSettings(teamSettingsPatch: Contracts.TeamSettingsPatch, teamContext: TFS_Core_Contracts.TeamContext): IPromise; +} +export class WorkHttpClient2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getColumnSuggestedValues(project?: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @return IPromise + */ + getRowSuggestedValues(project?: string): IPromise; + /** + * Get board API + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @return IPromise + */ + getBoard(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getBoards(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + getCapacities(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @param {string} teamMemberId + * @return IPromise + */ + getCapacity(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string, teamMemberId: string): IPromise; + /** + * @param {Contracts.TeamMemberCapacity[]} capacities + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + replaceCapacities(capacities: Contracts.TeamMemberCapacity[], teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * @param {Contracts.CapacityPatch} patch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @param {string} teamMemberId + * @return IPromise + */ + updateCapacity(patch: Contracts.CapacityPatch, teamContext: TFS_Core_Contracts.TeamContext, iterationId: string, teamMemberId: string): IPromise; + /** + * [Preview API] Get board card Rule settings for the board id or board by name + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardCardRuleSettings(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * [Preview API] Update board card Rule settings for the board id or board by name + * + * @param {Contracts.BoardCardRuleSettings} boardCardRuleSettings + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardCardRuleSettings(boardCardRuleSettings: Contracts.BoardCardRuleSettings, teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * Get board card settings for the board id or board by name + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardCardSettings(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * Update board card settings for the board id or board by name + * + * @param {Contracts.BoardCardSettings} boardCardSettingsToSave + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardCardSettings(boardCardSettingsToSave: Contracts.BoardCardSettings, teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * Get a board chart + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @param {string} name - The chart name + * @return IPromise + */ + getBoardChart(teamContext: TFS_Core_Contracts.TeamContext, board: string, name: string): IPromise; + /** + * Get board charts + * + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @return IPromise + */ + getBoardCharts(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * Update a board chart + * + * @param {Contracts.BoardChart} chart + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either category plural name (Eg:"Stories") or Guid + * @param {string} name - The chart name + * @return IPromise + */ + updateBoardChart(chart: Contracts.BoardChart, teamContext: TFS_Core_Contracts.TeamContext, board: string, name: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardColumns(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * @param {Contracts.BoardColumn[]} boardColumns + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardColumns(boardColumns: Contracts.BoardColumn[], teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id + * @return IPromise + */ + deleteTeamIteration(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} id + * @return IPromise + */ + getTeamIteration(teamContext: TFS_Core_Contracts.TeamContext, id: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} timeframe + * @return IPromise + */ + getTeamIterations(teamContext: TFS_Core_Contracts.TeamContext, timeframe?: string): IPromise; + /** + * @param {Contracts.TeamSettingsIteration} iteration + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + postTeamIteration(iteration: Contracts.TeamSettingsIteration, teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + getBoardRows(teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * @param {Contracts.BoardRow[]} boardRows + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} board + * @return IPromise + */ + updateBoardRows(boardRows: Contracts.BoardRow[], teamContext: TFS_Core_Contracts.TeamContext, board: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + getTeamDaysOff(teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * @param {Contracts.TeamSettingsDaysOffPatch} daysOffPatch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @return IPromise + */ + updateTeamDaysOff(daysOffPatch: Contracts.TeamSettingsDaysOffPatch, teamContext: TFS_Core_Contracts.TeamContext, iterationId: string): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getTeamFieldValues(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {Contracts.TeamFieldValuesPatch} patch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + updateTeamFieldValues(patch: Contracts.TeamFieldValuesPatch, teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + getTeamSettings(teamContext: TFS_Core_Contracts.TeamContext): IPromise; + /** + * @param {Contracts.TeamSettingsPatch} teamSettingsPatch + * @param {TFS_Core_Contracts.TeamContext} teamContext - The team context for the operation + * @return IPromise + */ + updateTeamSettings(teamSettingsPatch: Contracts.TeamSettingsPatch, teamContext: TFS_Core_Contracts.TeamContext): IPromise; +} +export class WorkHttpClient extends WorkHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return WorkHttpClient2_1 + */ +export function getClient(): WorkHttpClient2_1; +} \ No newline at end of file