UNPKG

528 kBTypeScriptView Raw
1// Type definitions for jQuery 1.10.x / 2.0.x
2// Project: http://jquery.com/
3// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, James Harrison Fisher <https://github.com/jameshfisher>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly/>, Dick van den Brink <https://github.com/DickvdBrink>
4// Definitions: https://github.com/borisyankov/DefinitelyTyped
5
6/* *****************************************************************************
7Copyright (c) Microsoft Corporation. All rights reserved.
8Licensed under the Apache License, Version 2.0 (the "License"); you may not use
9this file except in compliance with the License. You may obtain a copy of the
10License at http://www.apache.org/licenses/LICENSE-2.0
11
12THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
14WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
15MERCHANTABLITY OR NON-INFRINGEMENT.
16
17See the Apache Version 2.0 License for specific language governing permissions
18and limitations under the License.
19***************************************************************************** */
20
21
22/**
23 * Interface for the AJAX setting that will configure the AJAX request
24 */
25interface JQueryAjaxSettings {
26 /**
27 * 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.
28 */
29 accepts?: any;
30 /**
31 * 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().
32 */
33 async?: boolean;
34 /**
35 * 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.
36 */
37 beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;
38 /**
39 * 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.
40 */
41 cache?: boolean;
42 /**
43 * 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.
44 */
45 complete? (jqXHR: JQueryXHR, textStatus: string): any;
46 /**
47 * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5)
48 */
49 contents?: { [key: string]: any; };
50 //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false"
51 // https://github.com/borisyankov/DefinitelyTyped/issues/742
52 /**
53 * 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.
54 */
55 contentType?: any;
56 /**
57 * 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).
58 */
59 context?: any;
60 /**
61 * 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)
62 */
63 converters?: { [key: string]: any; };
64 /**
65 * 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)
66 */
67 crossDomain?: boolean;
68 /**
69 * 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).
70 */
71 data?: any;
72 /**
73 * 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.
74 */
75 dataFilter? (data: any, ty: any): any;
76 /**
77 * 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).
78 */
79 dataType?: string;
80 /**
81 * 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.
82 */
83 error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any;
84 /**
85 * 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.
86 */
87 global?: boolean;
88 /**
89 * 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)
90 */
91 headers?: { [key: string]: any; };
92 /**
93 * 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.
94 */
95 ifModified?: boolean;
96 /**
97 * 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)
98 */
99 isLocal?: boolean;
100 /**
101 * 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" }
102 */
103 jsonp?: any;
104 /**
105 * 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.
106 */
107 jsonpCallback?: any;
108 /**
109 * A mime type to override the XHR mime type. (version added: 1.5.1)
110 */
111 mimeType?: string;
112 /**
113 * A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
114 */
115 password?: string;
116 /**
117 * 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.
118 */
119 processData?: boolean;
120 /**
121 * 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.
122 */
123 scriptCharset?: string;
124 /**
125 * 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)
126 */
127 statusCode?: { [key: string]: any; };
128 /**
129 * 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.
130 */
131 success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;
132 /**
133 * 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.
134 */
135 timeout?: number;
136 /**
137 * Set this to true if you wish to use the traditional style of param serialization.
138 */
139 traditional?: boolean;
140 /**
141 * 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.
142 */
143 type?: string;
144 /**
145 * A string containing the URL to which the request is sent.
146 */
147 url?: string;
148 /**
149 * A username to be used with XMLHttpRequest in response to an HTTP access authentication request.
150 */
151 username?: string;
152 /**
153 * 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.
154 */
155 xhr?: any;
156 /**
157 * 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)
158 */
159 xhrFields?: { [key: string]: any; };
160}
161
162/**
163 * Interface for the jqXHR object
164 */
165interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
166 /**
167 * 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).
168 */
169 overrideMimeType(mimeType: string): any;
170 /**
171 * Cancel the request.
172 *
173 * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
174 */
175 abort(statusText?: string): void;
176 /**
177 * 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.
178 */
179 then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<any>;
180 /**
181 * Property containing the parsed response if the response Content-Type is json
182 */
183 responseJSON?: any;
184}
185
186/**
187 * Interface for the JQuery callback
188 */
189interface JQueryCallback {
190 /**
191 * Add a callback or a collection of callbacks to a callback list.
192 *
193 * @param callbacks A function, or array of functions, that are to be added to the callback list.
194 */
195 add(callbacks: Function): JQueryCallback;
196 /**
197 * Add a callback or a collection of callbacks to a callback list.
198 *
199 * @param callbacks A function, or array of functions, that are to be added to the callback list.
200 */
201 add(callbacks: Function[]): JQueryCallback;
202
203 /**
204 * Disable a callback list from doing anything more.
205 */
206 disable(): JQueryCallback;
207
208 /**
209 * Determine if the callbacks list has been disabled.
210 */
211 disabled(): boolean;
212
213 /**
214 * Remove all of the callbacks from a list.
215 */
216 empty(): JQueryCallback;
217
218 /**
219 * Call all of the callbacks with the given arguments
220 *
221 * @param arguments The argument or list of arguments to pass back to the callback list.
222 */
223 fire(...arguments: any[]): JQueryCallback;
224
225 /**
226 * Determine if the callbacks have already been called at least once.
227 */
228 fired(): boolean;
229
230 /**
231 * Call all callbacks in a list with the given context and arguments.
232 *
233 * @param context A reference to the context in which the callbacks in the list should be fired.
234 * @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
235 */
236 fireWith(context?: any, ...args: any[]): JQueryCallback;
237
238 /**
239 * Determine whether a supplied callback is in a list
240 *
241 * @param callback The callback to search for.
242 */
243 has(callback: Function): boolean;
244
245 /**
246 * Lock a callback list in its current state.
247 */
248 lock(): JQueryCallback;
249
250 /**
251 * Determine if the callbacks list has been locked.
252 */
253 locked(): boolean;
254
255 /**
256 * Remove a callback or a collection of callbacks from a callback list.
257 *
258 * @param callbacks A function, or array of functions, that are to be removed from the callback list.
259 */
260 remove(callbacks: Function): JQueryCallback;
261 /**
262 * Remove a callback or a collection of callbacks from a callback list.
263 *
264 * @param callbacks A function, or array of functions, that are to be removed from the callback list.
265 */
266 remove(callbacks: Function[]): JQueryCallback;
267}
268
269/**
270 * Allows jQuery Promises to interop with non-jQuery promises
271 */
272interface JQueryGenericPromise<T> {
273 /**
274 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
275 *
276 * @param doneFilter A function that is called when the Deferred is resolved.
277 * @param failFilter An optional function that is called when the Deferred is rejected.
278 */
279 then<U>(doneFilter: (value: T) => U, failFilter?: (reason: any) => U): JQueryGenericPromise<U>;
280 /**
281 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
282 *
283 * @param doneFilter A function that is called when the Deferred is resolved.
284 * @param failFilter An optional function that is called when the Deferred is rejected.
285 */
286 then<U>(doneFilter: (value: T) => JQueryGenericPromise<U>, failFilter?: (reason: any) => U): JQueryGenericPromise<U>;
287 /**
288 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
289 *
290 * @param doneFilter A function that is called when the Deferred is resolved.
291 * @param failFilter An optional function that is called when the Deferred is rejected.
292 */
293 then<U>(doneFilter: (value: T) => U, failFilter?: (reason: any) => JQueryGenericPromise<U>): JQueryGenericPromise<U>;
294 /**
295 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
296 *
297 * @param doneFilter A function that is called when the Deferred is resolved.
298 * @param failFilter An optional function that is called when the Deferred is rejected.
299 */
300 then<U>(doneFilter: (value: T) => JQueryGenericPromise<U>, failFilter?: (reason: any) => JQueryGenericPromise<U>): JQueryGenericPromise<U>;
301}
302
303/**
304 * Interface for the JQuery promise/deferred callbacks
305 */
306interface JQueryPromiseCallback<T> {
307 (value?: T, ...args: any[]): void;
308}
309
310interface JQueryPromiseOperator<T, R> {
311 (callback: JQueryPromiseCallback<T>, ...callbacks: JQueryPromiseCallback<T>[]): JQueryPromise<R>;
312 (callback: JQueryPromiseCallback<T>[], ...callbacks: JQueryPromiseCallback<T>[]): JQueryPromise<R>;
313}
314
315/**
316 * Interface for the JQuery promise, part of callbacks
317 */
318interface JQueryPromise<T> {
319 /**
320 * Add handlers to be called when the Deferred object is either resolved or rejected.
321 *
322 * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
323 * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
324 */
325 always: JQueryPromiseOperator<any, T>;
326 /**
327 * Add handlers to be called when the Deferred object is resolved.
328 *
329 * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
330 * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
331 */
332 done: JQueryPromiseOperator<T, T>;
333 /**
334 * Add handlers to be called when the Deferred object is rejected.
335 *
336 * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
337 * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
338 */
339 fail: JQueryPromiseOperator<any, T>;
340 /**
341 * Add handlers to be called when the Deferred object generates progress notifications.
342 *
343 * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
344 */
345 progress(progressCallback: JQueryPromiseCallback<T>): JQueryPromise<T>;
346 progress(progressCallbacks: JQueryPromiseCallback<T>[]): JQueryPromise<T>;
347
348 /**
349 * Determine the current state of a Deferred object.
350 */
351 state(): string;
352
353 // Deprecated - given no typings
354 pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
355
356 /**
357 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
358 *
359 * @param doneFilter A function that is called when the Deferred is resolved.
360 * @param failFilter An optional function that is called when the Deferred is rejected.
361 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
362 */
363 then<U>(doneFilter: (value: T) => U, failFilter?: (...reasons: any[]) => U, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
364 /**
365 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
366 *
367 * @param doneFilter A function that is called when the Deferred is resolved.
368 * @param failFilter An optional function that is called when the Deferred is rejected.
369 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
370 */
371 then<U>(doneFilter: (value: T) => JQueryGenericPromise<U>, failFilter?: (...reasons: any[]) => U, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
372 /**
373 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
374 *
375 * @param doneFilter A function that is called when the Deferred is resolved.
376 * @param failFilter An optional function that is called when the Deferred is rejected.
377 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
378 */
379 then<U>(doneFilter: (value: T) => U, failFilter?: (...reasons: any[]) => JQueryGenericPromise<U>, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
380 /**
381 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
382 *
383 * @param doneFilter A function that is called when the Deferred is resolved.
384 * @param failFilter An optional function that is called when the Deferred is rejected.
385 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
386 */
387 then<U>(doneFilter: (value: T) => JQueryGenericPromise<U>, failFilter?: (...reasons: any[]) => JQueryGenericPromise<U>, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
388
389 // Because JQuery Promises Suck
390 /**
391 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
392 *
393 * @param doneFilter A function that is called when the Deferred is resolved.
394 * @param failFilter An optional function that is called when the Deferred is rejected.
395 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
396 */
397 then<U>(doneFilter: (...values: any[]) => U, failFilter?: (...reasons: any[]) => U, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
398 /**
399 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
400 *
401 * @param doneFilter A function that is called when the Deferred is resolved.
402 * @param failFilter An optional function that is called when the Deferred is rejected.
403 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
404 */
405 then<U>(doneFilter: (...values: any[]) => JQueryGenericPromise<U>, failFilter?: (...reasons: any[]) => U, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
406 /**
407 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
408 *
409 * @param doneFilter A function that is called when the Deferred is resolved.
410 * @param failFilter An optional function that is called when the Deferred is rejected.
411 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
412 */
413 then<U>(doneFilter: (...values: any[]) => U, failFilter?: (...reasons: any[]) => JQueryGenericPromise<U>, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
414 /**
415 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
416 *
417 * @param doneFilter A function that is called when the Deferred is resolved.
418 * @param failFilter An optional function that is called when the Deferred is rejected.
419 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
420 */
421 then<U>(doneFilter: (...values: any[]) => JQueryGenericPromise<U>, failFilter?: (...reasons: any[]) => JQueryGenericPromise<U>, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
422}
423
424/**
425 * Interface for the JQuery deferred, part of callbacks
426 */
427interface JQueryDeferred<T> extends JQueryPromise<T> {
428 /**
429 * Add handlers to be called when the Deferred object is either resolved or rejected.
430 *
431 * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
432 * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
433 */
434 always(alwaysCallbacks1?: JQueryPromiseCallback<T>, ...alwaysCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
435 always(alwaysCallbacks1?: JQueryPromiseCallback<T>[], ...alwaysCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
436 always(alwaysCallbacks1?: JQueryPromiseCallback<T>, ...alwaysCallbacks2: any[]): JQueryDeferred<T>;
437 always(alwaysCallbacks1?: JQueryPromiseCallback<T>[], ...alwaysCallbacks2: any[]): JQueryDeferred<T>;
438 /**
439 * Add handlers to be called when the Deferred object is resolved.
440 *
441 * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
442 * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
443 */
444 done(doneCallbacks1?: JQueryPromiseCallback<T>, ...doneCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
445 done(doneCallbacks1?: JQueryPromiseCallback<T>[], ...doneCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
446 done(doneCallbacks1?: JQueryPromiseCallback<T>, ...doneCallbacks2: any[]): JQueryDeferred<T>;
447 done(doneCallbacks1?: JQueryPromiseCallback<T>[], ...doneCallbacks2: any[]): JQueryDeferred<T>;
448 /**
449 * Add handlers to be called when the Deferred object is rejected.
450 *
451 * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
452 * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
453 */
454 fail(failCallbacks1?: JQueryPromiseCallback<T>, ...failCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
455 fail(failCallbacks1?: JQueryPromiseCallback<T>[], ...failCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
456 fail(failCallbacks1?: JQueryPromiseCallback<T>, ...failCallbacks2: any[]): JQueryDeferred<T>;
457 fail(failCallbacks1?: JQueryPromiseCallback<T>[], ...failCallbacks2: any[]): JQueryDeferred<T>;
458 /**
459 * Add handlers to be called when the Deferred object generates progress notifications.
460 *
461 * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
462 */
463 progress(progressCallback: JQueryPromiseCallback<T>): JQueryDeferred<T>;
464 progress(progressCallbacks: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
465
466 /**
467 * Call the progressCallbacks on a Deferred object with the given args.
468 *
469 * @param args Optional arguments that are passed to the progressCallbacks.
470 */
471 notify(...args: any[]): JQueryDeferred<T>;
472
473 /**
474 * Call the progressCallbacks on a Deferred object with the given context and args.
475 *
476 * @param context Context passed to the progressCallbacks as the this object.
477 * @param args Optional arguments that are passed to the progressCallbacks.
478 */
479 notifyWith(context: any, ...args: any[]): JQueryDeferred<T>;
480
481 /**
482 * Reject a Deferred object and call any failCallbacks with the given args.
483 *
484 * @param args Optional arguments that are passed to the failCallbacks.
485 */
486 reject(...args: any[]): JQueryDeferred<T>;
487 /**
488 * Reject a Deferred object and call any failCallbacks with the given context and args.
489 *
490 * @param context Context passed to the failCallbacks as the this object.
491 * @param args An optional array of arguments that are passed to the failCallbacks.
492 */
493 rejectWith(context: any, ...args: any[]): JQueryDeferred<T>;
494
495 /**
496 * Resolve a Deferred object and call any doneCallbacks with the given args.
497 *
498 * @param value First argument passed to doneCallbacks.
499 * @param args Optional subsequent arguments that are passed to the doneCallbacks.
500 */
501 resolve(value?: T, ...args: any[]): JQueryDeferred<T>;
502
503 /**
504 * Resolve a Deferred object and call any doneCallbacks with the given context and args.
505 *
506 * @param context Context passed to the doneCallbacks as the this object.
507 * @param args An optional array of arguments that are passed to the doneCallbacks.
508 */
509 resolveWith(context: any, ...args: any[]): JQueryDeferred<T>;
510
511 /**
512 * Return a Deferred's Promise object.
513 *
514 * @param target Object onto which the promise methods have to be attached
515 */
516 promise(target?: any): JQueryPromise<T>;
517}
518
519/**
520 * Interface of the JQuery extension of the W3C event object
521 */
522interface BaseJQueryEventObject extends Event {
523 data: any;
524 delegateTarget: Element;
525 isDefaultPrevented(): boolean;
526 isImmediatePropagationStopped(): boolean;
527 isPropagationStopped(): boolean;
528 namespace: string;
529 originalEvent: Event;
530 preventDefault(): any;
531 relatedTarget: Element;
532 result: any;
533 stopImmediatePropagation(): void;
534 stopPropagation(): void;
535 pageX: number;
536 pageY: number;
537 which: number;
538 metaKey: boolean;
539}
540
541interface JQueryInputEventObject extends BaseJQueryEventObject {
542 altKey: boolean;
543 ctrlKey: boolean;
544 metaKey: boolean;
545 shiftKey: boolean;
546}
547
548interface JQueryMouseEventObject extends JQueryInputEventObject {
549 button: number;
550 clientX: number;
551 clientY: number;
552 offsetX: number;
553 offsetY: number;
554 pageX: number;
555 pageY: number;
556 screenX: number;
557 screenY: number;
558}
559
560interface JQueryKeyEventObject extends JQueryInputEventObject {
561 char: any;
562 charCode: number;
563 key: any;
564 keyCode: number;
565}
566
567interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject {
568}
569
570interface JQueryPostMessageEvent extends JQueryEventObject {
571 originalEvent: PostMessageEvent;
572}
573
574interface PostMessageEvent extends BaseJQueryEventObject {
575 data: string;
576 source: Window;
577}
578
579/*
580 Collection of properties of the current browser
581*/
582
583interface JQuerySupport {
584 ajax?: boolean;
585 boxModel?: boolean;
586 changeBubbles?: boolean;
587 checkClone?: boolean;
588 checkOn?: boolean;
589 cors?: boolean;
590 cssFloat?: boolean;
591 hrefNormalized?: boolean;
592 htmlSerialize?: boolean;
593 leadingWhitespace?: boolean;
594 noCloneChecked?: boolean;
595 noCloneEvent?: boolean;
596 opacity?: boolean;
597 optDisabled?: boolean;
598 optSelected?: boolean;
599 scriptEval? (): boolean;
600 style?: boolean;
601 submitBubbles?: boolean;
602 tbody?: boolean;
603}
604
605interface JQueryParam {
606 /**
607 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
608 *
609 * @param obj An array or object to serialize.
610 */
611 (obj: any): string;
612
613 /**
614 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
615 *
616 * @param obj An array or object to serialize.
617 * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
618 */
619 (obj: any, traditional: boolean): string;
620}
621
622/**
623 * The interface used to construct jQuery events (with $.Event). It is
624 * defined separately instead of inline in JQueryStatic to allow
625 * overriding the construction function with specific strings
626 * returning specific event objects.
627 */
628interface JQueryEventConstructor {
629 (name: string, eventProperties?: any): JQueryEventObject;
630 new (name: string, eventProperties?: any): JQueryEventObject;
631}
632
633/**
634 * The interface used to specify coordinates.
635 */
636interface JQueryCoordinates {
637 left: number;
638 top: number;
639}
640
641interface JQueryAnimationOptions {
642 /**
643 * A string or number determining how long the animation will run.
644 */
645 duration?: any;
646 /**
647 * A string indicating which easing function to use for the transition.
648 */
649 easing?: string;
650 /**
651 * A function to call once the animation is complete.
652 */
653 complete?: Function;
654 /**
655 * 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.
656 */
657 step?: (now: number, tween: any) => any;
658 /**
659 * 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)
660 */
661 progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any;
662 /**
663 * A function to call when the animation begins. (version added: 1.8)
664 */
665 start?: (animation: JQueryPromise<any>) => any;
666 /**
667 * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
668 */
669 done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
670 /**
671 * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
672 */
673 fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
674 /**
675 * 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)
676 */
677 always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
678 /**
679 * 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.
680 */
681 queue?: any;
682 /**
683 * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
684 */
685 specialEasing?: Object;
686}
687
688/**
689 * Static members of jQuery (those on $ and jQuery themselves)
690 */
691interface JQueryStatic {
692
693 /**
694 * Perform an asynchronous HTTP (Ajax) request.
695 *
696 * @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().
697 */
698 ajax(settings: JQueryAjaxSettings): JQueryXHR;
699 /**
700 * Perform an asynchronous HTTP (Ajax) request.
701 *
702 * @param url A string containing the URL to which the request is sent.
703 * @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().
704 */
705 ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
706
707 /**
708 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
709 *
710 * @param dataTypes An optional string containing one or more space-separated dataTypes
711 * @param handler A handler to set default values for future Ajax requests.
712 */
713 ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
714 /**
715 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
716 *
717 * @param handler A handler to set default values for future Ajax requests.
718 */
719 ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
720
721 ajaxSettings: JQueryAjaxSettings;
722
723 /**
724 * Set default values for future Ajax requests. Its use is not recommended.
725 *
726 * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
727 */
728 ajaxSetup(options: JQueryAjaxSettings): void;
729
730 /**
731 * Load data from the server using a HTTP GET request.
732 *
733 * @param url A string containing the URL to which the request is sent.
734 * @param success A callback function that is executed if the request succeeds.
735 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
736 */
737 get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
738 /**
739 * Load data from the server using a HTTP GET request.
740 *
741 * @param url A string containing the URL to which the request is sent.
742 * @param data A plain object or string that is sent to the server with the request.
743 * @param success A callback function that is executed if the request succeeds.
744 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
745 */
746 get(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
747 /**
748 * Load data from the server using a HTTP GET request.
749 *
750 * @param url A string containing the URL to which the request is sent.
751 * @param data A plain object or string that is sent to the server with the request.
752 * @param success A callback function that is executed if the request succeeds.
753 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
754 */
755 get(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
756 /**
757 * Load JSON-encoded data from the server using a GET HTTP request.
758 *
759 * @param url A string containing the URL to which the request is sent.
760 * @param success A callback function that is executed if the request succeeds.
761 */
762 getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
763 /**
764 * Load JSON-encoded data from the server using a GET HTTP request.
765 *
766 * @param url A string containing the URL to which the request is sent.
767 * @param data A plain object or string that is sent to the server with the request.
768 * @param success A callback function that is executed if the request succeeds.
769 */
770 getJSON(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
771 /**
772 * Load JSON-encoded data from the server using a GET HTTP request.
773 *
774 * @param url A string containing the URL to which the request is sent.
775 * @param data A plain object or string that is sent to the server with the request.
776 * @param success A callback function that is executed if the request succeeds.
777 */
778 getJSON(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
779 /**
780 * Load a JavaScript file from the server using a GET HTTP request, then execute it.
781 *
782 * @param url A string containing the URL to which the request is sent.
783 * @param success A callback function that is executed if the request succeeds.
784 */
785 getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
786
787 /**
788 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
789 */
790 param: JQueryParam;
791
792 /**
793 * Load data from the server using a HTTP POST request.
794 *
795 * @param url A string containing the URL to which the request is sent.
796 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
797 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
798 */
799 post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
800 /**
801 * Load data from the server using a HTTP POST request.
802 *
803 * @param url A string containing the URL to which the request is sent.
804 * @param data A plain object or string that is sent to the server with the request.
805 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
806 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
807 */
808 post(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
809 /**
810 * Load data from the server using a HTTP POST request.
811 *
812 * @param url A string containing the URL to which the request is sent.
813 * @param data A plain object or string that is sent to the server with the request.
814 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
815 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
816 */
817 post(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
818
819 /**
820 * A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
821 *
822 * @param flags An optional list of space-separated flags that change how the callback list behaves.
823 */
824 Callbacks(flags?: string): JQueryCallback;
825
826 /**
827 * Holds or releases the execution of jQuery's ready event.
828 *
829 * @param hold Indicates whether the ready hold is being requested or released
830 */
831 holdReady(hold: boolean): void;
832
833 /**
834 * Accepts a string containing a CSS selector which is then used to match a set of elements.
835 *
836 * @param selector A string containing a selector expression
837 * @param context A DOM Element, Document, or jQuery to use as context
838 */
839 (selector: string, context?: Element): JQuery;
840 /**
841 * Accepts a string containing a CSS selector which is then used to match a set of elements.
842 *
843 * @param selector A string containing a selector expression
844 * @param context A DOM Element, Document, or jQuery to use as context
845 */
846 (selector: string, context?: JQuery): JQuery;
847 /**
848 * Accepts a string containing a CSS selector which is then used to match a set of elements.
849 *
850 * @param element A DOM element to wrap in a jQuery object.
851 */
852 (element: Element): JQuery;
853 /**
854 * Accepts a string containing a CSS selector which is then used to match a set of elements.
855 *
856 * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
857 */
858 (elementArray: Element[]): JQuery;
859 /**
860 * Accepts a string containing a CSS selector which is then used to match a set of elements.
861 *
862 * @param object A plain object to wrap in a jQuery object.
863 */
864 (object: {}): JQuery;
865 /**
866 * Accepts a string containing a CSS selector which is then used to match a set of elements.
867 *
868 * @param object An existing jQuery object to clone.
869 */
870 (object: JQuery): JQuery;
871 /**
872 * Specify a function to execute when the DOM is fully loaded.
873 */
874 (): JQuery;
875
876 /**
877 * Creates DOM elements on the fly from the provided string of raw HTML.
878 *
879 * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
880 * @param ownerDocument A document in which the new elements will be created.
881 */
882 (html: string, ownerDocument?: Document): JQuery;
883 /**
884 * Creates DOM elements on the fly from the provided string of raw HTML.
885 *
886 * @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
887 * @param attributes An object of attributes, events, and methods to call on the newly-created element.
888 */
889 (html: string, attributes: Object): JQuery;
890
891 /**
892 * Binds a function to be executed when the DOM has finished loading.
893 *
894 * @param callback A function to execute after the DOM is ready.
895 */
896 (callback: Function): JQuery;
897
898 /**
899 * Relinquish jQuery's control of the $ variable.
900 *
901 * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
902 */
903 noConflict(removeAll?: boolean): Object;
904
905 /**
906 * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
907 *
908 * @param deferreds One or more Deferred objects, or plain JavaScript objects.
909 */
910 when<T>(...deferreds: JQueryGenericPromise<T>[]): JQueryPromise<T>;
911 /**
912 * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
913 *
914 * @param deferreds One or more Deferred objects, or plain JavaScript objects.
915 */
916 when<T>(...deferreds: T[]): JQueryPromise<T>;
917 /**
918 * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
919 *
920 * @param deferreds One or more Deferred objects, or plain JavaScript objects.
921 */
922 when<T>(...deferreds: any[]): JQueryPromise<T>;
923
924 /**
925 * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
926 */
927 cssHooks: { [key: string]: any; };
928 cssNumber: any;
929
930 /**
931 * Store arbitrary data associated with the specified element. Returns the value that was set.
932 *
933 * @param element The DOM element to associate with the data.
934 * @param key A string naming the piece of data to set.
935 * @param value The new data value.
936 */
937 data<T>(element: Element, key: string, value: T): T;
938 /**
939 * 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.
940 *
941 * @param element The DOM element to associate with the data.
942 * @param key A string naming the piece of data to set.
943 */
944 data(element: Element, key: string): any;
945 /**
946 * 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.
947 *
948 * @param element The DOM element to associate with the data.
949 */
950 data(element: Element): any;
951
952 /**
953 * Execute the next function on the queue for the matched element.
954 *
955 * @param element A DOM element from which to remove and execute a queued function.
956 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
957 */
958 dequeue(element: Element, queueName?: string): void;
959
960 /**
961 * Determine whether an element has any jQuery data associated with it.
962 *
963 * @param element A DOM element to be checked for data.
964 */
965 hasData(element: Element): boolean;
966
967 /**
968 * Show the queue of functions to be executed on the matched element.
969 *
970 * @param element A DOM element to inspect for an attached queue.
971 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
972 */
973 queue(element: Element, queueName?: string): any[];
974 /**
975 * Manipulate the queue of functions to be executed on the matched element.
976 *
977 * @param element A DOM element where the array of queued functions is attached.
978 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
979 * @param newQueue An array of functions to replace the current queue contents.
980 */
981 queue(element: Element, queueName: string, newQueue: Function[]): JQuery;
982 /**
983 * Manipulate the queue of functions to be executed on the matched element.
984 *
985 * @param element A DOM element on which to add a queued function.
986 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
987 * @param callback The new function to add to the queue.
988 */
989 queue(element: Element, queueName: string, callback: Function): JQuery;
990
991 /**
992 * Remove a previously-stored piece of data.
993 *
994 * @param element A DOM element from which to remove data.
995 * @param name A string naming the piece of data to remove.
996 */
997 removeData(element: Element, name?: string): JQuery;
998
999 /**
1000 * 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.
1001 *
1002 * @param beforeStart A function that is called just before the constructor returns.
1003 */
1004 Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>;
1005
1006 /**
1007 * Effects
1008 */
1009 fx: {
1010 tick: () => void;
1011 /**
1012 * The rate (in milliseconds) at which animations fire.
1013 */
1014 interval: number;
1015 stop: () => void;
1016 speeds: { slow: number; fast: number; };
1017 /**
1018 * Globally disable all animations.
1019 */
1020 off: boolean;
1021 step: any;
1022 };
1023
1024 /**
1025 * Takes a function and returns a new one that will always have a particular context.
1026 *
1027 * @param fnction The function whose context will be changed.
1028 * @param context The object to which the context (this) of the function should be set.
1029 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
1030 */
1031 proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
1032 /**
1033 * Takes a function and returns a new one that will always have a particular context.
1034 *
1035 * @param context The object to which the context (this) of the function should be set.
1036 * @param name The name of the function whose context will be changed (should be a property of the context object).
1037 * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
1038 */
1039 proxy(context: Object, name: string, ...additionalArguments: any[]): any;
1040
1041 Event: JQueryEventConstructor;
1042
1043 /**
1044 * Takes a string and throws an exception containing it.
1045 *
1046 * @param message The message to send out.
1047 */
1048 error(message: any): JQuery;
1049
1050 expr: any;
1051 fn: any; //TODO: Decide how we want to type this
1052
1053 isReady: boolean;
1054
1055 // Properties
1056 support: JQuerySupport;
1057
1058 /**
1059 * Check to see if a DOM element is a descendant of another DOM element.
1060 *
1061 * @param container The DOM element that may contain the other element.
1062 * @param contained The DOM element that may be contained by (a descendant of) the other element.
1063 */
1064 contains(container: Element, contained: Element): boolean;
1065
1066 /**
1067 * 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.
1068 *
1069 * @param collection The object or array to iterate over.
1070 * @param callback The function that will be executed on every object.
1071 */
1072 each<T>(
1073 collection: T[],
1074 callback: (indexInArray: number, valueOfElement: T) => any
1075 ): any;
1076
1077 /**
1078 * 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.
1079 *
1080 * @param collection The object or array to iterate over.
1081 * @param callback The function that will be executed on every object.
1082 */
1083 each(
1084 collection: any,
1085 callback: (indexInArray: any, valueOfElement: any) => any
1086 ): any;
1087
1088 /**
1089 * Merge the contents of two or more objects together into the first object.
1090 *
1091 * @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.
1092 * @param object1 An object containing additional properties to merge in.
1093 * @param objectN Additional objects containing properties to merge in.
1094 */
1095 extend(target: any, object1?: any, ...objectN: any[]): any;
1096 /**
1097 * Merge the contents of two or more objects together into the first object.
1098 *
1099 * @param deep If true, the merge becomes recursive (aka. deep copy).
1100 * @param target The object to extend. It will receive the new properties.
1101 * @param object1 An object containing additional properties to merge in.
1102 * @param objectN Additional objects containing properties to merge in.
1103 */
1104 extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
1105
1106 /**
1107 * Execute some JavaScript code globally.
1108 *
1109 * @param code The JavaScript code to execute.
1110 */
1111 globalEval(code: string): any;
1112
1113 /**
1114 * Finds the elements of an array which satisfy a filter function. The original array is not affected.
1115 *
1116 * @param array The array to search through.
1117 * @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.
1118 * @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.
1119 */
1120 grep<T>(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[];
1121
1122 /**
1123 * Search for a specified value within an array and return its index (or -1 if not found).
1124 *
1125 * @param value The value to search for.
1126 * @param array An array through which to search.
1127 * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array.
1128 */
1129 inArray<T>(value: T, array: T[], fromIndex?: number): number;
1130
1131 /**
1132 * Determine whether the argument is an array.
1133 *
1134 * @param obj Object to test whether or not it is an array.
1135 */
1136 isArray(obj: any): boolean;
1137 /**
1138 * Check to see if an object is empty (contains no enumerable properties).
1139 *
1140 * @param obj The object that will be checked to see if it's empty.
1141 */
1142 isEmptyObject(obj: any): boolean;
1143 /**
1144 * Determine if the argument passed is a Javascript function object.
1145 *
1146 * @param obj Object to test whether or not it is a function.
1147 */
1148 isFunction(obj: any): boolean;
1149 /**
1150 * Determines whether its argument is a number.
1151 *
1152 * @param obj The value to be tested.
1153 */
1154 isNumeric(value: any): boolean;
1155 /**
1156 * Check to see if an object is a plain object (created using "{}" or "new Object").
1157 *
1158 * @param obj The object that will be checked to see if it's a plain object.
1159 */
1160 isPlainObject(obj: any): boolean;
1161 /**
1162 * Determine whether the argument is a window.
1163 *
1164 * @param obj Object to test whether or not it is a window.
1165 */
1166 isWindow(obj: any): boolean;
1167 /**
1168 * Check to see if a DOM node is within an XML document (or is an XML document).
1169 *
1170 * @param node he DOM node that will be checked to see if it's in an XML document.
1171 */
1172 isXMLDoc(node: Node): boolean;
1173
1174 /**
1175 * Convert an array-like object into a true JavaScript array.
1176 *
1177 * @param obj Any object to turn into a native Array.
1178 */
1179 makeArray(obj: any): any[];
1180
1181 /**
1182 * Translate all items in an array or object to new array of items.
1183 *
1184 * @param array The Array to translate.
1185 * @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.
1186 */
1187 map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
1188 /**
1189 * Translate all items in an array or object to new array of items.
1190 *
1191 * @param arrayOrObject The Array or Object to translate.
1192 * @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.
1193 */
1194 map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any;
1195
1196 /**
1197 * Merge the contents of two arrays together into the first array.
1198 *
1199 * @param first The first array to merge, the elements of second added.
1200 * @param second The second array to merge into the first, unaltered.
1201 */
1202 merge<T>(first: T[], second: T[]): T[];
1203
1204 /**
1205 * An empty function.
1206 */
1207 noop(): any;
1208
1209 /**
1210 * Return a number representing the current time.
1211 */
1212 now(): number;
1213
1214 /**
1215 * Takes a well-formed JSON string and returns the resulting JavaScript object.
1216 *
1217 * @param json The JSON string to parse.
1218 */
1219 parseJSON(json: string): any;
1220
1221 /**
1222 * Parses a string into an XML document.
1223 *
1224 * @param data a well-formed XML string to be parsed
1225 */
1226 parseXML(data: string): XMLDocument;
1227
1228 /**
1229 * Remove the whitespace from the beginning and end of a string.
1230 *
1231 * @param str Remove the whitespace from the beginning and end of a string.
1232 */
1233 trim(str: string): string;
1234
1235 /**
1236 * Determine the internal JavaScript [[Class]] of an object.
1237 *
1238 * @param obj Object to get the internal JavaScript [[Class]] of.
1239 */
1240 type(obj: any): string;
1241
1242 /**
1243 * 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.
1244 *
1245 * @param array The Array of DOM elements.
1246 */
1247 unique(array: Element[]): Element[];
1248
1249 /**
1250 * Parses a string into an array of DOM nodes.
1251 *
1252 * @param data HTML string to be parsed
1253 * @param context DOM element to serve as the context in which the HTML fragment will be created
1254 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
1255 */
1256 parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
1257
1258 /**
1259 * Parses a string into an array of DOM nodes.
1260 *
1261 * @param data HTML string to be parsed
1262 * @param context DOM element to serve as the context in which the HTML fragment will be created
1263 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
1264 */
1265 parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
1266}
1267
1268/**
1269 * The jQuery instance members
1270 */
1271interface JQuery {
1272 /**
1273 * Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
1274 *
1275 * @param handler The function to be invoked.
1276 */
1277 ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery;
1278 /**
1279 * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
1280 *
1281 * @param handler The function to be invoked.
1282 */
1283 ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery;
1284 /**
1285 * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
1286 *
1287 * @param handler The function to be invoked.
1288 */
1289 ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
1290 /**
1291 * Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
1292 *
1293 * @param handler The function to be invoked.
1294 */
1295 ajaxStart(handler: () => any): JQuery;
1296 /**
1297 * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
1298 *
1299 * @param handler The function to be invoked.
1300 */
1301 ajaxStop(handler: () => any): JQuery;
1302 /**
1303 * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
1304 *
1305 * @param handler The function to be invoked.
1306 */
1307 ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
1308
1309 /**
1310 * Load data from the server and place the returned HTML into the matched element.
1311 *
1312 * @param url A string containing the URL to which the request is sent.
1313 * @param data A plain object or string that is sent to the server with the request.
1314 * @param complete A callback function that is executed when the request completes.
1315 */
1316 load(url: string, data?: string, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery;
1317 /**
1318 * Load data from the server and place the returned HTML into the matched element.
1319 *
1320 * @param url A string containing the URL to which the request is sent.
1321 * @param data A plain object or string that is sent to the server with the request.
1322 * @param complete A callback function that is executed when the request completes.
1323 */
1324 load(url: string, data?: Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery;
1325
1326 /**
1327 * Encode a set of form elements as a string for submission.
1328 */
1329 serialize(): string;
1330 /**
1331 * Encode a set of form elements as an array of names and values.
1332 */
1333 serializeArray(): Object[];
1334
1335 /**
1336 * Adds the specified class(es) to each of the set of matched elements.
1337 *
1338 * @param className One or more space-separated classes to be added to the class attribute of each matched element.
1339 */
1340 addClass(className: string): JQuery;
1341 /**
1342 * Adds the specified class(es) to each of the set of matched elements.
1343 *
1344 * @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.
1345 */
1346 addClass(func: (index: number, className: string) => string): JQuery;
1347
1348 /**
1349 * Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
1350 */
1351 addBack(selector?: string): JQuery;
1352
1353 /**
1354 * Get the value of an attribute for the first element in the set of matched elements.
1355 *
1356 * @param attributeName The name of the attribute to get.
1357 */
1358 attr(attributeName: string): string;
1359 /**
1360 * Set one or more attributes for the set of matched elements.
1361 *
1362 * @param attributeName The name of the attribute to set.
1363 * @param value A value to set for the attribute.
1364 */
1365 attr(attributeName: string, value: string): JQuery;
1366 /**
1367 * Set one or more attributes for the set of matched elements.
1368 *
1369 * @param attributeName The name of the attribute to set.
1370 * @param value A value to set for the attribute.
1371 */
1372 attr(attributeName: string, value: number): JQuery;
1373 /**
1374 * Set one or more attributes for the set of matched elements.
1375 *
1376 * @param attributeName The name of the attribute to set.
1377 * @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.
1378 */
1379 attr(attributeName: string, func: (index: number, attr: any) => any): JQuery;
1380 /**
1381 * Set one or more attributes for the set of matched elements.
1382 *
1383 * @param attributes An object of attribute-value pairs to set.
1384 */
1385 attr(attributes: Object): JQuery;
1386
1387 /**
1388 * Determine whether any of the matched elements are assigned the given class.
1389 *
1390 * @param className The class name to search for.
1391 */
1392 hasClass(className: string): boolean;
1393
1394 /**
1395 * Get the HTML contents of the first element in the set of matched elements.
1396 */
1397 html(): string;
1398 /**
1399 * Set the HTML contents of each element in the set of matched elements.
1400 *
1401 * @param htmlString A string of HTML to set as the content of each matched element.
1402 */
1403 html(htmlString: string): JQuery;
1404 /**
1405 * Set the HTML contents of each element in the set of matched elements.
1406 *
1407 * @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.
1408 */
1409 html(func: (index: number, oldhtml: string) => string): JQuery;
1410 /**
1411 * Set the HTML contents of each element in the set of matched elements.
1412 *
1413 * @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.
1414 */
1415
1416 /**
1417 * Get the value of a property for the first element in the set of matched elements.
1418 *
1419 * @param propertyName The name of the property to get.
1420 */
1421 prop(propertyName: string): any;
1422 /**
1423 * Set one or more properties for the set of matched elements.
1424 *
1425 * @param propertyName The name of the property to set.
1426 * @param value A value to set for the property.
1427 */
1428 prop(propertyName: string, value: string): JQuery;
1429 /**
1430 * Set one or more properties for the set of matched elements.
1431 *
1432 * @param propertyName The name of the property to set.
1433 * @param value A value to set for the property.
1434 */
1435 prop(propertyName: string, value: number): JQuery;
1436 /**
1437 * Set one or more properties for the set of matched elements.
1438 *
1439 * @param propertyName The name of the property to set.
1440 * @param value A value to set for the property.
1441 */
1442 prop(propertyName: string, value: boolean): JQuery;
1443 /**
1444 * Set one or more properties for the set of matched elements.
1445 *
1446 * @param properties An object of property-value pairs to set.
1447 */
1448 prop(properties: Object): JQuery;
1449 /**
1450 * Set one or more properties for the set of matched elements.
1451 *
1452 * @param propertyName The name of the property to set.
1453 * @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.
1454 */
1455 prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery;
1456
1457 /**
1458 * Remove an attribute from each element in the set of matched elements.
1459 *
1460 * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
1461 */
1462 removeAttr(attributeName: string): JQuery;
1463
1464 /**
1465 * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
1466 *
1467 * @param className One or more space-separated classes to be removed from the class attribute of each matched element.
1468 */
1469 removeClass(className?: string): JQuery;
1470 /**
1471 * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
1472 *
1473 * @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.
1474 */
1475 removeClass(func: (index: number, className: string) => string): JQuery;
1476
1477 /**
1478 * Remove a property for the set of matched elements.
1479 *
1480 * @param propertyName The name of the property to remove.
1481 */
1482 removeProp(propertyName: string): JQuery;
1483
1484 /**
1485 * 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.
1486 *
1487 * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
1488 * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
1489 */
1490 toggleClass(className: string, swtch?: boolean): JQuery;
1491 /**
1492 * 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.
1493 *
1494 * @param swtch A boolean value to determine whether the class should be added or removed.
1495 */
1496 toggleClass(swtch?: boolean): JQuery;
1497 /**
1498 * 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.
1499 *
1500 * @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.
1501 * @param swtch A boolean value to determine whether the class should be added or removed.
1502 */
1503 toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery;
1504
1505 /**
1506 * Get the current value of the first element in the set of matched elements.
1507 */
1508 val(): any;
1509 /**
1510 * Set the value of each element in the set of matched elements.
1511 *
1512 * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
1513 */
1514 val(value: string): JQuery;
1515 /**
1516 * Set the value of each element in the set of matched elements.
1517 *
1518 * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
1519 */
1520 val(value: string[]): JQuery;
1521 /**
1522 * Set the value of each element in the set of matched elements.
1523 *
1524 * @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.
1525 */
1526 val(func: (index: number, value: string) => string): JQuery;
1527 /**
1528 * Set the value of each element in the set of matched elements.
1529 *
1530 * @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.
1531 */
1532 val(func: (index: number, value: string[]) => string): JQuery;
1533 /**
1534 * Set the value of each element in the set of matched elements.
1535 *
1536 * @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.
1537 */
1538 val(func: (index: number, value: number) => string): JQuery;
1539 /**
1540 * Set the value of each element in the set of matched elements.
1541 *
1542 * @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.
1543 */
1544 val(func: (index: number, value: string) => string[]): JQuery;
1545 /**
1546 * Set the value of each element in the set of matched elements.
1547 *
1548 * @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.
1549 */
1550 val(func: (index: number, value: string[]) => string[]): JQuery;
1551 /**
1552 * Set the value of each element in the set of matched elements.
1553 *
1554 * @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.
1555 */
1556 val(func: (index: number, value: number) => string[]): JQuery;
1557
1558 /**
1559 * Get the value of style properties for the first element in the set of matched elements.
1560 *
1561 * @param propertyName A CSS property.
1562 */
1563 css(propertyName: string): string;
1564 /**
1565 * Set one or more CSS properties for the set of matched elements.
1566 *
1567 * @param propertyName A CSS property name.
1568 * @param value A value to set for the property.
1569 */
1570 css(propertyName: string, value: string): JQuery;
1571 /**
1572 * Set one or more CSS properties for the set of matched elements.
1573 *
1574 * @param propertyName A CSS property name.
1575 * @param value A value to set for the property.
1576 */
1577 css(propertyName: string, value: number): JQuery;
1578 /**
1579 * Set one or more CSS properties for the set of matched elements.
1580 *
1581 * @param propertyName A CSS property name.
1582 * @param value A value to set for the property.
1583 */
1584 css(propertyName: string, value: string[]): JQuery;
1585 /**
1586 * Set one or more CSS properties for the set of matched elements.
1587 *
1588 * @param propertyName A CSS property name.
1589 * @param value A value to set for the property.
1590 */
1591 css(propertyName: string, value: number[]): JQuery;
1592 /**
1593 * Set one or more CSS properties for the set of matched elements.
1594 *
1595 * @param propertyName A CSS property name.
1596 * @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.
1597 */
1598 css(propertyName: string, value: (index: number, value: string) => string): JQuery;
1599 /**
1600 * Set one or more CSS properties for the set of matched elements.
1601 *
1602 * @param propertyName A CSS property name.
1603 * @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.
1604 */
1605 css(propertyName: string, value: (index: number, value: number) => number): JQuery;
1606 /**
1607 * Set one or more CSS properties for the set of matched elements.
1608 *
1609 * @param properties An object of property-value pairs to set.
1610 */
1611 css(properties: Object): JQuery;
1612
1613 /**
1614 * Get the current computed height for the first element in the set of matched elements.
1615 */
1616 height(): number;
1617 /**
1618 * Set the CSS height of every matched element.
1619 *
1620 * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
1621 */
1622 height(value: number): JQuery;
1623 /**
1624 * Set the CSS height of every matched element.
1625 *
1626 * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
1627 */
1628 height(value: string): JQuery;
1629 /**
1630 * Set the CSS height of every matched element.
1631 *
1632 * @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.
1633 */
1634 height(func: (index: number, height: number) => number): JQuery;
1635 /**
1636 * Set the CSS height of every matched element.
1637 *
1638 * @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.
1639 */
1640 height(func: (index: number, height: string) => string): JQuery;
1641 /**
1642 * Set the CSS height of every matched element.
1643 *
1644 * @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.
1645 */
1646 height(func: (index: number, height: string) => number): JQuery;
1647 /**
1648 * Set the CSS height of every matched element.
1649 *
1650 * @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.
1651 */
1652 height(func: (index: number, height: number) => string): JQuery;
1653
1654 /**
1655 * Get the current computed height for the first element in the set of matched elements, including padding but not border.
1656 */
1657 innerHeight(): number;
1658
1659 /**
1660 * Sets the inner height on elements in the set of matched elements, including padding but not border.
1661 *
1662 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1663 */
1664 innerHeight(height: number): JQuery;
1665
1666 /**
1667 * Sets the inner height on elements in the set of matched elements, including padding but not border.
1668 *
1669 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1670 */
1671 innerHeight(height: string): JQuery;
1672
1673 /**
1674 * Get the current computed width for the first element in the set of matched elements, including padding but not border.
1675 */
1676 innerWidth(): number;
1677
1678 /**
1679 * Sets the inner width on elements in the set of matched elements, including padding but not border.
1680 *
1681 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1682 */
1683 innerWidth(width: number): JQuery;
1684
1685 /**
1686 * Sets the inner width on elements in the set of matched elements, including padding but not border.
1687 *
1688 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1689 */
1690 innerWidth(width: string): JQuery;
1691
1692 /**
1693 * Get the current coordinates of the first element in the set of matched elements, relative to the document.
1694 */
1695 offset(): JQueryCoordinates;
1696 /**
1697 * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1698 *
1699 * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1700 */
1701 offset(coordinates: JQueryCoordinates): JQuery;
1702 /**
1703 * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1704 *
1705 * @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.
1706 */
1707 offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
1708
1709 /**
1710 * 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.
1711 *
1712 * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
1713 */
1714 outerHeight(includeMargin?: boolean): number;
1715
1716 /**
1717 * Sets the outer height on elements in the set of matched elements, including padding and border.
1718 *
1719 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1720 */
1721 outerHeight(height: number): JQuery;
1722
1723 /**
1724 * Sets the outer height on elements in the set of matched elements, including padding and border.
1725 *
1726 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1727 */
1728 outerHeight(height: string): JQuery;
1729
1730 /**
1731 * Get the current computed width for the first element in the set of matched elements, including padding and border.
1732 *
1733 * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
1734 */
1735 outerWidth(includeMargin?: boolean): number;
1736
1737 /**
1738 * Sets the outer width on elements in the set of matched elements, including padding and border.
1739 *
1740 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1741 */
1742 outerWidth(width: number): JQuery;
1743
1744 /**
1745 * Sets the outer width on elements in the set of matched elements, including padding and border.
1746 *
1747 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1748 */
1749 outerWidth(width: string): JQuery;
1750
1751 /**
1752 * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
1753 */
1754 position(): JQueryCoordinates;
1755
1756 /**
1757 * 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.
1758 */
1759 scrollLeft(): number;
1760 /**
1761 * Set the current horizontal position of the scroll bar for each of the set of matched elements.
1762 *
1763 * @param value An integer indicating the new position to set the scroll bar to.
1764 */
1765 scrollLeft(value: number): JQuery;
1766
1767 /**
1768 * 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.
1769 */
1770 scrollTop(): number;
1771 /**
1772 * Set the current vertical position of the scroll bar for each of the set of matched elements.
1773 *
1774 * @param value An integer indicating the new position to set the scroll bar to.
1775 */
1776 scrollTop(value: number): JQuery;
1777
1778 /**
1779 * Get the current computed width for the first element in the set of matched elements.
1780 */
1781 width(): number;
1782 /**
1783 * Set the CSS width of each element in the set of matched elements.
1784 *
1785 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1786 */
1787 width(value: number): JQuery;
1788 /**
1789 * Set the CSS width of each element in the set of matched elements.
1790 *
1791 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1792 */
1793 width(value: string): JQuery;
1794 /**
1795 * Set the CSS width of each element in the set of matched elements.
1796 *
1797 * @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.
1798 */
1799 width(func: (index: number, width: number) => number): JQuery;
1800 /**
1801 * Set the CSS width of each element in the set of matched elements.
1802 *
1803 * @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.
1804 */
1805 width(func: (index: number, width: string) => string): JQuery;
1806 /**
1807 * Set the CSS width of each element in the set of matched elements.
1808 *
1809 * @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.
1810 */
1811 width(func: (index: number, width: string) => number): JQuery;
1812 /**
1813 * Set the CSS width of each element in the set of matched elements.
1814 *
1815 * @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.
1816 */
1817 width(func: (index: number, width: number) => string): JQuery;
1818
1819 /**
1820 * Remove from the queue all items that have not yet been run.
1821 *
1822 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1823 */
1824 clearQueue(queueName?: string): JQuery;
1825
1826 /**
1827 * Store arbitrary data associated with the matched elements.
1828 *
1829 * @param key A string naming the piece of data to set.
1830 * @param value The new data value; it can be any Javascript type including Array or Object.
1831 */
1832 data(key: string, value: any): JQuery;
1833 /**
1834 * Store arbitrary data associated with the matched elements.
1835 *
1836 * @param obj An object of key-value pairs of data to update.
1837 */
1838 data(obj: { [key: string]: any; }): JQuery;
1839 /**
1840 * 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.
1841 *
1842 * @param key Name of the data stored.
1843 */
1844 data(key: string): any;
1845 /**
1846 * 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.
1847 */
1848 data(): any;
1849
1850 /**
1851 * Execute the next function on the queue for the matched elements.
1852 *
1853 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1854 */
1855 dequeue(queueName?: string): JQuery;
1856
1857 /**
1858 * Remove a previously-stored piece of data.
1859 *
1860 * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
1861 */
1862 removeData(name: string): JQuery;
1863 /**
1864 * Remove a previously-stored piece of data.
1865 *
1866 * @param list An array of strings naming the pieces of data to delete.
1867 */
1868 removeData(list: string[]): JQuery;
1869
1870 /**
1871 * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
1872 *
1873 * @param type The type of queue that needs to be observed. (default: fx)
1874 * @param target Object onto which the promise methods have to be attached
1875 */
1876 promise(type?: string, target?: Object): JQueryPromise<any>;
1877
1878 /**
1879 * Perform a custom animation of a set of CSS properties.
1880 *
1881 * @param properties An object of CSS properties and values that the animation will move toward.
1882 * @param duration A string or number determining how long the animation will run.
1883 * @param complete A function to call once the animation is complete.
1884 */
1885 animate(properties: Object, duration?: string, complete?: Function): JQuery;
1886 /**
1887 * Perform a custom animation of a set of CSS properties.
1888 *
1889 * @param properties An object of CSS properties and values that the animation will move toward.
1890 * @param duration A string or number determining how long the animation will run.
1891 * @param complete A function to call once the animation is complete.
1892 */
1893 animate(properties: Object, duration?: number, complete?: Function): JQuery;
1894 /**
1895 * Perform a custom animation of a set of CSS properties.
1896 *
1897 * @param properties An object of CSS properties and values that the animation will move toward.
1898 * @param duration A string or number determining how long the animation will run.
1899 * @param easing A string indicating which easing function to use for the transition. (default: swing)
1900 * @param complete A function to call once the animation is complete.
1901 */
1902 animate(properties: Object, duration?: string, easing?: string, complete?: Function): JQuery;
1903 /**
1904 * Perform a custom animation of a set of CSS properties.
1905 *
1906 * @param properties An object of CSS properties and values that the animation will move toward.
1907 * @param duration A string or number determining how long the animation will run.
1908 * @param easing A string indicating which easing function to use for the transition. (default: swing)
1909 * @param complete A function to call once the animation is complete.
1910 */
1911 animate(properties: Object, duration?: number, easing?: string, complete?: Function): JQuery;
1912 /**
1913 * Perform a custom animation of a set of CSS properties.
1914 *
1915 * @param properties An object of CSS properties and values that the animation will move toward.
1916 * @param options A map of additional options to pass to the method.
1917 */
1918 animate(properties: Object, options: JQueryAnimationOptions): JQuery;
1919
1920 /**
1921 * Set a timer to delay execution of subsequent items in the queue.
1922 *
1923 * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
1924 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1925 */
1926 delay(duration: number, queueName?: string): JQuery;
1927
1928 /**
1929 * Display the matched elements by fading them to opaque.
1930 *
1931 * @param duration A string or number determining how long the animation will run.
1932 * @param complete A function to call once the animation is complete.
1933 */
1934 fadeIn(duration?: number, complete?: Function): JQuery;
1935 /**
1936 * Display the matched elements by fading them to opaque.
1937 *
1938 * @param duration A string or number determining how long the animation will run.
1939 * @param complete A function to call once the animation is complete.
1940 */
1941 fadeIn(duration?: string, complete?: Function): JQuery;
1942 /**
1943 * Display the matched elements by fading them to opaque.
1944 *
1945 * @param duration A string or number determining how long the animation will run.
1946 * @param easing A string indicating which easing function to use for the transition.
1947 * @param complete A function to call once the animation is complete.
1948 */
1949 fadeIn(duration?: number, easing?: string, complete?: Function): JQuery;
1950 /**
1951 * Display the matched elements by fading them to opaque.
1952 *
1953 * @param duration A string or number determining how long the animation will run.
1954 * @param easing A string indicating which easing function to use for the transition.
1955 * @param complete A function to call once the animation is complete.
1956 */
1957 fadeIn(duration?: string, easing?: string, complete?: Function): JQuery;
1958 /**
1959 * Display the matched elements by fading them to opaque.
1960 *
1961 * @param options A map of additional options to pass to the method.
1962 */
1963 fadeIn(options: JQueryAnimationOptions): JQuery;
1964
1965 /**
1966 * Hide the matched elements by fading them to transparent.
1967 *
1968 * @param duration A string or number determining how long the animation will run.
1969 * @param complete A function to call once the animation is complete.
1970 */
1971 fadeOut(duration?: number, complete?: Function): JQuery;
1972 /**
1973 * Hide the matched elements by fading them to transparent.
1974 *
1975 * @param duration A string or number determining how long the animation will run.
1976 * @param complete A function to call once the animation is complete.
1977 */
1978 fadeOut(duration?: string, complete?: Function): JQuery;
1979 /**
1980 * Hide the matched elements by fading them to transparent.
1981 *
1982 * @param duration A string or number determining how long the animation will run.
1983 * @param easing A string indicating which easing function to use for the transition.
1984 * @param complete A function to call once the animation is complete.
1985 */
1986 fadeOut(duration?: number, easing?: string, complete?: Function): JQuery;
1987 /**
1988 * Hide the matched elements by fading them to transparent.
1989 *
1990 * @param duration A string or number determining how long the animation will run.
1991 * @param easing A string indicating which easing function to use for the transition.
1992 * @param complete A function to call once the animation is complete.
1993 */
1994 fadeOut(duration?: string, easing?: string, complete?: Function): JQuery;
1995 /**
1996 * Hide the matched elements by fading them to transparent.
1997 *
1998 * @param options A map of additional options to pass to the method.
1999 */
2000 fadeOut(options: JQueryAnimationOptions): JQuery;
2001
2002 /**
2003 * Adjust the opacity of the matched elements.
2004 *
2005 * @param duration A string or number determining how long the animation will run.
2006 * @param opacity A number between 0 and 1 denoting the target opacity.
2007 * @param complete A function to call once the animation is complete.
2008 */
2009 fadeTo(duration: string, opacity: number, complete?: Function): JQuery;
2010 /**
2011 * Adjust the opacity of the matched elements.
2012 *
2013 * @param duration A string or number determining how long the animation will run.
2014 * @param opacity A number between 0 and 1 denoting the target opacity.
2015 * @param complete A function to call once the animation is complete.
2016 */
2017 fadeTo(duration: number, opacity: number, complete?: Function): JQuery;
2018 /**
2019 * Adjust the opacity of the matched elements.
2020 *
2021 * @param duration A string or number determining how long the animation will run.
2022 * @param opacity A number between 0 and 1 denoting the target opacity.
2023 * @param easing A string indicating which easing function to use for the transition.
2024 * @param complete A function to call once the animation is complete.
2025 */
2026 fadeTo(duration: string, opacity: number, easing?: string, complete?: Function): JQuery;
2027 /**
2028 * Adjust the opacity of the matched elements.
2029 *
2030 * @param duration A string or number determining how long the animation will run.
2031 * @param opacity A number between 0 and 1 denoting the target opacity.
2032 * @param easing A string indicating which easing function to use for the transition.
2033 * @param complete A function to call once the animation is complete.
2034 */
2035 fadeTo(duration: number, opacity: number, easing?: string, complete?: Function): JQuery;
2036
2037 /**
2038 * Display or hide the matched elements by animating their opacity.
2039 *
2040 * @param duration A string or number determining how long the animation will run.
2041 * @param complete A function to call once the animation is complete.
2042 */
2043 fadeToggle(duration?: number, complete?: Function): JQuery;
2044 /**
2045 * Display or hide the matched elements by animating their opacity.
2046 *
2047 * @param duration A string or number determining how long the animation will run.
2048 * @param complete A function to call once the animation is complete.
2049 */
2050 fadeToggle(duration?: string, complete?: Function): JQuery;
2051 /**
2052 * Display or hide the matched elements by animating their opacity.
2053 *
2054 * @param duration A string or number determining how long the animation will run.
2055 * @param easing A string indicating which easing function to use for the transition.
2056 * @param complete A function to call once the animation is complete.
2057 */
2058 fadeToggle(duration?: number, easing?: string, complete?: Function): JQuery;
2059 /**
2060 * Display or hide the matched elements by animating their opacity.
2061 *
2062 * @param duration A string or number determining how long the animation will run.
2063 * @param easing A string indicating which easing function to use for the transition.
2064 * @param complete A function to call once the animation is complete.
2065 */
2066 fadeToggle(duration?: string, easing?: string, complete?: Function): JQuery;
2067 /**
2068 * Display or hide the matched elements by animating their opacity.
2069 *
2070 * @param options A map of additional options to pass to the method.
2071 */
2072 fadeToggle(options: JQueryAnimationOptions): JQuery;
2073
2074 /**
2075 * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
2076 *
2077 * @param queue The name of the queue in which to stop animations.
2078 */
2079 finish(queue?: string): JQuery;
2080
2081 /**
2082 * Hide the matched elements.
2083 *
2084 * @param duration A string or number determining how long the animation will run.
2085 * @param complete A function to call once the animation is complete.
2086 */
2087 hide(duration?: number, complete?: Function): JQuery;
2088 /**
2089 * Hide the matched elements.
2090 *
2091 * @param duration A string or number determining how long the animation will run.
2092 * @param complete A function to call once the animation is complete.
2093 */
2094 hide(duration?: string, complete?: Function): JQuery;
2095 /**
2096 * Hide the matched elements.
2097 *
2098 * @param duration A string or number determining how long the animation will run.
2099 * @param easing A string indicating which easing function to use for the transition.
2100 * @param complete A function to call once the animation is complete.
2101 */
2102 hide(duration?: number, easing?: string, complete?: Function): JQuery;
2103 /**
2104 * Hide the matched elements.
2105 *
2106 * @param duration A string or number determining how long the animation will run.
2107 * @param easing A string indicating which easing function to use for the transition.
2108 * @param complete A function to call once the animation is complete.
2109 */
2110 hide(duration?: string, easing?: string, complete?: Function): JQuery;
2111 /**
2112 * Hide the matched elements.
2113 *
2114 * @param options A map of additional options to pass to the method.
2115 */
2116 hide(options: JQueryAnimationOptions): JQuery;
2117
2118 /**
2119 * Display the matched elements.
2120 *
2121 * @param duration A string or number determining how long the animation will run.
2122 * @param complete A function to call once the animation is complete.
2123 */
2124 show(duration?: number, complete?: Function): JQuery;
2125 /**
2126 * Display the matched elements.
2127 *
2128 * @param duration A string or number determining how long the animation will run.
2129 * @param complete A function to call once the animation is complete.
2130 */
2131 show(duration?: string, complete?: Function): JQuery;
2132 /**
2133 * Display the matched elements.
2134 *
2135 * @param duration A string or number determining how long the animation will run.
2136 * @param easing A string indicating which easing function to use for the transition.
2137 * @param complete A function to call once the animation is complete.
2138 */
2139 show(duration?: number, easing?: string, complete?: Function): JQuery;
2140 /**
2141 * Display the matched elements.
2142 *
2143 * @param duration A string or number determining how long the animation will run.
2144 * @param easing A string indicating which easing function to use for the transition.
2145 * @param complete A function to call once the animation is complete.
2146 */
2147 show(duration?: string, easing?: string, complete?: Function): JQuery;
2148 /**
2149 * Display the matched elements.
2150 *
2151 * @param options A map of additional options to pass to the method.
2152 */
2153 show(options: JQueryAnimationOptions): JQuery;
2154
2155 /**
2156 * Display the matched elements with a sliding motion.
2157 *
2158 * @param duration A string or number determining how long the animation will run.
2159 * @param complete A function to call once the animation is complete.
2160 */
2161 slideDown(duration?: number, complete?: Function): JQuery;
2162 /**
2163 * Display the matched elements with a sliding motion.
2164 *
2165 * @param duration A string or number determining how long the animation will run.
2166 * @param complete A function to call once the animation is complete.
2167 */
2168 slideDown(duration?: string, complete?: Function): JQuery;
2169 /**
2170 * Display the matched elements with a sliding motion.
2171 *
2172 * @param duration A string or number determining how long the animation will run.
2173 * @param easing A string indicating which easing function to use for the transition.
2174 * @param complete A function to call once the animation is complete.
2175 */
2176 slideDown(duration?: number, easing?: string, complete?: Function): JQuery;
2177 /**
2178 * Display the matched elements with a sliding motion.
2179 *
2180 * @param duration A string or number determining how long the animation will run.
2181 * @param easing A string indicating which easing function to use for the transition.
2182 * @param complete A function to call once the animation is complete.
2183 */
2184 slideDown(duration?: string, easing?: string, complete?: Function): JQuery;
2185 /**
2186 * Display the matched elements with a sliding motion.
2187 *
2188 * @param options A map of additional options to pass to the method.
2189 */
2190 slideDown(options: JQueryAnimationOptions): JQuery;
2191
2192 /**
2193 * Display or hide the matched elements with a sliding motion.
2194 *
2195 * @param duration A string or number determining how long the animation will run.
2196 * @param complete A function to call once the animation is complete.
2197 */
2198 slideToggle(duration?: number, complete?: Function): JQuery;
2199 /**
2200 * Display or hide the matched elements with a sliding motion.
2201 *
2202 * @param duration A string or number determining how long the animation will run.
2203 * @param complete A function to call once the animation is complete.
2204 */
2205 slideToggle(duration?: string, complete?: Function): JQuery;
2206 /**
2207 * Display or hide the matched elements with a sliding motion.
2208 *
2209 * @param duration A string or number determining how long the animation will run.
2210 * @param easing A string indicating which easing function to use for the transition.
2211 * @param complete A function to call once the animation is complete.
2212 */
2213 slideToggle(duration?: number, easing?: string, complete?: Function): JQuery;
2214 /**
2215 * Display or hide the matched elements with a sliding motion.
2216 *
2217 * @param duration A string or number determining how long the animation will run.
2218 * @param easing A string indicating which easing function to use for the transition.
2219 * @param complete A function to call once the animation is complete.
2220 */
2221 slideToggle(duration?: string, easing?: string, complete?: Function): JQuery;
2222 /**
2223 * Display or hide the matched elements with a sliding motion.
2224 *
2225 * @param options A map of additional options to pass to the method.
2226 */
2227 slideToggle(options: JQueryAnimationOptions): JQuery;
2228
2229 /**
2230 * Hide the matched elements with a sliding motion.
2231 *
2232 * @param duration A string or number determining how long the animation will run.
2233 * @param complete A function to call once the animation is complete.
2234 */
2235 slideUp(duration?: number, complete?: Function): JQuery;
2236 /**
2237 * Hide the matched elements with a sliding motion.
2238 *
2239 * @param duration A string or number determining how long the animation will run.
2240 * @param complete A function to call once the animation is complete.
2241 */
2242 slideUp(duration?: string, complete?: Function): JQuery;
2243 /**
2244 * Hide the matched elements with a sliding motion.
2245 *
2246 * @param duration A string or number determining how long the animation will run.
2247 * @param easing A string indicating which easing function to use for the transition.
2248 * @param complete A function to call once the animation is complete.
2249 */
2250 slideUp(duration?: number, easing?: string, complete?: Function): JQuery;
2251 /**
2252 * Hide the matched elements with a sliding motion.
2253 *
2254 * @param duration A string or number determining how long the animation will run.
2255 * @param easing A string indicating which easing function to use for the transition.
2256 * @param complete A function to call once the animation is complete.
2257 */
2258 slideUp(duration?: string, easing?: string, complete?: Function): JQuery;
2259 /**
2260 * Hide the matched elements with a sliding motion.
2261 *
2262 * @param options A map of additional options to pass to the method.
2263 */
2264 slideUp(options: JQueryAnimationOptions): JQuery;
2265
2266 /**
2267 * Stop the currently-running animation on the matched elements.
2268 *
2269 * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
2270 * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
2271 */
2272 stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
2273 /**
2274 * Stop the currently-running animation on the matched elements.
2275 *
2276 * @param queue The name of the queue in which to stop animations.
2277 * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
2278 * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
2279 */
2280 stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
2281
2282 /**
2283 * Display or hide the matched elements.
2284 *
2285 * @param duration A string or number determining how long the animation will run.
2286 * @param complete A function to call once the animation is complete.
2287 */
2288 toggle(duration?: number, complete?: Function): JQuery;
2289 /**
2290 * Display or hide the matched elements.
2291 *
2292 * @param duration A string or number determining how long the animation will run.
2293 * @param complete A function to call once the animation is complete.
2294 */
2295 toggle(duration?: string, complete?: Function): JQuery;
2296 /**
2297 * Display or hide the matched elements.
2298 *
2299 * @param duration A string or number determining how long the animation will run.
2300 * @param easing A string indicating which easing function to use for the transition.
2301 * @param complete A function to call once the animation is complete.
2302 */
2303 toggle(duration?: number, easing?: string, complete?: Function): JQuery;
2304 /**
2305 * Display or hide the matched elements.
2306 *
2307 * @param duration A string or number determining how long the animation will run.
2308 * @param easing A string indicating which easing function to use for the transition.
2309 * @param complete A function to call once the animation is complete.
2310 */
2311 toggle(duration?: string, easing?: string, complete?: Function): JQuery;
2312 /**
2313 * Display or hide the matched elements.
2314 *
2315 * @param options A map of additional options to pass to the method.
2316 */
2317 toggle(options: JQueryAnimationOptions): JQuery;
2318 /**
2319 * Display or hide the matched elements.
2320 *
2321 * @param showOrHide A Boolean indicating whether to show or hide the elements.
2322 */
2323 toggle(showOrHide: boolean): JQuery;
2324
2325 /**
2326 * Attach a handler to an event for the elements.
2327 *
2328 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
2329 * @param eventData An object containing data that will be passed to the event handler.
2330 * @param handler A function to execute each time the event is triggered.
2331 */
2332 bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
2333 /**
2334 * Attach a handler to an event for the elements.
2335 *
2336 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
2337 * @param handler A function to execute each time the event is triggered.
2338 */
2339 bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2340 /**
2341 * Attach a handler to an event for the elements.
2342 *
2343 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
2344 * @param eventData An object containing data that will be passed to the event handler.
2345 * @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.
2346 */
2347 bind(eventType: string, eventData: any, preventBubble: boolean): JQuery;
2348 /**
2349 * Attach a handler to an event for the elements.
2350 *
2351 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
2352 * @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.
2353 */
2354 bind(eventType: string, preventBubble: boolean): JQuery;
2355 /**
2356 * Attach a handler to an event for the elements.
2357 *
2358 * @param events An object containing one or more DOM event types and functions to execute for them.
2359 */
2360 bind(events: any): JQuery;
2361
2362 /**
2363 * Trigger the "blur" event on an element
2364 */
2365 blur(): JQuery;
2366 /**
2367 * Bind an event handler to the "blur" JavaScript event
2368 *
2369 * @param handler A function to execute each time the event is triggered.
2370 */
2371 blur(handler: (eventObject: JQueryEventObject) => any): JQuery;
2372 /**
2373 * Bind an event handler to the "blur" JavaScript event
2374 *
2375 * @param eventData An object containing data that will be passed to the event handler.
2376 * @param handler A function to execute each time the event is triggered.
2377 */
2378 blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2379
2380 /**
2381 * Trigger the "change" event on an element.
2382 */
2383 change(): JQuery;
2384 /**
2385 * Bind an event handler to the "change" JavaScript event
2386 *
2387 * @param handler A function to execute each time the event is triggered.
2388 */
2389 change(handler: (eventObject: JQueryEventObject) => any): JQuery;
2390 /**
2391 * Bind an event handler to the "change" JavaScript event
2392 *
2393 * @param eventData An object containing data that will be passed to the event handler.
2394 * @param handler A function to execute each time the event is triggered.
2395 */
2396 change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2397
2398 /**
2399 * Trigger the "click" event on an element.
2400 */
2401 click(): JQuery;
2402 /**
2403 * Bind an event handler to the "click" JavaScript event
2404 *
2405 * @param eventData An object containing data that will be passed to the event handler.
2406 */
2407 click(handler: (eventObject: JQueryEventObject) => any): JQuery;
2408 /**
2409 * Bind an event handler to the "click" JavaScript event
2410 *
2411 * @param eventData An object containing data that will be passed to the event handler.
2412 * @param handler A function to execute each time the event is triggered.
2413 */
2414 click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2415
2416 /**
2417 * Trigger the "dblclick" event on an element.
2418 */
2419 dblclick(): JQuery;
2420 /**
2421 * Bind an event handler to the "dblclick" JavaScript event
2422 *
2423 * @param handler A function to execute each time the event is triggered.
2424 */
2425 dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery;
2426 /**
2427 * Bind an event handler to the "dblclick" JavaScript event
2428 *
2429 * @param eventData An object containing data that will be passed to the event handler.
2430 * @param handler A function to execute each time the event is triggered.
2431 */
2432 dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2433
2434 delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2435 delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
2436
2437 /**
2438 * Trigger the "focus" event on an element.
2439 */
2440 focus(): JQuery;
2441 /**
2442 * Bind an event handler to the "focus" JavaScript event
2443 *
2444 * @param handler A function to execute each time the event is triggered.
2445 */
2446 focus(handler: (eventObject: JQueryEventObject) => any): JQuery;
2447 /**
2448 * Bind an event handler to the "focus" JavaScript event
2449 *
2450 * @param eventData An object containing data that will be passed to the event handler.
2451 * @param handler A function to execute each time the event is triggered.
2452 */
2453 focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2454
2455 /**
2456 * Bind an event handler to the "focusin" JavaScript event
2457 *
2458 * @param handler A function to execute each time the event is triggered.
2459 */
2460 focusin(handler: (eventObject: JQueryEventObject) => any): JQuery;
2461 /**
2462 * Bind an event handler to the "focusin" JavaScript event
2463 *
2464 * @param eventData An object containing data that will be passed to the event handler.
2465 * @param handler A function to execute each time the event is triggered.
2466 */
2467 focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2468
2469 /**
2470 * Bind an event handler to the "focusout" JavaScript event
2471 *
2472 * @param handler A function to execute each time the event is triggered.
2473 */
2474 focusout(handler: (eventObject: JQueryEventObject) => any): JQuery;
2475 /**
2476 * Bind an event handler to the "focusout" JavaScript event
2477 *
2478 * @param eventData An object containing data that will be passed to the event handler.
2479 * @param handler A function to execute each time the event is triggered.
2480 */
2481 focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2482
2483 /**
2484 * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
2485 *
2486 * @param handlerIn A function to execute when the mouse pointer enters the element.
2487 * @param handlerOut A function to execute when the mouse pointer leaves the element.
2488 */
2489 hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery;
2490 /**
2491 * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
2492 *
2493 * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element.
2494 */
2495 hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;
2496
2497 /**
2498 * Trigger the "keydown" event on an element.
2499 */
2500 keydown(): JQuery;
2501 /**
2502 * Bind an event handler to the "keydown" JavaScript event
2503 *
2504 * @param handler A function to execute each time the event is triggered.
2505 */
2506 keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2507 /**
2508 * Bind an event handler to the "keydown" JavaScript event
2509 *
2510 * @param eventData An object containing data that will be passed to the event handler.
2511 * @param handler A function to execute each time the event is triggered.
2512 */
2513 keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2514
2515 /**
2516 * Trigger the "keypress" event on an element.
2517 */
2518 keypress(): JQuery;
2519 /**
2520 * Bind an event handler to the "keypress" JavaScript event
2521 *
2522 * @param handler A function to execute each time the event is triggered.
2523 */
2524 keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2525 /**
2526 * Bind an event handler to the "keypress" JavaScript event
2527 *
2528 * @param eventData An object containing data that will be passed to the event handler.
2529 * @param handler A function to execute each time the event is triggered.
2530 */
2531 keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2532
2533 /**
2534 * Trigger the "keyup" event on an element.
2535 */
2536 keyup(): JQuery;
2537 /**
2538 * Bind an event handler to the "keyup" JavaScript event
2539 *
2540 * @param handler A function to execute each time the event is triggered.
2541 */
2542 keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2543 /**
2544 * Bind an event handler to the "keyup" JavaScript event
2545 *
2546 * @param eventData An object containing data that will be passed to the event handler.
2547 * @param handler A function to execute each time the event is triggered.
2548 */
2549 keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2550
2551 /**
2552 * Bind an event handler to the "load" JavaScript event.
2553 *
2554 * @param handler A function to execute when the event is triggered.
2555 */
2556 load(handler: (eventObject: JQueryEventObject) => any): JQuery;
2557 /**
2558 * Bind an event handler to the "load" JavaScript event.
2559 *
2560 * @param eventData An object containing data that will be passed to the event handler.
2561 * @param handler A function to execute when the event is triggered.
2562 */
2563 load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2564
2565 /**
2566 * Trigger the "mousedown" event on an element.
2567 */
2568 mousedown(): JQuery;
2569 /**
2570 * Bind an event handler to the "mousedown" JavaScript event.
2571 *
2572 * @param handler A function to execute when the event is triggered.
2573 */
2574 mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2575 /**
2576 * Bind an event handler to the "mousedown" JavaScript event.
2577 *
2578 * @param eventData An object containing data that will be passed to the event handler.
2579 * @param handler A function to execute when the event is triggered.
2580 */
2581 mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2582
2583 /**
2584 * Trigger the "mouseenter" event on an element.
2585 */
2586 mouseenter(): JQuery;
2587 /**
2588 * Bind an event handler to be fired when the mouse enters an element.
2589 *
2590 * @param handler A function to execute when the event is triggered.
2591 */
2592 mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2593 /**
2594 * Bind an event handler to be fired when the mouse enters an element.
2595 *
2596 * @param eventData An object containing data that will be passed to the event handler.
2597 * @param handler A function to execute when the event is triggered.
2598 */
2599 mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2600
2601 /**
2602 * Trigger the "mouseleave" event on an element.
2603 */
2604 mouseleave(): JQuery;
2605 /**
2606 * Bind an event handler to be fired when the mouse leaves an element.
2607 *
2608 * @param handler A function to execute when the event is triggered.
2609 */
2610 mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2611 /**
2612 * Bind an event handler to be fired when the mouse leaves an element.
2613 *
2614 * @param eventData An object containing data that will be passed to the event handler.
2615 * @param handler A function to execute when the event is triggered.
2616 */
2617 mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2618
2619 /**
2620 * Trigger the "mousemove" event on an element.
2621 */
2622 mousemove(): JQuery;
2623 /**
2624 * Bind an event handler to the "mousemove" JavaScript event.
2625 *
2626 * @param handler A function to execute when the event is triggered.
2627 */
2628 mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2629 /**
2630 * Bind an event handler to the "mousemove" JavaScript event.
2631 *
2632 * @param eventData An object containing data that will be passed to the event handler.
2633 * @param handler A function to execute when the event is triggered.
2634 */
2635 mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2636
2637 /**
2638 * Trigger the "mouseout" event on an element.
2639 */
2640 mouseout(): JQuery;
2641 /**
2642 * Bind an event handler to the "mouseout" JavaScript event.
2643 *
2644 * @param handler A function to execute when the event is triggered.
2645 */
2646 mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2647 /**
2648 * Bind an event handler to the "mouseout" JavaScript event.
2649 *
2650 * @param eventData An object containing data that will be passed to the event handler.
2651 * @param handler A function to execute when the event is triggered.
2652 */
2653 mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2654
2655 /**
2656 * Trigger the "mouseover" event on an element.
2657 */
2658 mouseover(): JQuery;
2659 /**
2660 * Bind an event handler to the "mouseover" JavaScript event.
2661 *
2662 * @param handler A function to execute when the event is triggered.
2663 */
2664 mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2665 /**
2666 * Bind an event handler to the "mouseover" JavaScript event.
2667 *
2668 * @param eventData An object containing data that will be passed to the event handler.
2669 * @param handler A function to execute when the event is triggered.
2670 */
2671 mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2672
2673 /**
2674 * Trigger the "mouseup" event on an element.
2675 */
2676 mouseup(): JQuery;
2677 /**
2678 * Bind an event handler to the "mouseup" JavaScript event.
2679 *
2680 * @param handler A function to execute when the event is triggered.
2681 */
2682 mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2683 /**
2684 * Bind an event handler to the "mouseup" JavaScript event.
2685 *
2686 * @param eventData An object containing data that will be passed to the event handler.
2687 * @param handler A function to execute when the event is triggered.
2688 */
2689 mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2690
2691 /**
2692 * Remove an event handler.
2693 */
2694 off(): JQuery;
2695 /**
2696 * Remove an event handler.
2697 *
2698 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
2699 * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
2700 * @param handler A handler function previously attached for the event(s), or the special value false.
2701 */
2702 off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2703 /**
2704 * Remove an event handler.
2705 *
2706 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
2707 * @param handler A handler function previously attached for the event(s), or the special value false.
2708 */
2709 off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2710 /**
2711 * Remove an event handler.
2712 *
2713 * @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).
2714 * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
2715 */
2716 off(events: { [key: string]: any; }, selector?: string): JQuery;
2717
2718 /**
2719 * Attach an event handler function for one or more events to the selected elements.
2720 *
2721 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2722 * @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).
2723 */
2724 on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
2725 /**
2726 * Attach an event handler function for one or more events to the selected elements.
2727 *
2728 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2729 * @param data Data to be passed to the handler in event.data when an event is triggered.
2730 * @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.
2731 */
2732 on(events: string, data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
2733 /**
2734 * Attach an event handler function for one or more events to the selected elements.
2735 *
2736 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2737 * @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.
2738 * @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.
2739 */
2740 on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
2741 /**
2742 * Attach an event handler function for one or more events to the selected elements.
2743 *
2744 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2745 * @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.
2746 * @param data Data to be passed to the handler in event.data when an event is triggered.
2747 * @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.
2748 */
2749 on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
2750 /**
2751 * Attach an event handler function for one or more events to the selected elements.
2752 *
2753 * @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).
2754 * @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.
2755 * @param data Data to be passed to the handler in event.data when an event occurs.
2756 */
2757 on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
2758 /**
2759 * Attach an event handler function for one or more events to the selected elements.
2760 *
2761 * @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).
2762 * @param data Data to be passed to the handler in event.data when an event occurs.
2763 */
2764 on(events: { [key: string]: any; }, data?: any): JQuery;
2765
2766 /**
2767 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2768 *
2769 * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
2770 * @param handler A function to execute at the time the event is triggered.
2771 */
2772 one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2773 /**
2774 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2775 *
2776 * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
2777 * @param data An object containing data that will be passed to the event handler.
2778 * @param handler A function to execute at the time the event is triggered.
2779 */
2780 one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2781
2782 /**
2783 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2784 *
2785 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2786 * @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.
2787 * @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.
2788 */
2789 one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2790 /**
2791 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2792 *
2793 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2794 * @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.
2795 * @param data Data to be passed to the handler in event.data when an event is triggered.
2796 * @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.
2797 */
2798 one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
2799
2800 /**
2801 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2802 *
2803 * @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).
2804 * @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.
2805 * @param data Data to be passed to the handler in event.data when an event occurs.
2806 */
2807 one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
2808
2809 /**
2810 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2811 *
2812 * @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).
2813 * @param data Data to be passed to the handler in event.data when an event occurs.
2814 */
2815 one(events: { [key: string]: any; }, data?: any): JQuery;
2816
2817
2818 /**
2819 * Specify a function to execute when the DOM is fully loaded.
2820 *
2821 * @param handler A function to execute after the DOM is ready.
2822 */
2823 ready(handler: Function): JQuery;
2824
2825 /**
2826 * Trigger the "resize" event on an element.
2827 */
2828 resize(): JQuery;
2829 /**
2830 * Bind an event handler to the "resize" JavaScript event.
2831 *
2832 * @param handler A function to execute each time the event is triggered.
2833 */
2834 resize(handler: (eventObject: JQueryEventObject) => any): JQuery;
2835 /**
2836 * Bind an event handler to the "resize" JavaScript event.
2837 *
2838 * @param eventData An object containing data that will be passed to the event handler.
2839 * @param handler A function to execute each time the event is triggered.
2840 */
2841 resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2842
2843 /**
2844 * Trigger the "scroll" event on an element.
2845 */
2846 scroll(): JQuery;
2847 /**
2848 * Bind an event handler to the "scroll" JavaScript event.
2849 *
2850 * @param handler A function to execute each time the event is triggered.
2851 */
2852 scroll(handler: (eventObject: JQueryEventObject) => any): JQuery;
2853 /**
2854 * Bind an event handler to the "scroll" JavaScript event.
2855 *
2856 * @param eventData An object containing data that will be passed to the event handler.
2857 * @param handler A function to execute each time the event is triggered.
2858 */
2859 scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2860
2861 /**
2862 * Trigger the "select" event on an element.
2863 */
2864 select(): JQuery;
2865 /**
2866 * Bind an event handler to the "select" JavaScript event.
2867 *
2868 * @param handler A function to execute each time the event is triggered.
2869 */
2870 select(handler: (eventObject: JQueryEventObject) => any): JQuery;
2871 /**
2872 * Bind an event handler to the "select" JavaScript event.
2873 *
2874 * @param eventData An object containing data that will be passed to the event handler.
2875 * @param handler A function to execute each time the event is triggered.
2876 */
2877 select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2878
2879 /**
2880 * Trigger the "submit" event on an element.
2881 */
2882 submit(): JQuery;
2883 /**
2884 * Bind an event handler to the "submit" JavaScript event
2885 *
2886 * @param handler A function to execute each time the event is triggered.
2887 */
2888 submit(handler: (eventObject: JQueryEventObject) => any): JQuery;
2889 /**
2890 * Bind an event handler to the "submit" JavaScript event
2891 *
2892 * @param eventData An object containing data that will be passed to the event handler.
2893 * @param handler A function to execute each time the event is triggered.
2894 */
2895 submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2896
2897 /**
2898 * Execute all handlers and behaviors attached to the matched elements for the given event type.
2899 *
2900 * @param eventType A string containing a JavaScript event type, such as click or submit.
2901 * @param extraParameters Additional parameters to pass along to the event handler.
2902 */
2903 trigger(eventType: string, extraParameters?: any[]): JQuery;
2904 /**
2905 * Execute all handlers and behaviors attached to the matched elements for the given event type.
2906 *
2907 * @param eventType A string containing a JavaScript event type, such as click or submit.
2908 * @param extraParameters Additional parameters to pass along to the event handler.
2909 */
2910 trigger(eventType: string, extraParameters?: Object): JQuery;
2911 /**
2912 * Execute all handlers and behaviors attached to the matched elements for the given event type.
2913 *
2914 * @param event A jQuery.Event object.
2915 * @param extraParameters Additional parameters to pass along to the event handler.
2916 */
2917 trigger(event: JQueryEventObject, extraParameters?: any[]): JQuery;
2918 /**
2919 * Execute all handlers and behaviors attached to the matched elements for the given event type.
2920 *
2921 * @param event A jQuery.Event object.
2922 * @param extraParameters Additional parameters to pass along to the event handler.
2923 */
2924 trigger(event: JQueryEventObject, extraParameters?: Object): JQuery;
2925
2926 /**
2927 * Execute all handlers attached to an element for an event.
2928 *
2929 * @param eventType A string containing a JavaScript event type, such as click or submit.
2930 * @param extraParameters An array of additional parameters to pass along to the event handler.
2931 */
2932 triggerHandler(eventType: string, ...extraParameters: any[]): Object;
2933
2934 /**
2935 * Remove a previously-attached event handler from the elements.
2936 *
2937 * @param eventType A string containing a JavaScript event type, such as click or submit.
2938 * @param handler The function that is to be no longer executed.
2939 */
2940 unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2941 /**
2942 * Remove a previously-attached event handler from the elements.
2943 *
2944 * @param eventType A string containing a JavaScript event type, such as click or submit.
2945 * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
2946 */
2947 unbind(eventType: string, fls: boolean): JQuery;
2948 /**
2949 * Remove a previously-attached event handler from the elements.
2950 *
2951 * @param evt A JavaScript event object as passed to an event handler.
2952 */
2953 unbind(evt: any): JQuery;
2954
2955 /**
2956 * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2957 */
2958 undelegate(): JQuery;
2959 /**
2960 * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2961 *
2962 * @param selector A selector which will be used to filter the event results.
2963 * @param eventType A string containing a JavaScript event type, such as "click" or "keydown"
2964 * @param handler A function to execute at the time the event is triggered.
2965 */
2966 undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2967 /**
2968 * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2969 *
2970 * @param selector A selector which will be used to filter the event results.
2971 * @param events An object of one or more event types and previously bound functions to unbind from them.
2972 */
2973 undelegate(selector: string, events: Object): JQuery;
2974 /**
2975 * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2976 *
2977 * @param namespace A string containing a namespace to unbind all events from.
2978 */
2979 undelegate(namespace: string): JQuery;
2980
2981 /**
2982 * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
2983 *
2984 * @param handler A function to execute when the event is triggered.
2985 */
2986 unload(handler: (eventObject: JQueryEventObject) => any): JQuery;
2987 /**
2988 * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
2989 *
2990 * @param eventData A plain object of data that will be passed to the event handler.
2991 * @param handler A function to execute when the event is triggered.
2992 */
2993 unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2994
2995 /**
2996 * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10)
2997 */
2998 context: Element;
2999
3000 jquery: string;
3001
3002 /**
3003 * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
3004 *
3005 * @param handler A function to execute when the event is triggered.
3006 */
3007 error(handler: (eventObject: JQueryEventObject) => any): JQuery;
3008 /**
3009 * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
3010 *
3011 * @param eventData A plain object of data that will be passed to the event handler.
3012 * @param handler A function to execute when the event is triggered.
3013 */
3014 error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
3015
3016 /**
3017 * Add a collection of DOM elements onto the jQuery stack.
3018 *
3019 * @param elements An array of elements to push onto the stack and make into a new jQuery object.
3020 */
3021 pushStack(elements: any[]): JQuery;
3022 /**
3023 * Add a collection of DOM elements onto the jQuery stack.
3024 *
3025 * @param elements An array of elements to push onto the stack and make into a new jQuery object.
3026 * @param name The name of a jQuery method that generated the array of elements.
3027 * @param arguments The arguments that were passed in to the jQuery method (for serialization).
3028 */
3029 pushStack(elements: any[], name: string, arguments: any[]): JQuery;
3030
3031 /**
3032 * Insert content, specified by the parameter, after each element in the set of matched elements.
3033 *
3034 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
3035 * 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.
3036 */
3037 after(content1: JQuery, ...content2: any[]): JQuery;
3038 /**
3039 * Insert content, specified by the parameter, after each element in the set of matched elements.
3040 *
3041 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
3042 * 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.
3043 */
3044 after(content1: any[], ...content2: any[]): JQuery;
3045 /**
3046 * Insert content, specified by the parameter, after each element in the set of matched elements.
3047 *
3048 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
3049 * 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.
3050 */
3051 after(content1: Element, ...content2: any[]): JQuery;
3052 /**
3053 * Insert content, specified by the parameter, after each element in the set of matched elements.
3054 *
3055 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
3056 * 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.
3057 */
3058 after(content1: Text, ...content2: any[]): JQuery;
3059 /**
3060 * Insert content, specified by the parameter, after each element in the set of matched elements.
3061 *
3062 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
3063 * 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.
3064 */
3065 after(content1: string, ...content2: any[]): JQuery;
3066 /**
3067 * Insert content, specified by the parameter, after each element in the set of matched elements.
3068 *
3069 * 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.
3070 */
3071 after(func: (index: number) => any): JQuery;
3072
3073 /**
3074 * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
3075 *
3076 * 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.
3077 * 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.
3078 */
3079 append(content1: JQuery, ...content2: any[]): JQuery;
3080 /**
3081 * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
3082 *
3083 * 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.
3084 * 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.
3085 */
3086 append(content1: any[], ...content2: any[]): JQuery;
3087 /**
3088 * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
3089 *
3090 * 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.
3091 * 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.
3092 */
3093 append(content1: Element, ...content2: any[]): JQuery;
3094 /**
3095 * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
3096 *
3097 * 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.
3098 * 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.
3099 */
3100 append(content1: Text, ...content2: any[]): JQuery;
3101 /**
3102 * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
3103 *
3104 * 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.
3105 * 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.
3106 */
3107 append(content1: string, ...content2: any[]): JQuery;
3108 /**
3109 * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
3110 *
3111 * 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.
3112 */
3113 append(func: (index: number, html: string) => any): JQuery;
3114
3115 /**
3116 * Insert every element in the set of matched elements to the end of the target.
3117 *
3118 * @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.
3119 */
3120 appendTo(target: JQuery): JQuery;
3121 /**
3122 * Insert every element in the set of matched elements to the end of the target.
3123 *
3124 * @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.
3125 */
3126 appendTo(target: any[]): JQuery;
3127 /**
3128 * Insert every element in the set of matched elements to the end of the target.
3129 *
3130 * @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.
3131 */
3132 appendTo(target: Element): JQuery;
3133 /**
3134 * Insert every element in the set of matched elements to the end of the target.
3135 *
3136 * @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.
3137 */
3138 appendTo(target: string): JQuery;
3139
3140 /**
3141 * Insert content, specified by the parameter, before each element in the set of matched elements.
3142 *
3143 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
3144 * 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.
3145 */
3146 before(content1: JQuery, ...content2: any[]): JQuery;
3147 /**
3148 * Insert content, specified by the parameter, before each element in the set of matched elements.
3149 *
3150 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
3151 * 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.
3152 */
3153 before(content1: any[], ...content2: any[]): JQuery;
3154 /**
3155 * Insert content, specified by the parameter, before each element in the set of matched elements.
3156 *
3157 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
3158 * 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.
3159 */
3160 before(content1: Element, ...content2: any[]): JQuery;
3161 /**
3162 * Insert content, specified by the parameter, before each element in the set of matched elements.
3163 *
3164 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
3165 * 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.
3166 */
3167 before(content1: Text, ...content2: any[]): JQuery;
3168 /**
3169 * Insert content, specified by the parameter, before each element in the set of matched elements.
3170 *
3171 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
3172 * 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.
3173 */
3174 before(content1: string, ...content2: any[]): JQuery;
3175 /**
3176 * Insert content, specified by the parameter, before each element in the set of matched elements.
3177 *
3178 * 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.
3179 */
3180 before(func: (index: number) => any): JQuery;
3181
3182 /**
3183 * Create a deep copy of the set of matched elements.
3184 *
3185 * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
3186 * 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).
3187 */
3188 clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery;
3189
3190 /**
3191 * Remove the set of matched elements from the DOM.
3192 *
3193 * param selector A selector expression that filters the set of matched elements to be removed.
3194 */
3195 detach(selector?: string): JQuery;
3196
3197 /**
3198 * Remove all child nodes of the set of matched elements from the DOM.
3199 */
3200 empty(): JQuery;
3201
3202 /**
3203 * Insert every element in the set of matched elements after the target.
3204 *
3205 * 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.
3206 */
3207 insertAfter(target: JQuery): JQuery;
3208 /**
3209 * Insert every element in the set of matched elements after the target.
3210 *
3211 * 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.
3212 */
3213 insertAfter(target: any[]): JQuery;
3214 /**
3215 * Insert every element in the set of matched elements after the target.
3216 *
3217 * 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.
3218 */
3219 insertAfter(target: Element): JQuery;
3220 /**
3221 * Insert every element in the set of matched elements after the target.
3222 *
3223 * 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.
3224 */
3225 insertAfter(target: Text): JQuery;
3226 /**
3227 * Insert every element in the set of matched elements after the target.
3228 *
3229 * 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.
3230 */
3231 insertAfter(target: string): JQuery;
3232
3233 /**
3234 * Insert every element in the set of matched elements before the target.
3235 *
3236 * 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.
3237 */
3238 insertBefore(target: JQuery): JQuery;
3239 /**
3240 * Insert every element in the set of matched elements before the target.
3241 *
3242 * 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.
3243 */
3244 insertBefore(target: any[]): JQuery;
3245 /**
3246 * Insert every element in the set of matched elements before the target.
3247 *
3248 * 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.
3249 */
3250 insertBefore(target: Element): JQuery;
3251 /**
3252 * Insert every element in the set of matched elements before the target.
3253 *
3254 * 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.
3255 */
3256 insertBefore(target: Text): JQuery;
3257 /**
3258 * Insert every element in the set of matched elements before the target.
3259 *
3260 * 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.
3261 */
3262 insertBefore(target: string): JQuery;
3263
3264 /**
3265 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
3266 *
3267 * 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.
3268 * 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.
3269 */
3270 prepend(content1: JQuery, ...content2: any[]): JQuery;
3271 /**
3272 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
3273 *
3274 * 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.
3275 * 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.
3276 */
3277 prepend(content1: any[], ...content2: any[]): JQuery;
3278 /**
3279 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
3280 *
3281 * 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.
3282 * 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.
3283 */
3284 prepend(content1: Element, ...content2: any[]): JQuery;
3285 /**
3286 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
3287 *
3288 * 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.
3289 * 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.
3290 */
3291 prepend(content1: Text, ...content2: any[]): JQuery;
3292 /**
3293 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
3294 *
3295 * 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.
3296 * 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.
3297 */
3298 prepend(content1: string, ...content2: any[]): JQuery;
3299 /**
3300 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
3301 *
3302 * 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.
3303 */
3304 prepend(func: (index: number, html: string) => any): JQuery;
3305
3306 /**
3307 * Insert every element in the set of matched elements to the beginning of the target.
3308 *
3309 * @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.
3310 */
3311 prependTo(target: JQuery): JQuery;
3312 /**
3313 * Insert every element in the set of matched elements to the beginning of the target.
3314 *
3315 * @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.
3316 */
3317 prependTo(target: any[]): JQuery;
3318 /**
3319 * Insert every element in the set of matched elements to the beginning of the target.
3320 *
3321 * @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.
3322 */
3323 prependTo(target: Element): JQuery;
3324 /**
3325 * Insert every element in the set of matched elements to the beginning of the target.
3326 *
3327 * @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.
3328 */
3329 prependTo(target: string): JQuery;
3330
3331 /**
3332 * Remove the set of matched elements from the DOM.
3333 *
3334 * @param selector A selector expression that filters the set of matched elements to be removed.
3335 */
3336 remove(selector?: string): JQuery;
3337
3338 /**
3339 * Replace each target element with the set of matched elements.
3340 *
3341 * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
3342 */
3343 replaceAll(target: JQuery): JQuery;
3344 /**
3345 * Replace each target element with the set of matched elements.
3346 *
3347 * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
3348 */
3349 replaceAll(target: any[]): JQuery;
3350 /**
3351 * Replace each target element with the set of matched elements.
3352 *
3353 * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
3354 */
3355 replaceAll(target: Element): JQuery;
3356 /**
3357 * Replace each target element with the set of matched elements.
3358 *
3359 * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
3360 */
3361 replaceAll(target: string): JQuery;
3362
3363 /**
3364 * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
3365 *
3366 * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
3367 */
3368 replaceWith(newContent: JQuery): JQuery;
3369 /**
3370 * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
3371 *
3372 * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
3373 */
3374 replaceWith(newContent: any[]): JQuery;
3375 /**
3376 * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
3377 *
3378 * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
3379 */
3380 replaceWith(newContent: Element): JQuery;
3381 /**
3382 * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
3383 *
3384 * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
3385 */
3386 replaceWith(newContent: Text): JQuery;
3387 /**
3388 * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
3389 *
3390 * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
3391 */
3392 replaceWith(newContent: string): JQuery;
3393 /**
3394 * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
3395 *
3396 * param func A function that returns content with which to replace the set of matched elements.
3397 */
3398 replaceWith(func: () => any): JQuery;
3399
3400 /**
3401 * Get the combined text contents of each element in the set of matched elements, including their descendants.
3402 */
3403 text(): string;
3404 /**
3405 * Set the content of each element in the set of matched elements to the specified text.
3406 *
3407 * @param text The text to set as the content of each matched element.
3408 */
3409 text(text: string): JQuery;
3410 /**
3411 * Set the content of each element in the set of matched elements to the specified text.
3412 *
3413 * @param text The text to set as the content of each matched element.
3414 */
3415 text(text: number): JQuery;
3416 /**
3417 * Set the content of each element in the set of matched elements to the specified text.
3418 *
3419 * @param text The text to set as the content of each matched element.
3420 */
3421 text(text: boolean): JQuery;
3422 /**
3423 * Set the content of each element in the set of matched elements to the specified text.
3424 *
3425 * @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.
3426 */
3427 text(func: (index: number, text: string) => string): JQuery;
3428
3429 /**
3430 * Retrieve all the elements contained in the jQuery set, as an array.
3431 */
3432 toArray(): any[];
3433
3434 /**
3435 * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
3436 */
3437 unwrap(): JQuery;
3438
3439 /**
3440 * Wrap an HTML structure around each element in the set of matched elements.
3441 *
3442 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
3443 */
3444 wrap(wrappingElement: JQuery): JQuery;
3445 /**
3446 * Wrap an HTML structure around each element in the set of matched elements.
3447 *
3448 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
3449 */
3450 wrap(wrappingElement: Element): JQuery;
3451 /**
3452 * Wrap an HTML structure around each element in the set of matched elements.
3453 *
3454 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
3455 */
3456 wrap(wrappingElement: string): JQuery;
3457 /**
3458 * Wrap an HTML structure around each element in the set of matched elements.
3459 *
3460 * @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.
3461 */
3462 wrap(func: (index: number) => any): JQuery;
3463
3464 /**
3465 * Wrap an HTML structure around all elements in the set of matched elements.
3466 *
3467 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
3468 */
3469 wrapAll(wrappingElement: JQuery): JQuery;
3470 /**
3471 * Wrap an HTML structure around all elements in the set of matched elements.
3472 *
3473 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
3474 */
3475 wrapAll(wrappingElement: Element): JQuery;
3476 /**
3477 * Wrap an HTML structure around all elements in the set of matched elements.
3478 *
3479 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
3480 */
3481 wrapAll(wrappingElement: string): JQuery;
3482
3483 /**
3484 * Wrap an HTML structure around the content of each element in the set of matched elements.
3485 *
3486 * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
3487 */
3488 wrapInner(wrappingElement: JQuery): JQuery;
3489 /**
3490 * Wrap an HTML structure around the content of each element in the set of matched elements.
3491 *
3492 * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
3493 */
3494 wrapInner(wrappingElement: Element): JQuery;
3495 /**
3496 * Wrap an HTML structure around the content of each element in the set of matched elements.
3497 *
3498 * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
3499 */
3500 wrapInner(wrappingElement: string): JQuery;
3501 /**
3502 * Wrap an HTML structure around the content of each element in the set of matched elements.
3503 *
3504 * @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.
3505 */
3506 wrapInner(func: (index: number) => any): JQuery;
3507
3508 /**
3509 * Iterate over a jQuery object, executing a function for each matched element.
3510 *
3511 * @param func A function to execute for each matched element.
3512 */
3513 each(func: (index: number, elem: Element) => any): JQuery;
3514
3515 /**
3516 * Retrieve one of the elements matched by the jQuery object.
3517 *
3518 * @param index A zero-based integer indicating which element to retrieve.
3519 */
3520 get(index: number): HTMLElement;
3521 /**
3522 * Retrieve the elements matched by the jQuery object.
3523 */
3524 get(): any[];
3525
3526 /**
3527 * Search for a given element from among the matched elements.
3528 */
3529 index(): number;
3530 /**
3531 * Search for a given element from among the matched elements.
3532 *
3533 * @param selector A selector representing a jQuery collection in which to look for an element.
3534 */
3535 index(selector: string): number;
3536 /**
3537 * Search for a given element from among the matched elements.
3538 *
3539 * @param element The DOM element or first element within the jQuery object to look for.
3540 */
3541 index(element: JQuery): number;
3542 /**
3543 * Search for a given element from among the matched elements.
3544 *
3545 * @param element The DOM element or first element within the jQuery object to look for.
3546 */
3547 index(element: Element): number;
3548 index(element: any): number;
3549
3550 /**
3551 * The number of elements in the jQuery object.
3552 */
3553 length: number;
3554 /**
3555 * A selector representing selector passed to jQuery(), if any, when creating the original set.
3556 * version deprecated: 1.7, removed: 1.9
3557 */
3558 selector: string;
3559 [index: string]: any;
3560 [index: number]: HTMLElement;
3561
3562 /**
3563 * Add elements to the set of matched elements.
3564 *
3565 * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements.
3566 * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
3567 */
3568 add(selector: string, context?: Element): JQuery;
3569 /**
3570 * Add elements to the set of matched elements.
3571 *
3572 * @param elements One or more elements to add to the set of matched elements.
3573 */
3574 add(...elements: Element[]): JQuery;
3575 /**
3576 * Add elements to the set of matched elements.
3577 *
3578 * @param html An HTML fragment to add to the set of matched elements.
3579 */
3580 add(html: string): JQuery;
3581 /**
3582 * Add elements to the set of matched elements.
3583 *
3584 * @param obj An existing jQuery object to add to the set of matched elements.
3585 */
3586 add(obj: JQuery): JQuery;
3587
3588 /**
3589 * Get the children of each element in the set of matched elements, optionally filtered by a selector.
3590 *
3591 * @param selector A string containing a selector expression to match elements against.
3592 */
3593 children(selector?: string): JQuery;
3594 children(selector?: any): JQuery;
3595
3596 /**
3597 * 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.
3598 *
3599 * @param selector A string containing a selector expression to match elements against.
3600 */
3601 closest(selector: string): JQuery;
3602 /**
3603 * 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.
3604 *
3605 * @param selector A string containing a selector expression to match elements against.
3606 * @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.
3607 */
3608 closest(selector: string, context?: Element): JQuery;
3609 /**
3610 * 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.
3611 *
3612 * @param obj A jQuery object to match elements against.
3613 */
3614 closest(obj: JQuery): JQuery;
3615 /**
3616 * 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.
3617 *
3618 * @param element An element to match elements against.
3619 */
3620 closest(element: Element): JQuery;
3621
3622 /**
3623 * Get an array of all the elements and selectors matched against the current element up through the DOM tree.
3624 *
3625 * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object).
3626 * @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.
3627 */
3628 closest(selectors: any, context?: Element): any[];
3629
3630 /**
3631 * Get the children of each element in the set of matched elements, including text and comment nodes.
3632 */
3633 contents(): JQuery;
3634
3635 /**
3636 * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
3637 */
3638 end(): JQuery;
3639
3640 /**
3641 * Reduce the set of matched elements to the one at the specified index.
3642 *
3643 * @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.
3644 *
3645 */
3646 eq(index: number): JQuery;
3647
3648 /**
3649 * Reduce the set of matched elements to those that match the selector or pass the function's test.
3650 *
3651 * @param selector A string containing a selector expression to match the current set of elements against.
3652 */
3653 filter(selector: string): JQuery;
3654 /**
3655 * Reduce the set of matched elements to those that match the selector or pass the function's test.
3656 *
3657 * @param func A function used as a test for each element in the set. this is the current DOM element.
3658 */
3659 filter(func: (index: number, element: Element) => any): JQuery;
3660 /**
3661 * Reduce the set of matched elements to those that match the selector or pass the function's test.
3662 *
3663 * @param element An element to match the current set of elements against.
3664 */
3665 filter(element: Element): JQuery;
3666 /**
3667 * Reduce the set of matched elements to those that match the selector or pass the function's test.
3668 *
3669 * @param obj An existing jQuery object to match the current set of elements against.
3670 */
3671 filter(obj: JQuery): JQuery;
3672
3673 /**
3674 * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
3675 *
3676 * @param selector A string containing a selector expression to match elements against.
3677 */
3678 find(selector: string): JQuery;
3679 /**
3680 * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
3681 *
3682 * @param element An element to match elements against.
3683 */
3684 find(element: Element): JQuery;
3685 /**
3686 * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
3687 *
3688 * @param obj A jQuery object to match elements against.
3689 */
3690 find(obj: JQuery): JQuery;
3691
3692 /**
3693 * Reduce the set of matched elements to the first in the set.
3694 */
3695 first(): JQuery;
3696
3697 /**
3698 * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
3699 *
3700 * @param selector A string containing a selector expression to match elements against.
3701 */
3702 has(selector: string): JQuery;
3703 /**
3704 * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
3705 *
3706 * @param contained A DOM element to match elements against.
3707 */
3708 has(contained: Element): JQuery;
3709
3710 /**
3711 * 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.
3712 *
3713 * @param selector A string containing a selector expression to match elements against.
3714 */
3715 is(selector: string): boolean;
3716 /**
3717 * 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.
3718 *
3719 * @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.
3720 */
3721 is(func: (index: number) => any): boolean;
3722 /**
3723 * 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.
3724 *
3725 * @param obj An existing jQuery object to match the current set of elements against.
3726 */
3727 is(obj: JQuery): boolean;
3728 /**
3729 * 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.
3730 *
3731 * @param elements One or more elements to match the current set of elements against.
3732 */
3733 is(elements: any): boolean;
3734
3735 /**
3736 * Reduce the set of matched elements to the final one in the set.
3737 */
3738 last(): JQuery;
3739
3740 /**
3741 * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
3742 *
3743 * @param callback A function object that will be invoked for each element in the current set.
3744 */
3745 map(callback: (index: number, domElement: Element) => any): JQuery;
3746
3747 /**
3748 * 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.
3749 *
3750 * @param selector A string containing a selector expression to match elements against.
3751 */
3752 next(selector?: string): JQuery;
3753
3754 /**
3755 * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
3756 *
3757 * @param selector A string containing a selector expression to match elements against.
3758 */
3759 nextAll(selector?: string): JQuery;
3760
3761 /**
3762 * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3763 *
3764 * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements.
3765 * @param filter A string containing a selector expression to match elements against.
3766 */
3767 nextUntil(selector?: string, filter?: string): JQuery;
3768 /**
3769 * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3770 *
3771 * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements.
3772 * @param filter A string containing a selector expression to match elements against.
3773 */
3774 nextUntil(element?: Element, filter?: string): JQuery;
3775 /**
3776 * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3777 *
3778 * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements.
3779 * @param filter A string containing a selector expression to match elements against.
3780 */
3781 nextUntil(obj?: JQuery, filter?: string): JQuery;
3782
3783 /**
3784 * Remove elements from the set of matched elements.
3785 *
3786 * @param selector A string containing a selector expression to match elements against.
3787 */
3788 not(selector: string): JQuery;
3789 /**
3790 * Remove elements from the set of matched elements.
3791 *
3792 * @param func A function used as a test for each element in the set. this is the current DOM element.
3793 */
3794 not(func: (index: number) => any): JQuery;
3795 /**
3796 * Remove elements from the set of matched elements.
3797 *
3798 * @param elements One or more DOM elements to remove from the matched set.
3799 */
3800 not(...elements: Element[]): JQuery;
3801 /**
3802 * Remove elements from the set of matched elements.
3803 *
3804 * @param obj An existing jQuery object to match the current set of elements against.
3805 */
3806 not(obj: JQuery): JQuery;
3807
3808 /**
3809 * Get the closest ancestor element that is positioned.
3810 */
3811 offsetParent(): JQuery;
3812
3813 /**
3814 * Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
3815 *
3816 * @param selector A string containing a selector expression to match elements against.
3817 */
3818 parent(selector?: string): JQuery;
3819
3820 /**
3821 * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
3822 *
3823 * @param selector A string containing a selector expression to match elements against.
3824 */
3825 parents(selector?: string): JQuery;
3826
3827 /**
3828 * 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.
3829 *
3830 * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements.
3831 * @param filter A string containing a selector expression to match elements against.
3832 */
3833 parentsUntil(selector?: string, filter?: string): JQuery;
3834 /**
3835 * 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.
3836 *
3837 * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements.
3838 * @param filter A string containing a selector expression to match elements against.
3839 */
3840 parentsUntil(element?: Element, filter?: string): JQuery;
3841 /**
3842 * 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.
3843 *
3844 * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements.
3845 * @param filter A string containing a selector expression to match elements against.
3846 */
3847 parentsUntil(obj?: JQuery, filter?: string): JQuery;
3848
3849 /**
3850 * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
3851 *
3852 * @param selector A string containing a selector expression to match elements against.
3853 */
3854 prev(selector?: string): JQuery;
3855
3856 /**
3857 * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
3858 *
3859 * @param selector A string containing a selector expression to match elements against.
3860 */
3861 prevAll(selector?: string): JQuery;
3862
3863 /**
3864 * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3865 *
3866 * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements.
3867 * @param filter A string containing a selector expression to match elements against.
3868 */
3869 prevUntil(selector?: string, filter?: string): JQuery;
3870 /**
3871 * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3872 *
3873 * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
3874 * @param filter A string containing a selector expression to match elements against.
3875 */
3876 prevUntil(element?: Element, filter?: string): JQuery;
3877 /**
3878 * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3879 *
3880 * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
3881 * @param filter A string containing a selector expression to match elements against.
3882 */
3883 prevUntil(obj?: JQuery, filter?: string): JQuery;
3884
3885 /**
3886 * Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
3887 *
3888 * @param selector A string containing a selector expression to match elements against.
3889 */
3890 siblings(selector?: string): JQuery;
3891
3892 /**
3893 * Reduce the set of matched elements to a subset specified by a range of indices.
3894 *
3895 * @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.
3896 * @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.
3897 */
3898 slice(start: number, end?: number): JQuery;
3899
3900 /**
3901 * Show the queue of functions to be executed on the matched elements.
3902 *
3903 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3904 */
3905 queue(queueName?: string): any[];
3906 /**
3907 * Manipulate the queue of functions to be executed, once for each matched element.
3908 *
3909 * @param newQueue An array of functions to replace the current queue contents.
3910 */
3911 queue(newQueue: Function[]): JQuery;
3912 /**
3913 * Manipulate the queue of functions to be executed, once for each matched element.
3914 *
3915 * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
3916 */
3917 queue(callback: Function): JQuery;
3918 /**
3919 * Manipulate the queue of functions to be executed, once for each matched element.
3920 *
3921 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3922 * @param newQueue An array of functions to replace the current queue contents.
3923 */
3924 queue(queueName: string, newQueue: Function[]): JQuery;
3925 /**
3926 * Manipulate the queue of functions to be executed, once for each matched element.
3927 *
3928 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3929 * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
3930 */
3931 queue(queueName: string, callback: Function): JQuery;
3932
3933 // InfoNav plugins/extensions
3934 multiline(text: string): JQuery;
3935 togglePanelControl(): JQuery;
3936}
3937
3938interface JQueryEventHandler {
3939 (eventObject: JQueryEventObject, data?: any): void;
3940 (eventObject: JQueryEventObject): void;
3941}
3942
3943declare module "jquery" {
3944 export = $;
3945}
3946declare var jQuery: JQueryStatic;
3947declare var $: JQueryStatic;
3948
3949declare module Microsoft.Maps {
3950
3951 /*
3952 Global functions
3953 */
3954 export module Globals {
3955 export var roadUriFormat: any;
3956 }
3957
3958 /*
3959 Loads the specified registered module, making its functionality available. An optional function can be specified that is called when the module is loaded.
3960 To register a module, use the registerModule method.
3961
3962 The following Bing Maps modules are available:
3963
3964 Microsoft.Maps.AdvancedShapes
3965 Microsoft.Maps.Directions
3966 Microsoft.Maps.Overlays.Style
3967 Microsoft.Maps.Search
3968 Microsoft.Maps.Themes.BingTheme
3969 Microsoft.Maps.Traffic
3970 Microsoft.Maps.VenueMaps
3971 */
3972 export function loadModule(moduleKey: string, options?: { callback: () => void; }): void;
3973 /*
3974 Signals that the specified module has been loaded and if specified, calls the callback function in loadModule. Call this method at the end of your module script.
3975 */
3976 export function moduleLoaded(moduleKey: string): void;
3977
3978 /*
3979 Registers a module with the map control. The name of the module is specified in moduleKey, the module script is defined in scriptUrl, and the options provides the location of a *.css file to load with the module.
3980 Tip: To minimize possible conflicts with other custom modules, choose a unique module name (defined in moduleKey). For example, you can use your company name in the name of the module.
3981 Once you have registered a module, you can make its functionality available by loading it using loadModule.
3982 */
3983 export function registerModule(moduleKey: string, scriptUrl: string, options?: string[]): void;
3984
3985 /*
3986 Tagging interface for items in an EntityCollection
3987 */
3988 export interface Entity {
3989 //No members
3990 }
3991
3992 /*
3993 Represents the coordinates of the position of the user.
3994 */
3995 export class Coordinates {
3996 /*************
3997 * PROPERTIES *
3998 **************/
3999 /*
4000 The accuracy, in meters, of the latitude and longitude values.
4001 */
4002 accuracy: number;
4003
4004 /*
4005 The altitude of the location.
4006 */
4007 altitude: number;
4008
4009 /*
4010 The accuracy, in meters, of the altitude value.
4011 */
4012 altitudeAccuracy: number;
4013
4014 /*
4015 The direction of travel of the hosting device.
4016 */
4017 heading: number;
4018
4019 /*
4020 The latitude of the location.
4021 */
4022 latitude: number;
4023
4024 /*
4025 The longitude of the location.
4026 */
4027 longitude: number;
4028
4029 /*
4030 The ground speed of the hosting device, in meters per second.
4031 */
4032 speed: number;
4033 }
4034
4035 /*
4036 Contains methods for obtaining and displaying the users current location.
4037 Note: This functionality is only available on browsers that support the W3C GeoLocation API.
4038 */
4039 export class GeoLocationProvider {
4040 constructor (map: Map);
4041
4042 /*
4043 Renders a geo location accuracy circle on the map. The accuracy circle is created with the center at the specified location, using the given radiusInMeters, and with the specified number of segments for the accuracy circle polygon. Additional options are also available to adjust the style of the polygon.
4044 */
4045 addAccuracyCircle(center: Location, radiusInMeters: number, segments: number, options: PositionCircleOptions): void;
4046
4047 /*
4048 Cancels the processing of the current getCurrentPosition request. This method prevents the response from being processed.
4049 */
4050 cancelCurrentRequest(): void;
4051
4052 /*
4053 Obtains the users current location and displays it on the map.
4054 Important:
4055 The accuracy of the user location obtained using this method varies widely depending on the desktop browser or mobile device of the requesting client. Desktop users may experience low user location accuracy (accuracy circles with large radiuses), while mobile user location accuracy may be much greater (a few meters).
4056 */
4057 getCurrentPosition(options: PositionOptions): void;
4058
4059 /*
4060 Removes the current geo location accuracy circle.
4061 */
4062 removeAccuracyCircle(): void;
4063 }
4064
4065 export class MouseEventArgs {
4066 eventName: string;
4067 handled: boolean;
4068 isPrmary: boolean;
4069 isSecondary: boolean;
4070 isTouchEvent: boolean;
4071 originalEvent: any;
4072 pageX: number;
4073 pageY: number;
4074 target: any;
4075 targetType: string;
4076 wheelDelta: number;
4077
4078 getX(): number;
4079 getY(): number;
4080 }
4081
4082 export class KeyEventArgs {
4083 altKey: boolean;
4084 ctrlKey: boolean;
4085 eventName: string;
4086 //A boolean indicating whether the event is handled. If this property is set to true, the default map control behavior for the event is cancelled.
4087 handled: boolean;
4088 //The ASCII character code that identifies the keyboard key that was pressed.
4089 keyCode: string;
4090 originalEvent: any;
4091 shiftKey: boolean;
4092 }
4093
4094 export class LocationRect {
4095 constructor (center: Location, width: number, height: number);
4096
4097 center: Location;
4098 height: number;
4099 width: number;
4100
4101 static fromCorners(northwest: Location, southeast: Location): LocationRect;
4102 static fromEdges(north: number, west: number, south: number, east: number, altitude: number, altitudeReference: AltitudeReference): LocationRect;
4103
4104 static fromLocations(...locations: Location[]): LocationRect;
4105 static fromString(str: string): LocationRect;
4106
4107 clone(): LocationRect;
4108 contains(location: Location): boolean;
4109 getEast(): number;
4110 getNorth(): number;
4111 getNorthwest(): Location;
4112 getSouth(): number;
4113 getSoutheast(): Location;
4114 getWest(): number;
4115 insersects(rect: LocationRect): boolean;
4116 toString(): string;
4117 }
4118
4119 export class Location {
4120 constructor (latitude: number, longitude: number, altitude?: number, altitudeReference?: AltitudeReference);
4121
4122 altitude: number;
4123 altitudeReference: AltitudeReference;
4124 latitude: number;
4125 longitude: number;
4126
4127 static areEqual(location1: Location, location2: Location): boolean;
4128 static normalizeLongitude(longitude: number): number;
4129
4130 clone(): Location;
4131 toString(): string;
4132 }
4133
4134 /*
4135 Defines the reference point from which the altitude is measured.
4136 */
4137 export class AltitudeReference {
4138 /*
4139 The altitude is measured from the ground level.
4140 */
4141 static ground: string;
4142 /*
4143 The altitude is measured from the WGS 84 ellipsoid of the Earth.
4144 */
4145 static ellipsoid: string;
4146
4147 /*
4148 Determines if the specified reference is a supported AltitudeReference.
4149 */
4150 static isValid(reference: AltitudeReference): boolean;
4151 }
4152
4153 export class MapMode {
4154 getDrawShapesInSingleLayer(): boolean;
4155 setDrawShapesInSingleLayer(drawInSingleLayer: boolean): void;
4156 setViewChangeEndDelay(delay: number): void;
4157 }
4158
4159 export class MapTypeId {
4160 static aerial: string;
4161 static auto: string;
4162 static birdseye: string;
4163 static collinsBart: string;
4164 static mercator: string;
4165 static ordnanceSurvey: string;
4166 static road: string;
4167 }
4168
4169 /*
4170 Represents a color.
4171 */
4172 export class Color {
4173 /*
4174 Initializes a new instance of the Color class. The a parameter represents opacity. The range of valid values for all parameters is 0 to 255.
4175 */
4176 constructor (a: number, r: number, g: number, b: number);
4177
4178 /*
4179 The opacity of the color. The range of valid values is 0 to 255.
4180 */
4181 a: number;
4182
4183 /*
4184 The red value of the color. The range of valid values is 0 to 255.
4185 */
4186 r: number;
4187
4188 /*
4189 The green value of the color. The range of valid values is 0 to 255.
4190 */
4191 g: number;
4192
4193 /*
4194 The blue value of the color. The range of valid values is 0 to 255.
4195 */
4196 b: number;
4197
4198 /*
4199 Creates a copy of the Color object.
4200 */
4201 static clone(color: Color): Color;
4202
4203 /*
4204 Converts the specified hex string to a Color.
4205 */
4206 static fromHex(hex: string): Color;
4207
4208 /*
4209 Returns a copy of the Color object.
4210 */
4211 clone(): Color;
4212
4213 /*
4214 Returns the opacity of the Color as a value between 0 (a=0) and 1 (a=255).
4215 */
4216 getOpacity(): number;
4217
4218 /*
4219 Converts the Color into a 6-digit hex string. Opacity is ignored. For example, a Color with values (255,0,0,0) is returned as hex string #000000.
4220 */
4221 toHex(): string;
4222
4223 /*
4224 Converts the Color object to a string.
4225 */
4226 toString(): string;
4227 }
4228
4229 export interface MapOptions {
4230 backgroundColor?: Color;
4231 credentials?: string;
4232 customizeOverlays?: boolean;
4233 disableBirdseye?: boolean;
4234 disableKeyboardInput?: boolean;
4235 disableMouseInput?: boolean;
4236 disablePanning?: boolean;
4237 disableTouchInput?: boolean;
4238 disableUserInput?: boolean;
4239 disableZooming?: boolean;
4240 enableClickableLogo?: boolean;
4241 enableSearchLogo?: boolean;
4242 fixedMapPosition?: boolean;
4243 height?: number;
4244 inertiaIntensity?: number;
4245 showBreadcrumb?: boolean;
4246 showCopyright?: boolean;
4247 showDashboard?: boolean;
4248 showMapTypeSelector?: boolean;
4249 showScalebar?: boolean;
4250 theme?: any;
4251 tileBuffer?: number;
4252 useInertia?: boolean;
4253 width?: number;
4254 }
4255
4256 export interface ViewOptions {
4257 //Properties
4258 animate?: boolean;
4259 bounds?: LocationRect;
4260 center?: Location;
4261 centerOffset?: Point;
4262 heading?: number;
4263 labelOverlay?: LabelOverlay;
4264 mapTypeId?: string;
4265 padding?: number;
4266 zoom?: number;
4267 }
4268
4269 export class PixelReference {
4270 //The pixel is defined relative to the map controls root element, where the top left corner of the map control is (0, 0). Using this option might cause a page reflow which may negatively impact performance.
4271 static control: string;
4272 //The pixel is defined relative to the page, where the top left corner of the HTML page is (0, 0). This option is best used when working with mouse or touch events. Using this option might cause a page reflow which may negatively impact performance.
4273 static page: string;
4274 //The pixel is defined in viewport coordinates, relative to the center of the map, where the center of the map is (0, 0). This option is best used for positioning geo-aligned entities added to the user layer.
4275 static viewport: string;
4276
4277 static isValid(reference: PixelReference): boolean;
4278 }
4279
4280 export class Point {
4281 constructor (x: number, y: number);
4282
4283 x: number;
4284 y: number;
4285
4286 static areEqual(point1: Point, point2: Point): boolean;
4287 static clone(point: Point): Point;
4288
4289 clone(): Point;
4290 toString(): string;
4291 }
4292
4293 export class Infobox implements Entity { }
4294
4295 export class Polygon implements Entity {
4296 constructor (locations: Location[], options?: PolygonOptions);
4297
4298 getFillColor(): Color;
4299 getLocations(): Location[];
4300 getStrokeColor(): Color;
4301 getStrokeDashArray(): string;
4302 getStrokeThickness(): number;
4303 getVisible(): boolean;
4304 setLocations(locations: Location[]): void;
4305 setOptions(options: PolylineOptions): void;
4306 toString(): string;
4307
4308 click: (eventArgs: MouseEventArgs) => any;
4309 dbclick: (eventArgs: MouseEventArgs) => any;
4310 entitychanged: (entity: Entity) => any;
4311 mousedown: (eventArgs: MouseEventArgs) => any;
4312 mouseout: (eventArgs: MouseEventArgs) => any;
4313 mouseover: (eventArgs: MouseEventArgs) => any;
4314 mouseup: (eventArgs: MouseEventArgs) => any;
4315 rightclick: (eventArgs: MouseEventArgs) => any;
4316 }
4317
4318 export class Polyline implements Entity {
4319 constructor (locations: Location[], options?: PolylineOptions);
4320
4321 getLocations(): Location[];
4322 getStrokeColor(): Color;
4323 getStrokeDashArray(): string;
4324 getStrokeThickness(): number;
4325 getVisible(): boolean;
4326 setLocations(locations: Location[]): void;
4327 setOptions(options: PolylineOptions): void;
4328 toString(): string;
4329
4330 click: (eventArgs: MouseEventArgs) => any;
4331 dbclick: (eventArgs: MouseEventArgs) => any;
4332 entitychanged: (entity: Entity) => any;
4333 mousedown: (eventArgs: MouseEventArgs) => any;
4334 mouseout: (eventArgs: MouseEventArgs) => any;
4335 mouseover: (eventArgs: MouseEventArgs) => any;
4336 mouseup: (eventArgs: MouseEventArgs) => any;
4337 rightclick: (eventArgs: MouseEventArgs) => any;
4338 }
4339
4340 export class Pushpin implements Entity {
4341 constructor (location: Location, options?: PushpinOptions);
4342 getAnchor(): Point;
4343 getIcon(): string;
4344 getHeight(): number;
4345 getLocation(): Location;
4346 getText(): string;
4347 getTextOffset(): Point;
4348 getTypeName(): string;
4349 getVisible(): boolean;
4350 getWidth(): number;
4351 getZIndex(): number;
4352 setLocation(location: Location): void;
4353 setOptions(options: PushpinOptions): void;
4354 toString(): string;
4355
4356 click: (eventArgs: MouseEventArgs) => any;
4357 dblclick: (eventArgs: MouseEventArgs) => any;
4358 drag: (object: Pushpin) => any;
4359 dragend: (eventArgs: MouseEventArgs) => any;
4360 dragstart: (eventArgs: MouseEventArgs) => any;
4361 entitychanged: (object: { entity: Entity; }) => any;
4362 mousedown: (eventArgs: MouseEventArgs) => any;
4363 mouseout: (eventArgs: MouseEventArgs) => any;
4364 mouseover: (eventArgs: MouseEventArgs) => any;
4365 mouseup: (eventArgs: MouseEventArgs) => any;
4366 rightclick: (eventArgs: MouseEventArgs) => any;
4367 }
4368
4369 export class TileLayer implements Entity {
4370 constructor (options: TileLayerOptions);
4371
4372 getOpacty(): number;
4373 /*
4374 Returns the tile source of the tile layer.
4375 The projection parameter accepts the following values: mercator, enhancedBirdseyeNorthUp, enhancedBirdseyeSouthUp, enhancedBirdseyeEastUp, enhancedBirdseyeWestUp
4376 */
4377 getTileSource(projection: string): TileSource;
4378 getZIndex(): number;
4379 setOptions(options: TileLayerOptions): void;
4380 toString(): string;
4381
4382 tiledownloadcomplete: () => any;
4383 }
4384
4385 export class PositionError {
4386 /*
4387 The error code.
4388 Any one of the following error codes may be returned:
4389 0 - An error occurred that is not covered by other error codes.
4390
4391 1 - The application does not have permission to use the GeoLocation API.
4392
4393 2 - The position of the host device could not be determined.
4394
4395 3 - The specified timeout was exceeded.
4396 */
4397 code: number;
4398
4399 //The error message. This message is for the developer and is not intended to be displayed to the end user.
4400 message: string;
4401 }
4402
4403 export class LabelOverlay {
4404 //Map labels are not shown on top of imagery.
4405 static hidden: string;
4406 //Map labels are shown on top of imagery.
4407 static visible: string;
4408
4409 static isValid(labelOverlay: LabelOverlay): boolean;
4410 }
4411
4412 export class EntityState {
4413 //The entity is highlighted on the map.
4414 static highlighted: string;
4415
4416 //The entity is not highlighted or selected.
4417 static none: string;
4418
4419 //The entity is selected on the map.
4420 static selected: string;
4421 }
4422
4423 /*
4424 Defines a tile layer’s visibility during animation.
4425 */
4426 export class AnimationVisibility {
4427 //The map control determines whether or not to show a tile layer based on system capability. If a browser can render a tile layer with acceptable performance, it is displayed during animations.
4428 static auto: string;
4429
4430 //The tile layer is not displayed during animation.
4431 static hide: string;
4432
4433 //The tile layer is displayed during animations. This option may impact performance on older browsers.
4434 static show: string;
4435 }
4436
4437 export class InfoboxType {
4438 //A smaller info box with space for a title.
4439 static mini: string;
4440
4441 //The default info box style. This standard info box makes space for a title, title link, description, and other links if they are specified.
4442 static standard: string;
4443 }
4444
4445 export class Position {
4446 //The position as a W3C Coordinates object.
4447 coords: Coordinates;
4448 //The time when the position was determined, in the form of a DOMTimeStamp.
4449 timestamp: string;
4450 }
4451
4452 export interface TileSourceOptions {
4453 height?: number;
4454 //The string that constructs the URLs used to retrieve tiles from the tile source. This property is required. The uriConstructor will replace {subdomain} and {quadkey}.
4455 uriConstructor: string;
4456 width?: number;
4457 }
4458
4459 export class TileSource {
4460 constructor (options: TileSourceOptions);
4461
4462 getHeight(): number;
4463 getUriConstructor(): string;
4464 getWidth(): string;
4465 toString(): string;
4466 }
4467
4468 export interface TileLayerOptions {
4469 animationDisplay?: AnimationVisibility;
4470 downloadTimeout?: number;
4471 mercator?: TileSource;
4472 opacity?: number;
4473 visible?: boolean;
4474 zIndex?: number;
4475 }
4476
4477 export interface PushpinOptions {
4478 anchor?: Point;
4479 draggable?: boolean;
4480 height?: number;
4481 htmlContent?: string;
4482 icon?: string;
4483 infobox?: Infobox;
4484 state?: EntityState;
4485 text?: string;
4486 textOffset?: Point;
4487 typeName?: string;
4488 visible?: boolean;
4489 width?: number;
4490 zIndex?: number;
4491 }
4492
4493 export interface PositionOptions {
4494 enableHighAccuracy?: boolean;
4495 /*
4496 The function to call when an error occurs during the user location request. The callback function must accept one argument.
4497 The argument object contains two properties, internalError, a PositionError type, and errorCode, a number.
4498
4499 Any one of the following errorCode values may be returned:
4500 1 - The application origin does not have permission to use the GeoLocation API.
4501
4502 2 - The position of the user could not be determined because of a device failure.
4503
4504 3 - The time specified in timeout has been exceeded.
4505
4506 4 - A request is already in process.
4507
4508 5 - The user’s browser does not support geo location.
4509 */
4510 errorCallback?: (internalError: PositionError, errorCode: number) => void;
4511 maximumAge?: number;
4512 showAccuracyCircle?: boolean;
4513 successCallback?: (center: Location, position: Position) => void;
4514 timeout?: number;
4515 updateMapView?: boolean;
4516 }
4517
4518 //TODO: Change options interfaces so a concrete class and an interface exists
4519 export interface PositionCircleOptions {
4520 //The polygon options for the geo location accuracy circle.
4521 polygonOptions?: PolygonOptions;
4522 //A boolean indicating whether to display the geo location accuracy circle. The default value is true. If this property is set to false, a geo location accuracy circle is not drawn and any existing accuracy circles are removed.
4523 showOnMap?: boolean;
4524 }
4525
4526 export interface PolylineOptions {
4527 //The color of the outline of the polygon.
4528 strokeColor?: Color;
4529 //A string representing the stroke/gap sequence to use to draw the outline of the polygon. The string must be in the format S, G, S*, G*, where S represents the stroke length and G represents gap length. Stroke lengths and gap lengths can be separated by commas or spaces. For example, a stroke dash string of “1 4 2 1” would draw the polygon outline with a dash, four spaces, two dashes, one space, and then repeated.
4530 strokeDashArray?: string;
4531 //The thickness of the outline of the polygon.
4532 strokeThickness?: number;
4533 //A boolean indicating whether to show or hide the polygon. A value of false indicates that the polygon is hidden, although it is still an entity on the map.
4534 visible?: boolean;
4535 }
4536
4537 export interface PolygonOptions {
4538 //The color of the inside of the polygon.
4539 fillColor?: Color;
4540 //The info box associated with this polygon. If an info box is assigned and the Microsoft.Maps.Themes.BingTheme module is loaded, then the info box appears when the hover or click events of the polygon occur.
4541 infobox?: Infobox;
4542 //The color of the outline of the polygon.
4543 strokeColor?: Color;
4544 //A string representing the stroke/gap sequence to use to draw the outline of the polygon. The string must be in the format S, G, S*, G*, where S represents the stroke length and G represents gap length. Stroke lengths and gap lengths can be separated by commas or spaces. For example, a stroke dash string of “1 4 2 1” would draw the polygon outline with a dash, four spaces, two dashes, one space, and then repeated.
4545 strokeDashArray?: string;
4546 //The thickness of the outline of the polygon.
4547 strokeThickness?: number;
4548 //A boolean indicating whether to show or hide the polygon. A value of false indicates that the polygon is hidden, although it is still an entity on the map.
4549 visible?: boolean;
4550 }
4551
4552 export interface InfoboxOptions {
4553 //A list of the info box actions, where each item is a label (the link text) or icon (the URL of the image to use as the icon link) and eventHandler (name of the function handling a click of the action link).
4554 actions?: { label?: string; icon?: string; eventHandler: () => void; };
4555 //The string displayed inside the info box.
4556 description?: string;
4557 htmlContent?: string;
4558 id?: string;
4559 location?: Location;
4560 offset?: Point;
4561 showCloseButton?: boolean;
4562 showPointer?: boolean;
4563 pushpin?: Pushpin;
4564 title?: string;
4565 titleAction?: { label?: string; eventHandler: () => void; };
4566 titleClickHandler?: string;
4567 typeName?: InfoboxType;
4568 visible?: boolean;
4569 width?: number;
4570 height?: number;
4571 }
4572
4573 /*
4574 Contains a collection of entities. An Entity can be any one of the following types: Infobox, Polygon, Polyline, Pushpin, TileLayer, or EntityCollection.
4575 */
4576 export interface EntityCollectionOptions {
4577 bubble?: boolean;
4578 visible?: boolean;
4579 zIndex?: number;
4580 }
4581
4582 export class EntityCollection implements Entity {
4583 /*
4584 * CONSTRUCTOR
4585 */
4586
4587 /*
4588 Initializes a new instance of the EntityCollection class.
4589 */
4590 EntityCollection(options?: EntityCollectionOptions);
4591
4592 /*
4593 * METHODS
4594 */
4595
4596 /*
4597 Removes all entities from the collection.
4598 */
4599 clear(): void;
4600 get(index: number): Entity;
4601 getLength(): number;
4602 getVisible(): boolean;
4603 getZIndex(): number;
4604 indexOf(entity: Entity): number;
4605 insert(entity: Entity, index: number): void;
4606 pop(): Entity;
4607 push(entity: Entity): void;
4608 remove(entity: Entity): Entity;
4609 removeAt(index: number): Entity;
4610 setOptions(options: EntityCollectionOptions): void;
4611 toString(): string;
4612
4613 //Events
4614 entityAdded: (object: { collection: EntityCollection; entity: Entity; }) => any;
4615 entityChanged: (object: { collection: EntityCollection; entity: Entity; }) => any;
4616 entityRemoved: (object: { collection: EntityCollection; entity: Entity; }) => any;
4617 }
4618
4619 export class Map {
4620 //Constructors
4621 constructor (mapElement: HTMLElement, options?: MapOptions);
4622 constructor (mapElement: HTMLElement, options?: ViewOptions);
4623 width: number;
4624 height: number;
4625
4626 //Properties
4627 entities: EntityCollection;
4628
4629 //Static Methods
4630 getVersion(): string;
4631
4632 //Methods
4633 blur(): void;
4634 dispose(): void;
4635 focus(): void;
4636 getBounds(): LocationRect;
4637 getCenter(): Location;
4638 getCopyrights(callback: (attributions: string[]) => void ): string[];
4639 getCredentials(callback: (credentials: string) => void ): void;
4640 getHeading(): number;
4641 getHeight(): number;
4642 getImageryId(): string;
4643 getMapTypeId(): string;
4644 getMetersPerPixel(): number;
4645 getMode(): MapMode;
4646 getModeLayer(): Node;
4647 getOptions(): MapOptions;
4648 getPageX(): number;
4649 getRootElement(): Node;
4650 getTargetBounds(): LocationRect;
4651 getTargetCenter(): Location;
4652 getTargetHeading(): number;
4653 getTargetMetersPerPixel(): number;
4654 getTargetZoom(): number;
4655 getUserLayer(): Node;
4656 getViewportX(): number;
4657 getViewportY(): number;
4658 getWidth(): number;
4659 getZoom(): number;
4660 getZoomRange(): { min: number; max: number; };
4661 isDownloadingTiles(): boolean;
4662 isMercator(): boolean;
4663 isRotationEnabled(): boolean;
4664 setMapType(mapTypeId: string): void;
4665 setOptions(options: { height: number; width: number; }): void;
4666 setView(options: ViewOptions): void;
4667 restrictZoom(min: number, max: number);
4668 tryLocationToPixel(location: Location, reference?: PixelReference): Point;
4669 tryLocationToPixel(location: Location[], reference?: PixelReference): Point[];
4670 tryPixelToLocation(point: Point, reference?: PixelReference): Location;
4671 tryPixelToLocation(point: Point[], reference?: PixelReference): Location[];
4672
4673 //Events
4674 click: (eventArgs: MouseEventArgs) => any;
4675 copyrightchanged: () => any;
4676 dblclick: (eventArgs: MouseEventArgs) => any;
4677 imagerychanged: () => any;
4678 keydown: (eventArgs: KeyEventArgs) => any;
4679 keypress: (eventArgs: KeyEventArgs) => any;
4680 keyup: (eventArgs: KeyEventArgs) => any;
4681 maptypechanged: () => any;
4682 mousedown: (eventArgs: MouseEventArgs) => any;
4683 mousemove: (eventArgs: MouseEventArgs) => any;
4684 mouseout: (eventArgs: MouseEventArgs) => any;
4685 mouseover: (eventArgs: MouseEventArgs) => any;
4686 mouseup: (eventArgs: MouseEventArgs) => any;
4687 mousewheel: (eventArgs: MouseEventArgs) => any;
4688 rightlick: (eventArgs: MouseEventArgs) => any;
4689 targetviewchanged: () => any;
4690 tiledownloadcomplete: () => any;
4691 viewchange: () => any;
4692 viewchangeend: () => any;
4693 viewchangestart: () => any;
4694 }
4695
4696 module Events {
4697 function addHandler(target: any, eventName: string, handler: any);
4698 function addThrottledHandler(target: any, eventName: string, handler: any, throttleInterval: any);
4699 }
4700}
4701declare var Quill: quill.QuillStatic;
4702declare var Delta: quill.DeltaStatic;
4703
4704declare module quill {
4705 interface EventEmitter2 {
4706 on(event: string, listener: Function);
4707 off(event: string, listener: Function);
4708 removeAllListeners(event?: string);
4709 emit(event: string, ...args: any[]);
4710 }
4711
4712 interface Range {
4713 start: number;
4714 end: number;
4715 }
4716
4717 interface QuillEvents {
4718 FORMAT_INIT: string;
4719 MODULE_INIT: string;
4720 POST_EVENT: string;
4721 PRE_EVENT: string;
4722 SELECTION_CHANGE: string;
4723 TEXT_CHANGE: string;
4724 }
4725
4726 interface Quill extends EventEmitter2 {
4727 container: HTMLElement;
4728 root: HTMLElement;
4729 getText(start?: number, end?: number): string;
4730 getLength(): number;
4731 getContents(start?: number, end?: number): Delta;
4732 getHTML(): string;
4733
4734 insertText(index: number, text: string)
4735 insertText(index: number, text: string, name: string, value: string)
4736 insertText(index: number, text: string, formats: FormatAttributes)
4737 insertText(index: number, text: string, source: string)
4738 insertText(index: number, text: string, name: string, value: string, source: string)
4739 insertText(index: number, text: string, formats: FormatAttributes, source: string)
4740
4741 deleteText(start, end, source): void;
4742 formatText(start: number, end: number, name: string, value: any, source: string): void;
4743 formatText(range: any, name: string, value: any, source: string): void;
4744 insertEmbed(index, type, url, source): void;
4745 updateContents(delta, source): void;
4746 setContents(delta, source): void;
4747 setHTML(html, source): void;
4748 setText(text, source): void;
4749
4750 getSelection(): Range;
4751
4752 setSelection(start: number, end: number, source?: string): void;
4753 setSelection(range: Range, source?: string): void;
4754
4755 prepareFormat(name, value, source): any;
4756 focus(): any;
4757
4758 addModule(name, options): any;
4759 getModule(name): any;
4760 onModuleLoad(name, callback): any;
4761 addFormat(name, config): any;
4762 addContainer(className, before): any;
4763 }
4764
4765 interface FormatAttributes {
4766 bold?: boolean;
4767 italic?: boolean;
4768 strike?: boolean;
4769 underline?: boolean;
4770 font?: string;
4771 size?: string;
4772 color?: string;
4773 background?: string;
4774 image?: string;
4775 link?: string;
4776 bullet?: boolean;
4777 list?: boolean;
4778 align?: string
4779 }
4780
4781 interface QuillStatic {
4782 new (container: any): Quill;
4783 new (container: any, configs: any): Quill;
4784 events: QuillEvents;
4785 }
4786
4787 interface Delta {
4788 ops?: Op[];
4789
4790 insert(text: string, attributes?: FormatAttributes): Delta;
4791 insert(embed: number, attributes?: FormatAttributes): Delta;
4792
4793 delete(length: number): Delta;
4794
4795 retain(length: number, attributes?: FormatAttributes): Delta;
4796
4797 length(): number;
4798
4799 slice(): Delta;
4800 slice(start: number): Delta;
4801 slice(start: number, end: number): Delta;
4802
4803 compose(other: Delta): Delta;
4804
4805 transform(other: Delta, priority: boolean): Delta;
4806 transform(index: number): number;
4807
4808 transformPosition(index: number): number;
4809
4810 diff(other: Delta): Delta;
4811 }
4812
4813 interface DeltaStatic {
4814 new (): Delta;
4815 }
4816
4817 type Op = InsertOp | DeleteOp | RetainOp;
4818
4819 interface InsertOp {
4820 insert: string | number;
4821 attributes?: FormatAttributes;
4822 }
4823
4824 interface DeleteOp {
4825 delete: number;
4826 }
4827
4828 interface RetainOp {
4829 retain: number;
4830 attributes?: FormatAttributes;
4831 }
4832}
4833// Type definitions for Lo-Dash
4834// Project: http://lodash.com/
4835// Definitions by: Brian Zengel <https://github.com/bczengel>
4836// Definitions: https://github.com/borisyankov/DefinitelyTyped
4837
4838declare var _: _.LoDashStatic;
4839
4840declare module _ {
4841 interface LoDashStatic {
4842 /**
4843 * Creates a lodash object which wraps the given value to enable intuitive method chaining.
4844 *
4845 * In addition to Lo-Dash methods, wrappers also have the following Array methods:
4846 * concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift
4847 *
4848 * Chaining is supported in custom builds as long as the value method is implicitly or
4849 * explicitly included in the build.
4850 *
4851 * The chainable wrapper functions are:
4852 * after, assign, bind, bindAll, bindKey, chain, compact, compose, concat, countBy,
4853 * createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten,
4854 * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy,
4855 * indexBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min,
4856 * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject,
4857 * remove, rest, reverse, shuffle, slice, sort, sortBy, splice, tap, throttle, times,
4858 * toArray, transform, union, uniq, unshift, unzip, values, where, without, wrap, and zip
4859 *
4860 * The non-chainable wrapper functions are:
4861 * clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast,
4862 * findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean,
4863 * isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNumber,
4864 * isObject, isPlainObject, isRegExp, isString, join, lastIndexOf, mixin,
4865 * noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some,
4866 * sortedIndex, runInContext, template, unescape, uniqueId, and value
4867 *
4868 * The wrapper functions first and last return wrapped values when n is provided, otherwise
4869 * they return unwrapped values.
4870 *
4871 * Explicit chaining can be enabled by using the _.chain method.
4872 **/
4873 (value: number): LoDashWrapper<number>;
4874 (value: string): LoDashWrapper<string>;
4875 (value: boolean): LoDashWrapper<boolean>;
4876 <T>(value: Array<T>): LoDashArrayWrapper<T>;
4877 <T extends {}>(value: T): LoDashObjectWrapper<T>;
4878 (value: any): LoDashWrapper<any>;
4879
4880 /**
4881 * The semantic version number.
4882 **/
4883 VERSION: string;
4884
4885 /**
4886 * An object used to flag environments features.
4887 **/
4888 support: Support;
4889
4890 /**
4891 * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
4892 * (ERB). Change the following template settings to use alternative delimiters.
4893 **/
4894 templateSettings: TemplateSettings;
4895 }
4896
4897 /**
4898 * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
4899 * (ERB). Change the following template settings to use alternative delimiters.
4900 **/
4901 interface TemplateSettings {
4902 /**
4903 * The "escape" delimiter.
4904 **/
4905 escape?: RegExp;
4906
4907 /**
4908 * The "evaluate" delimiter.
4909 **/
4910 evaluate?: RegExp;
4911
4912 /**
4913 * An object to import into the template as local variables.
4914 **/
4915 imports?: Dictionary<any>;
4916
4917 /**
4918 * The "interpolate" delimiter.
4919 **/
4920 interpolate?: RegExp;
4921
4922 /**
4923 * Used to reference the data object in the template text.
4924 **/
4925 variable?: string;
4926 }
4927
4928 /**
4929 * An object used to flag environments features.
4930 **/
4931 interface Support {
4932 /**
4933 * Detect if an arguments object’s [[Class]] is resolvable (all but Firefox < 4, IE < 9).
4934 **/
4935 argsClass: boolean;
4936
4937 /**
4938 * Detect if arguments objects are Object objects (all but Narwhal and Opera < 10.5).
4939 **/
4940 argsObject: boolean;
4941
4942 /**
4943 * Detect if name or message properties of Error.prototype are enumerable by default.
4944 * (IE < 9, Safari < 5.1)
4945 **/
4946 enumErrorProps: boolean;
4947
4948 /**
4949 * Detect if Function#bind exists and is inferred to be fast (all but V8).
4950 **/
4951 fastBind: boolean;
4952
4953 /**
4954 * Detect if functions can be decompiled by Function#toString (all but PS3 and older Opera
4955 * mobile browsers & avoided in Windows 8 apps).
4956 **/
4957 funcDecomp: boolean;
4958
4959 /**
4960 * Detect if Function#name is supported (all but IE).
4961 **/
4962 funcNames: boolean;
4963
4964 /**
4965 * Detect if arguments object indexes are non-enumerable (Firefox < 4, IE < 9, PhantomJS,
4966 * Safari < 5.1).
4967 **/
4968 nonEnumArgs: boolean;
4969
4970 /**
4971 * Detect if properties shadowing those on Object.prototype are non-enumerable.
4972 *
4973 * In IE < 9 an objects own properties, shadowing non-enumerable ones, are made
4974 * non-enumerable as well (a.k.a the JScript [[DontEnum]] bug).
4975 **/
4976 nonEnumShadows: boolean;
4977
4978 /**
4979 * Detect if own properties are iterated after inherited properties (all but IE < 9).
4980 **/
4981 ownLast: boolean;
4982
4983 /**
4984 * Detect if Array#shift and Array#splice augment array-like objects correctly.
4985 *
4986 * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array shift() and splice()
4987 * functions that fail to remove the last element, value[0], of array-like objects even
4988 * though the length property is set to 0. The shift() method is buggy in IE 8 compatibility
4989 * mode, while splice() is buggy regardless of mode in IE < 9 and buggy in compatibility mode
4990 * in IE 9.
4991 **/
4992 spliceObjects: boolean;
4993
4994 /**
4995 * Detect lack of support for accessing string characters by index.
4996 *
4997 * IE < 8 can't access characters by index and IE 8 can only access characters by index on
4998 * string literals.
4999 **/
5000 unindexedChars: boolean;
5001 }
5002
5003 interface LoDashWrapperBase<T, TWrapper> {
5004 /**
5005 * Produces the toString result of the wrapped value.
5006 * @return Returns the string result.
5007 **/
5008 toString(): string;
5009
5010 /**
5011 * Extracts the wrapped value.
5012 * @return The wrapped value.
5013 **/
5014 valueOf(): T;
5015
5016 /**
5017 * @see valueOf
5018 **/
5019 value(): T;
5020 }
5021
5022 interface LoDashWrapper<T> extends LoDashWrapperBase<T, LoDashWrapper<T>> { }
5023
5024 interface LoDashObjectWrapper<T> extends LoDashWrapperBase<T, LoDashObjectWrapper<T>> { }
5025
5026 interface LoDashArrayWrapper<T> extends LoDashWrapperBase<T[], LoDashArrayWrapper<T>> {
5027 concat(...items: T[]): LoDashArrayWrapper<T>;
5028 join(seperator?: string): LoDashWrapper<string>;
5029 pop(): LoDashWrapper<T>;
5030 push(...items: T[]): void;
5031 reverse(): LoDashArrayWrapper<T>;
5032 shift(): LoDashWrapper<T>;
5033 slice(start: number, end?: number): LoDashArrayWrapper<T>;
5034 sort(compareFn?: (a: T, b: T) => number): LoDashArrayWrapper<T>;
5035 splice(start: number): LoDashArrayWrapper<T>;
5036 splice(start: number, deleteCount: number, ...items: any[]): LoDashArrayWrapper<T>;
5037 unshift(...items: any[]): LoDashWrapper<number>;
5038 }
5039
5040 //_.chain
5041 interface LoDashStatic {
5042 /**
5043 * Creates a lodash object that wraps the given value with explicit method chaining enabled.
5044 * @param value The value to wrap.
5045 * @return The wrapper object.
5046 **/
5047 chain(value: number): LoDashWrapper<number>;
5048 chain(value: string): LoDashWrapper<string>;
5049 chain(value: boolean): LoDashWrapper<boolean>;
5050 chain<T>(value: Array<T>): LoDashArrayWrapper<T>;
5051 chain<T extends {}>(value: T): LoDashObjectWrapper<T>;
5052 chain(value: any): LoDashWrapper<any>;
5053 }
5054
5055 interface LoDashWrapperBase<T, TWrapper> {
5056 /**
5057 * Enables explicit method chaining on the wrapper object.
5058 * @see _.chain
5059 * @return The wrapper object.
5060 **/
5061 chain(): TWrapper;
5062 }
5063
5064 //_.tap
5065 interface LoDashStatic {
5066 /**
5067 * Invokes interceptor with the value as the first argument and then returns value. The
5068 * purpose of this method is to "tap into" a method chain in order to perform operations on
5069 * intermediate results within the chain.
5070 * @param value The value to provide to interceptor
5071 * @param interceptor The function to invoke.
5072 * @return value
5073 **/
5074 tap<T>(
5075 value: T,
5076 interceptor: (value: T) => void): T;
5077 }
5078
5079 interface LoDashWrapperBase<T, TWrapper> {
5080 /**
5081 * @see _.tap
5082 **/
5083 tap(interceptor: (value: T) => void): TWrapper;
5084 }
5085
5086 /*********
5087 * Arrays *
5088 **********/
5089
5090 //_.compact
5091 interface LoDashStatic {
5092 /**
5093 * Returns a copy of the array with all falsy values removed. In JavaScript, false, null, 0, "",
5094 * undefined and NaN are all falsy.
5095 * @param array Array to compact.
5096 * @return (Array) Returns a new array of filtered values.
5097 **/
5098 compact<T>(array: Array<T>): T[];
5099
5100 /**
5101 * @see _.compact
5102 **/
5103 compact<T>(array: List<T>): T[];
5104 }
5105
5106 interface LoDashArrayWrapper<T> {
5107 /**
5108 * @see _.compact
5109 **/
5110 compact(): LoDashArrayWrapper<T>;
5111 }
5112
5113 //_.difference
5114 interface LoDashStatic {
5115 /**
5116 * Creates an array excluding all values of the provided arrays using strict equality for comparisons
5117 * , i.e. ===.
5118 * @param array The array to process
5119 * @param others The arrays of values to exclude.
5120 * @return Returns a new array of filtered values.
5121 **/
5122 difference<T>(
5123 array: Array<T>,
5124 ...others: Array<T>[]): T[];
5125 /**
5126 * @see _.difference
5127 **/
5128 difference<T>(
5129 array: List<T>,
5130 ...others: List<T>[]): T[];
5131 }
5132
5133 interface LoDashArrayWrapper<T> {
5134 /**
5135 * @see _.difference
5136 **/
5137 difference(
5138 ...others: Array<T>[]): LoDashArrayWrapper<T>;
5139 /**
5140 * @see _.difference
5141 **/
5142 difference(
5143 ...others: List<T>[]): LoDashArrayWrapper<T>;
5144 }
5145
5146 //_.findIndex
5147 interface LoDashStatic {
5148 /**
5149 * This method is like _.find except that it returns the index of the first element that passes
5150 * the callback check, instead of the element itself.
5151 * @param array The array to search.
5152 * @param {(Function|Object|string)} callback The function called per iteration. If a property name or object is provided it will be
5153 * used to create a ".pluck" or ".where" style callback, respectively.
5154 * @param thisArg The this binding of callback.
5155 * @return Returns the index of the found element, else -1.
5156 **/
5157 findIndex<T>(
5158 array: Array<T>,
5159 callback: ListIterator<T, boolean>,
5160 thisArg?: any): number;
5161
5162 /**
5163 * @see _.findIndex
5164 **/
5165 findIndex<T>(
5166 array: List<T>,
5167 callback: ListIterator<T, boolean>,
5168 thisArg?: any): number;
5169
5170 /**
5171 * @see _.findIndex
5172 **/
5173 findIndex<T>(
5174 array: Array<T>,
5175 pluckValue: string): number;
5176
5177 /**
5178 * @see _.findIndex
5179 **/
5180 findIndex<T>(
5181 array: List<T>,
5182 pluckValue: string): number;
5183
5184 /**
5185 * @see _.findIndex
5186 **/
5187 findIndex<W, T>(
5188 array: Array<T>,
5189 whereDictionary: W): number;
5190
5191 /**
5192 * @see _.findIndex
5193 **/
5194 findIndex<W, T>(
5195 array: List<T>,
5196 whereDictionary: W): number;
5197 }
5198
5199 //_.findLastIndex
5200 interface LoDashStatic {
5201 /**
5202 * This method is like _.findIndex except that it iterates over elements of a collection from right to left.
5203 * @param array The array to search.
5204 * @param {(Function|Object|string)} callback The function called per iteration. If a property name or object is provided it will be
5205 * used to create a ".pluck" or ".where" style callback, respectively.
5206 * @param thisArg The this binding of callback.
5207 * @return Returns the index of the found element, else -1.
5208 **/
5209 findLastIndex<T>(
5210 array: Array<T>,
5211 callback: ListIterator<T, boolean>,
5212 thisArg?: any): number;
5213
5214 /**
5215 * @see _.findLastIndex
5216 **/
5217 findLastIndex<T>(
5218 array: List<T>,
5219 callback: ListIterator<T, boolean>,
5220 thisArg?: any): number;
5221
5222 /**
5223 * @see _.findLastIndex
5224 **/
5225 findLastIndex<T>(
5226 array: Array<T>,
5227 pluckValue: string): number;
5228
5229 /**
5230 * @see _.findLastIndex
5231 **/
5232 findLastIndex<T>(
5233 array: List<T>,
5234 pluckValue: string): number;
5235
5236 /**
5237 * @see _.findLastIndex
5238 **/
5239 findLastIndex<T>(
5240 array: Array<T>,
5241 whereDictionary: Dictionary<any>): number;
5242
5243 /**
5244 * @see _.findLastIndex
5245 **/
5246 findLastIndex<T>(
5247 array: List<T>,
5248 whereDictionary: Dictionary<any>): number;
5249 }
5250
5251 //_.first
5252 interface LoDashStatic {
5253 /**
5254 * Gets the first element or first n elements of an array. If a callback is provided
5255 * elements at the beginning of the array are returned as long as the callback returns
5256 * truey. The callback is bound to thisArg and invoked with three arguments; (value,
5257 * index, array).
5258 *
5259 * If a property name is provided for callback the created "_.pluck" style callback
5260 * will return the property value of the given element.
5261 *
5262 * If an object is provided for callback the created "_.where" style callback will return ]
5263 * true for elements that have the properties of the given object, else false.
5264 * @param array Retrieves the first element of this array.
5265 * @return Returns the first element of `array`.
5266 **/
5267 first<T>(array: Array<T>): T;
5268
5269 /**
5270 * @see _.first
5271 **/
5272 first<T>(array: List<T>): T;
5273
5274 /**
5275 * @see _.first
5276 * @param n The number of elements to return.
5277 **/
5278 first<T>(
5279 array: Array<T>,
5280 n: number): T[];
5281
5282 /**
5283 * @see _.first
5284 * @param n The number of elements to return.
5285 **/
5286 first<T>(
5287 array: List<T>,
5288 n: number): T[];
5289
5290 /**
5291 * @see _.first
5292 * @param callback The function called per element.
5293 * @param [thisArg] The this binding of callback.
5294 **/
5295 first<T>(
5296 array: Array<T>,
5297 callback: ListIterator<T, boolean>,
5298 thisArg?: any): T[];
5299
5300 /**
5301 * @see _.first
5302 * @param callback The function called per element.
5303 * @param [thisArg] The this binding of callback.
5304 **/
5305 first<T>(
5306 array: List<T>,
5307 callback: ListIterator<T, boolean>,
5308 thisArg?: any): T[];
5309
5310 /**
5311 * @see _.first
5312 * @param pluckValue "_.pluck" style callback value
5313 **/
5314 first<T>(
5315 array: Array<T>,
5316 pluckValue: string): T[];
5317
5318 /**
5319 * @see _.first
5320 * @param pluckValue "_.pluck" style callback value
5321 **/
5322 first<T>(
5323 array: List<T>,
5324 pluckValue: string): T[];
5325
5326 /**
5327 * @see _.first
5328 * @param whereValue "_.where" style callback value
5329 **/
5330 first<W, T>(
5331 array: Array<T>,
5332 whereValue: W): T[];
5333
5334 /**
5335 * @see _.first
5336 * @param whereValue "_.where" style callback value
5337 **/
5338 first<W, T>(
5339 array: List<T>,
5340 whereValue: W): T[];
5341
5342 /**
5343 * @see _.first
5344 **/
5345 head<T>(array: Array<T>): T;
5346
5347 /**
5348 * @see _.first
5349 **/
5350 head<T>(array: List<T>): T;
5351
5352 /**
5353 * @see _.first
5354 **/
5355 head<T>(
5356 array: Array<T>,
5357 n: number): T[];
5358
5359 /**
5360 * @see _.first
5361 **/
5362 head<T>(
5363 array: List<T>,
5364 n: number): T[];
5365
5366 /**
5367 * @see _.first
5368 **/
5369 head<T>(
5370 array: Array<T>,
5371 callback: ListIterator<T, boolean>,
5372 thisArg?: any): T[];
5373
5374 /**
5375 * @see _.first
5376 **/
5377 head<T>(
5378 array: List<T>,
5379 callback: ListIterator<T, boolean>,
5380 thisArg?: any): T[];
5381
5382 /**
5383 * @see _.first
5384 **/
5385 head<T>(
5386 array: Array<T>,
5387 pluckValue: string): T[];
5388
5389 /**
5390 * @see _.first
5391 **/
5392 head<T>(
5393 array: List<T>,
5394 pluckValue: string): T[];
5395
5396 /**
5397 * @see _.first
5398 **/
5399 head<W, T>(
5400 array: Array<T>,
5401 whereValue: W): T[];
5402
5403 /**
5404 * @see _.first
5405 **/
5406 head<W, T>(
5407 array: List<T>,
5408 whereValue: W): T[];
5409
5410 /**
5411 * @see _.first
5412 **/
5413 take<T>(array: Array<T>): T;
5414
5415 /**
5416 * @see _.first
5417 **/
5418 take<T>(array: List<T>): T;
5419
5420 /**
5421 * @see _.first
5422 **/
5423 take<T>(
5424 array: Array<T>,
5425 n: number): T[];
5426
5427 /**
5428 * @see _.first
5429 **/
5430 take<T>(
5431 array: List<T>,
5432 n: number): T[];
5433
5434 /**
5435 * @see _.first
5436 **/
5437 take<T>(
5438 array: Array<T>,
5439 callback: ListIterator<T, boolean>,
5440 thisArg?: any): T[];
5441
5442 /**
5443 * @see _.first
5444 **/
5445 take<T>(
5446 array: List<T>,
5447 callback: ListIterator<T, boolean>,
5448 thisArg?: any): T[];
5449
5450 /**
5451 * @see _.first
5452 **/
5453 take<T>(
5454 array: Array<T>,
5455 pluckValue: string): T[];
5456
5457 /**
5458 * @see _.first
5459 **/
5460 take<T>(
5461 array: List<T>,
5462 pluckValue: string): T[];
5463
5464 /**
5465 * @see _.first
5466 **/
5467 take<W, T>(
5468 array: Array<T>,
5469 whereValue: W): T[];
5470
5471 /**
5472 * @see _.first
5473 **/
5474 take<W, T>(
5475 array: List<T>,
5476 whereValue: W): T[];
5477 }
5478
5479 interface LoDashArrayWrapper<T> {
5480 /**
5481 * @see _.first
5482 **/
5483 first(): T;
5484
5485 /**
5486 * @see _.first
5487 * @param n The number of elements to return.
5488 **/
5489 first(n: number): LoDashArrayWrapper<T>;
5490
5491 /**
5492 * @see _.first
5493 * @param callback The function called per element.
5494 * @param [thisArg] The this binding of callback.
5495 **/
5496 first(
5497 callback: ListIterator<T, boolean>,
5498 thisArg?: any): LoDashArrayWrapper<T>;
5499
5500 /**
5501 * @see _.first
5502 * @param pluckValue "_.pluck" style callback value
5503 **/
5504 first(pluckValue: string): LoDashArrayWrapper<T>;
5505
5506 /**
5507 * @see _.first
5508 * @param whereValue "_.where" style callback value
5509 **/
5510 first<W>(whereValue: W): LoDashArrayWrapper<T>;
5511
5512 /**
5513 * @see _.first
5514 **/
5515 head(): T;
5516
5517 /**
5518 * @see _.first
5519 * @param n The number of elements to return.
5520 **/
5521 head(n: number): LoDashArrayWrapper<T>;
5522
5523 /**
5524 * @see _.first
5525 * @param callback The function called per element.
5526 * @param [thisArg] The this binding of callback.
5527 **/
5528 head(
5529 callback: ListIterator<T, boolean>,
5530 thisArg?: any): LoDashArrayWrapper<T>;
5531
5532 /**
5533 * @see _.first
5534 * @param pluckValue "_.pluck" style callback value
5535 **/
5536 head(pluckValue: string): LoDashArrayWrapper<T>;
5537
5538 /**
5539 * @see _.first
5540 * @param whereValue "_.where" style callback value
5541 **/
5542 head<W>(whereValue: W): LoDashArrayWrapper<T>;
5543
5544 /**
5545 * @see _.first
5546 **/
5547 take(): T;
5548
5549 /**
5550 * @see _.first
5551 * @param n The number of elements to return.
5552 **/
5553 take(n: number): LoDashArrayWrapper<T>;
5554
5555 /**
5556 * @see _.first
5557 * @param callback The function called per element.
5558 * @param [thisArg] The this binding of callback.
5559 **/
5560 take(
5561 callback: ListIterator<T, boolean>,
5562 thisArg?: any): LoDashArrayWrapper<T>;
5563
5564 /**
5565 * @see _.first
5566 * @param pluckValue "_.pluck" style callback value
5567 **/
5568 take(pluckValue: string): LoDashArrayWrapper<T>;
5569
5570 /**
5571 * @see _.first
5572 * @param whereValue "_.where" style callback value
5573 **/
5574 take<W>(whereValue: W): LoDashArrayWrapper<T>;
5575 }
5576
5577 //_.flatten
5578 interface LoDashStatic {
5579 /**
5580 * Flattens a nested array (the nesting can be to any depth). If isShallow is truey, the
5581 * array will only be flattened a single level. If a callback is provided each element of
5582 * the array is passed through the callback before flattening. The callback is bound to
5583 * thisArg and invoked with three arguments; (value, index, array).
5584 *
5585 * If a property name is provided for callback the created "_.pluck" style callback will
5586 * return the property value of the given element.
5587 *
5588 * If an object is provided for callback the created "_.where" style callback will return
5589 * true for elements that have the properties of the given object, else false.
5590 * @param array The array to flatten.
5591 * @param shallow If true then only flatten one level, optional, default = false.
5592 * @return `array` flattened.
5593 **/
5594 flatten<T>(array: Array<any>, isShallow?: boolean): T[];
5595
5596 /**
5597 * @see _.flatten
5598 **/
5599 flatten<T>(array: List<any>, isShallow?: boolean): T[];
5600
5601 /**
5602 * @see _.flatten
5603 **/
5604 flatten<T>(
5605 array: Array<any>,
5606 isShallow: boolean,
5607 callback: ListIterator<any, T>,
5608 thisArg?: any): T[];
5609
5610 /**
5611 * @see _.flatten
5612 **/
5613 flatten<T>(
5614 array: List<any>,
5615 isShallow: boolean,
5616 callback: ListIterator<any, T>,
5617 thisArg?: any): T[];
5618
5619 /**
5620 * @see _.flatten
5621 **/
5622 flatten<T>(
5623 array: Array<any>,
5624 callback: ListIterator<any, T>,
5625 thisArg?: any): T[];
5626
5627 /**
5628 * @see _.flatten
5629 **/
5630 flatten<T>(
5631 array: List<any>,
5632 callback: ListIterator<any, T>,
5633 thisArg?: any): T[];
5634
5635 /**
5636 * @see _.flatten
5637 **/
5638 flatten<W, T>(
5639 array: Array<any>,
5640 isShallow: boolean,
5641 whereValue: W): T[];
5642
5643 /**
5644 * @see _.flatten
5645 **/
5646 flatten<W, T>(
5647 array: List<any>,
5648 isShallow: boolean,
5649 whereValue: W): T[];
5650
5651 /**
5652 * @see _.flatten
5653 **/
5654 flatten<W, T>(
5655 array: Array<any>,
5656 whereValue: W): T[];
5657
5658 /**
5659 * @see _.flatten
5660 **/
5661 flatten<W, T>(
5662 array: List<any>,
5663 whereValue: W): T[];
5664
5665 /**
5666 * @see _.flatten
5667 **/
5668 flatten<T>(
5669 array: Array<any>,
5670 isShallow: boolean,
5671 pluckValue: string): T[];
5672
5673 /**
5674 * @see _.flatten
5675 **/
5676 flatten<T>(
5677 array: List<any>,
5678 isShallow: boolean,
5679 pluckValue: string): T[];
5680
5681 /**
5682 * @see _.flatten
5683 **/
5684 flatten<T>(
5685 array: Array<any>,
5686 pluckValue: string): T[];
5687
5688 /**
5689 * @see _.flatten
5690 **/
5691 flatten<T>(
5692 array: List<any>,
5693 pluckValue: string): T[];
5694 }
5695
5696 interface LoDashArrayWrapper<T> {
5697 /**
5698 * @see _.flatten
5699 **/
5700 flatten<Flat>(isShallow?: boolean): LoDashArrayWrapper<Flat>;
5701
5702 /**
5703 * @see _.flatten
5704 **/
5705 flatten<Flat>(
5706 isShallow: boolean,
5707 callback: ListIterator<T, Flat>,
5708 thisArg?: any): LoDashArrayWrapper<Flat>;
5709
5710 /**
5711 * @see _.flatten
5712 **/
5713 flatten<Flat>(
5714 callback: ListIterator<T, Flat>,
5715 thisArg?: any): LoDashArrayWrapper<Flat>;
5716
5717 /**
5718 * @see _.flatten
5719 **/
5720 flatten<Flat>(
5721 isShallow: boolean,
5722 pluckValue: string): LoDashArrayWrapper<Flat>;
5723
5724 /**
5725 * @see _.flatten
5726 **/
5727 flatten<Flat>(
5728 pluckValue: string): LoDashArrayWrapper<Flat>;
5729
5730 /**
5731 * @see _.flatten
5732 **/
5733 flatten<Flat, W>(
5734 isShallow: boolean,
5735 whereValue: W): LoDashArrayWrapper<Flat>;
5736
5737 /**
5738 * @see _.flatten
5739 **/
5740 flatten<Flat, W>(
5741 whereValue: W): LoDashArrayWrapper<Flat>;
5742 }
5743
5744 //_.indexOf
5745 interface LoDashStatic {
5746 /**
5747 * Gets the index at which the first occurrence of value is found using strict equality
5748 * for comparisons, i.e. ===. If the array is already sorted providing true for fromIndex
5749 * will run a faster binary search.
5750 * @param array The array to search.
5751 * @param value The value to search for.
5752 * @param fromIndex The index to search from.
5753 * @return The index of `value` within `array`.
5754 **/
5755 indexOf<T>(
5756 array: Array<T>,
5757 value: T): number;
5758
5759 /**
5760 * @see _.indexOf
5761 **/
5762 indexOf<T>(
5763 array: List<T>,
5764 value: T): number;
5765
5766 /**
5767 * @see _.indexOf
5768 * @param fromIndex The index to search from
5769 **/
5770 indexOf<T>(
5771 array: Array<T>,
5772 value: T,
5773 fromIndex: number): number;
5774
5775 /**
5776 * @see _.indexOf
5777 * @param fromIndex The index to search from
5778 **/
5779 indexOf<T>(
5780 array: List<T>,
5781 value: T,
5782 fromIndex: number): number;
5783
5784 /**
5785 * @see _.indexOf
5786 * @param isSorted True to perform a binary search on a sorted array.
5787 **/
5788 indexOf<T>(
5789 array: Array<T>,
5790 value: T,
5791 isSorted: boolean): number;
5792
5793 /**
5794 * @see _.indexOf
5795 * @param isSorted True to perform a binary search on a sorted array.
5796 **/
5797 indexOf<T>(
5798 array: List<T>,
5799 value: T,
5800 isSorted: boolean): number;
5801 }
5802
5803 //_.initial
5804 interface LoDashStatic {
5805 /**
5806 * Gets all but the last element or last n elements of an array. If a callback is provided
5807 * elements at the end of the array are excluded from the result as long as the callback
5808 * returns truey. The callback is bound to thisArg and invoked with three arguments;
5809 * (value, index, array).
5810 *
5811 * If a property name is provided for callback the created "_.pluck" style callback will
5812 * return the property value of the given element.
5813 *
5814 * If an object is provided for callback the created "_.where" style callback will return
5815 * true for elements that have the properties of the given object, else false.
5816 * @param array The array to query.
5817 * @param n Leaves this many elements behind, optional.
5818 * @return Returns everything but the last `n` elements of `array`.
5819 **/
5820 initial<T>(
5821 array: Array<T>): T[];
5822
5823 /**
5824 * @see _.initial
5825 **/
5826 initial<T>(
5827 array: List<T>): T[];
5828
5829 /**
5830 * @see _.initial
5831 * @param n The number of elements to exclude.
5832 **/
5833 initial<T>(
5834 array: Array<T>,
5835 n: number): T[];
5836
5837 /**
5838 * @see _.initial
5839 * @param n The number of elements to exclude.
5840 **/
5841 initial<T>(
5842 array: List<T>,
5843 n: number): T[];
5844
5845 /**
5846 * @see _.initial
5847 * @param callback The function called per element
5848 **/
5849 initial<T>(
5850 array: Array<T>,
5851 callback: ListIterator<T, boolean>): T[];
5852
5853 /**
5854 * @see _.initial
5855 * @param callback The function called per element
5856 **/
5857 initial<T>(
5858 array: List<T>,
5859 callback: ListIterator<T, boolean>): T[];
5860
5861 /**
5862 * @see _.initial
5863 * @param pluckValue _.pluck style callback
5864 **/
5865 initial<T>(
5866 array: Array<T>,
5867 pluckValue: string): T[];
5868
5869 /**
5870 * @see _.initial
5871 * @param pluckValue _.pluck style callback
5872 **/
5873 initial<T>(
5874 array: List<T>,
5875 pluckValue: string): T[];
5876
5877 /**
5878 * @see _.initial
5879 * @param whereValue _.where style callback
5880 **/
5881 initial<W, T>(
5882 array: Array<T>,
5883 whereValue: W): T[];
5884
5885 /**
5886 * @see _.initial
5887 * @param whereValue _.where style callback
5888 **/
5889 initial<W, T>(
5890 array: List<T>,
5891 whereValue: W): T[];
5892 }
5893
5894 //_.intersection
5895 interface LoDashStatic {
5896 /**
5897 * Creates an array of unique values present in all provided arrays using strict
5898 * equality for comparisons, i.e. ===.
5899 * @param arrays The arrays to inspect.
5900 * @return Returns an array of composite values.
5901 **/
5902 intersection<T>(...arrays: Array<T>[]): T[];
5903
5904 /**
5905 * @see _.intersection
5906 **/
5907 intersection<T>(...arrays: List<T>[]): T[];
5908 }
5909
5910 //_.last
5911 interface LoDashStatic {
5912 /**
5913 * Gets the last element or last n elements of an array. If a callback is provided
5914 * elements at the end of the array are returned as long as the callback returns truey.
5915 * The callback is bound to thisArg and invoked with three arguments; (value, index, array).
5916 *
5917 * If a property name is provided for callback the created "_.pluck" style callback will
5918 * return the property value of the given element.
5919 *
5920 * If an object is provided for callback the created "_.where" style callback will return
5921 * true for elements that have the properties of the given object, else false.
5922 * @param array The array to query.
5923 * @return Returns the last element(s) of array.
5924 **/
5925 last<T>(array: Array<T>): T;
5926
5927 /**
5928 * @see _.last
5929 **/
5930 last<T>(array: List<T>): T;
5931
5932 /**
5933 * @see _.last
5934 * @param n The number of elements to return
5935 **/
5936 last<T>(
5937 array: Array<T>,
5938 n: number): T[];
5939
5940 /**
5941 * @see _.last
5942 * @param n The number of elements to return
5943 **/
5944 last<T>(
5945 array: List<T>,
5946 n: number): T[];
5947
5948 /**
5949 * @see _.last
5950 * @param callback The function called per element
5951 **/
5952 last<T>(
5953 array: Array<T>,
5954 callback: ListIterator<T, boolean>,
5955 thisArg?: any): T[];
5956
5957 /**
5958 * @see _.last
5959 * @param callback The function called per element
5960 **/
5961 last<T>(
5962 array: List<T>,
5963 callback: ListIterator<T, boolean>,
5964 thisArg?: any): T[];
5965
5966 /**
5967 * @see _.last
5968 * @param pluckValue _.pluck style callback
5969 **/
5970 last<T>(
5971 array: Array<T>,
5972 pluckValue: string): T[];
5973
5974 /**
5975 * @see _.last
5976 * @param pluckValue _.pluck style callback
5977 **/
5978 last<T>(
5979 array: List<T>,
5980 pluckValue: string): T[];
5981
5982 /**
5983 * @see _.last
5984 * @param whereValue _.where style callback
5985 **/
5986 last<W, T>(
5987 array: Array<T>,
5988 whereValue: W): T[];
5989
5990 /**
5991 * @see _.last
5992 * @param whereValue _.where style callback
5993 **/
5994 last<W, T>(
5995 array: List<T>,
5996 whereValue: W): T[];
5997 }
5998
5999 //_.lastIndexOf
6000 interface LoDashStatic {
6001 /**
6002 * Gets the index at which the last occurrence of value is found using strict equality
6003 * for comparisons, i.e. ===. If fromIndex is negative, it is used as the offset from the
6004 * end of the collection.
6005 * @param array The array to search.
6006 * @param value The value to search for.
6007 * @param fromIndex The index to search from.
6008 * @return The index of the matched value or -1.
6009 **/
6010 lastIndexOf<T>(
6011 array: Array<T>,
6012 value: T,
6013 fromIndex?: number): number;
6014
6015 /**
6016 * @see _.lastIndexOf
6017 **/
6018 lastIndexOf<T>(
6019 array: List<T>,
6020 value: T,
6021 fromIndex?: number): number;
6022 }
6023
6024 //_.pull
6025 interface LoDashStatic {
6026 /**
6027 * Removes all provided values from the given array using strict equality for comparisons,
6028 * i.e. ===.
6029 * @param array The array to modify.
6030 * @param values The values to remove.
6031 * @return array.
6032 **/
6033 pull(
6034 array: Array<any>,
6035 ...values: any[]): any[];
6036
6037 /**
6038 * @see _.pull
6039 **/
6040 pull(
6041 array: List<any>,
6042 ...values: any[]): any[];
6043 }
6044
6045 //_.range
6046 interface LoDashStatic {
6047 /**
6048 * Creates an array of numbers (positive and/or negative) progressing from start up
6049 * to but not including end. If start is less than stop a zero-length range is created
6050 * unless a negative step is specified.
6051 * @param start The start of the range.
6052 * @param end The end of the range.
6053 * @param step The value to increment or decrement by.
6054 * @return Returns a new range array.
6055 **/
6056 range(
6057 start: number,
6058 stop: number,
6059 step?: number): number[];
6060
6061 /**
6062 * @see _.range
6063 * @param end The end of the range.
6064 * @return Returns a new range array.
6065 * @note If start is not specified the implementation will never pull the step (step = arguments[2] || 0)
6066 **/
6067 range(stop: number): number[];
6068 }
6069
6070 //_.remove
6071 interface LoDashStatic {
6072 /**
6073 * Removes all elements from an array that the callback returns truey for and returns
6074 * an array of removed elements. The callback is bound to thisArg and invoked with three
6075 * arguments; (value, index, array).
6076 *
6077 * If a property name is provided for callback the created "_.pluck" style callback will
6078 * return the property value of the given element.
6079 *
6080 * If an object is provided for callback the created "_.where" style callback will return
6081 * true for elements that have the properties of the given object, else false.
6082 * @param array The array to modify.
6083 * @param callback The function called per iteration.
6084 * @param thisArg The this binding of callback.
6085 * @return A new array of removed elements.
6086 **/
6087 remove(
6088 array: Array<any>,
6089 callback?: ListIterator<any, boolean>,
6090 thisArg?: any): any[];
6091
6092 /**
6093 * @see _.remove
6094 **/
6095 remove(
6096 array: List<any>,
6097 callback?: ListIterator<any, boolean>,
6098 thisArg?: any): any[];
6099
6100 /**
6101 * @see _.remove
6102 * @param pluckValue _.pluck style callback
6103 **/
6104 remove(
6105 array: Array<any>,
6106 pluckValue?: string): any[];
6107
6108 /**
6109 * @see _.remove
6110 * @param pluckValue _.pluck style callback
6111 **/
6112 remove(
6113 array: List<any>,
6114 pluckValue?: string): any[];
6115
6116 /**
6117 * @see _.remove
6118 * @param whereValue _.where style callback
6119 **/
6120 remove(
6121 array: Array<any>,
6122 wherealue?: Dictionary<any>): any[];
6123
6124 /**
6125 * @see _.remove
6126 * @param whereValue _.where style callback
6127 **/
6128 remove(
6129 array: List<any>,
6130 wherealue?: Dictionary<any>): any[];
6131 }
6132
6133 //_.rest
6134 interface LoDashStatic {
6135 /**
6136 * The opposite of _.initial this method gets all but the first element or first n elements of
6137 * an array. If a callback function is provided elements at the beginning of the array are excluded
6138 * from the result as long as the callback returns truey. The callback is bound to thisArg and
6139 * invoked with three arguments; (value, index, array).
6140 *
6141 * If a property name is provided for callback the created "_.pluck" style callback will return
6142 * the property value of the given element.
6143 *
6144 * If an object is provided for callback the created "_.where" style callback will return true
6145 * for elements that have the properties of the given object, else false.
6146 * @param array The array to query.
6147 * @param {(Function|Object|number|string)} [callback=1] The function called per element or the number
6148 * of elements to exclude. If a property name or object is provided it will be used to create a
6149 * ".pluck" or ".where" style callback, respectively.
6150 * @param {*} [thisArg] The this binding of callback.
6151 * @return Returns a slice of array.
6152 **/
6153 rest<T>(array: Array<T>): T[];
6154
6155 /**
6156 * @see _.rest
6157 **/
6158 rest<T>(array: List<T>): T[];
6159
6160 /**
6161 * @see _.rest
6162 **/
6163 rest<T>(
6164 array: Array<T>,
6165 callback: ListIterator<T, boolean>,
6166 thisArg?: any): T[];
6167
6168 /**
6169 * @see _.rest
6170 **/
6171 rest<T>(
6172 array: List<T>,
6173 callback: ListIterator<T, boolean>,
6174 thisArg?: any): T[];
6175
6176 /**
6177 * @see _.rest
6178 **/
6179 rest<T>(
6180 array: Array<T>,
6181 n: number): T[];
6182
6183 /**
6184 * @see _.rest
6185 **/
6186 rest<T>(
6187 array: List<T>,
6188 n: number): T[];
6189
6190 /**
6191 * @see _.rest
6192 **/
6193 rest<T>(
6194 array: Array<T>,
6195 pluckValue: string): T[];
6196
6197 /**
6198 * @see _.rest
6199 **/
6200 rest<T>(
6201 array: List<T>,
6202 pluckValue: string): T[];
6203
6204 /**
6205 * @see _.rest
6206 **/
6207 rest<W, T>(
6208 array: Array<T>,
6209 whereValue: W): T[];
6210
6211 /**
6212 * @see _.rest
6213 **/
6214 rest<W, T>(
6215 array: List<T>,
6216 whereValue: W): T[];
6217
6218 /**
6219 * @see _.rest
6220 **/
6221 drop<T>(array: Array<T>): T[];
6222
6223 /**
6224 * @see _.rest
6225 **/
6226 drop<T>(array: List<T>): T[];
6227
6228 /**
6229 * @see _.rest
6230 **/
6231 drop<T>(
6232 array: Array<T>,
6233 callback: ListIterator<T, boolean>,
6234 thisArg?: any): T[];
6235
6236 /**
6237 * @see _.rest
6238 **/
6239 drop<T>(
6240 array: List<T>,
6241 callback: ListIterator<T, boolean>,
6242 thisArg?: any): T[];
6243
6244 /**
6245 * @see _.rest
6246 **/
6247 drop<T>(
6248 array: Array<T>,
6249 n: number): T[];
6250
6251 /**
6252 * @see _.rest
6253 **/
6254 drop<T>(
6255 array: List<T>,
6256 n: number): T[];
6257
6258 /**
6259 * @see _.rest
6260 **/
6261 drop<T>(
6262 array: Array<T>,
6263 pluckValue: string): T[];
6264
6265 /**
6266 * @see _.rest
6267 **/
6268 drop<T>(
6269 array: List<T>,
6270 pluckValue: string): T[];
6271
6272 /**
6273 * @see _.rest
6274 **/
6275 drop<W, T>(
6276 array: Array<T>,
6277 whereValue: W): T[];
6278
6279 /**
6280 * @see _.rest
6281 **/
6282 drop<W, T>(
6283 array: List<T>,
6284 whereValue: W): T[];
6285
6286 /**
6287 * @see _.rest
6288 **/
6289 tail<T>(array: Array<T>): T[];
6290
6291 /**
6292 * @see _.rest
6293 **/
6294 tail<T>(array: List<T>): T[];
6295
6296 /**
6297 * @see _.rest
6298 **/
6299 tail<T>(
6300 array: Array<T>,
6301 callback: ListIterator<T, boolean>,
6302 thisArg?: any): T[];
6303
6304 /**
6305 * @see _.rest
6306 **/
6307 tail<T>(
6308 array: List<T>,
6309 callback: ListIterator<T, boolean>,
6310 thisArg?: any): T[];
6311
6312 /**
6313 * @see _.rest
6314 **/
6315 tail<T>(
6316 array: Array<T>,
6317 n: number): T[];
6318
6319 /**
6320 * @see _.rest
6321 **/
6322 tail<T>(
6323 array: List<T>,
6324 n: number): T[];
6325
6326 /**
6327 * @see _.rest
6328 **/
6329 tail<T>(
6330 array: Array<T>,
6331 pluckValue: string): T[];
6332
6333 /**
6334 * @see _.rest
6335 **/
6336 tail<T>(
6337 array: List<T>,
6338 pluckValue: string): T[];
6339
6340 /**
6341 * @see _.rest
6342 **/
6343 tail<W, T>(
6344 array: Array<T>,
6345 whereValue: W): T[];
6346
6347 /**
6348 * @see _.rest
6349 **/
6350 tail<W, T>(
6351 array: List<T>,
6352 whereValue: W): T[];
6353 }
6354
6355 //_.sortedIndex
6356 interface LoDashStatic {
6357 /**
6358 * Uses a binary search to determine the smallest index at which a value should be inserted
6359 * into a given sorted array in order to maintain the sort order of the array. If a callback
6360 * is provided it will be executed for value and each element of array to compute their sort
6361 * ranking. The callback is bound to thisArg and invoked with one argument; (value).
6362 *
6363 * If a property name is provided for callback the created "_.pluck" style callback will
6364 * return the property value of the given element.
6365 *
6366 * If an object is provided for callback the created "_.where" style callback will return
6367 * true for elements that have the properties of the given object, else false.
6368 * @param array The sorted list.
6369 * @param value The value to determine its index within `list`.
6370 * @param callback Iterator to compute the sort ranking of each value, optional.
6371 * @return The index at which value should be inserted into array.
6372 **/
6373 sortedIndex<T, TSort>(
6374 array: Array<T>,
6375 value: T,
6376 callback?: (x: T) => TSort,
6377 thisArg?: any): number;
6378
6379 /**
6380 * @see _.sortedIndex
6381 **/
6382 sortedIndex<T, TSort>(
6383 array: List<T>,
6384 value: T,
6385 callback?: (x: T) => TSort,
6386 thisArg?: any): number;
6387
6388 /**
6389 * @see _.sortedIndex
6390 * @param pluckValue the _.pluck style callback
6391 **/
6392 sortedIndex<T>(
6393 array: Array<T>,
6394 value: T,
6395 pluckValue: string): number;
6396
6397 /**
6398 * @see _.sortedIndex
6399 * @param pluckValue the _.pluck style callback
6400 **/
6401 sortedIndex<T>(
6402 array: List<T>,
6403 value: T,
6404 pluckValue: string): number;
6405
6406 /**
6407 * @see _.sortedIndex
6408 * @param pluckValue the _.where style callback
6409 **/
6410 sortedIndex<W, T>(
6411 array: Array<T>,
6412 value: T,
6413 whereValue: W): number;
6414
6415 /**
6416 * @see _.sortedIndex
6417 * @param pluckValue the _.where style callback
6418 **/
6419 sortedIndex<W, T>(
6420 array: List<T>,
6421 value: T,
6422 whereValue: W): number;
6423 }
6424
6425 //_.union
6426 interface LoDashStatic {
6427 /**
6428 * Creates an array of unique values, in order, of the provided arrays using strict
6429 * equality for comparisons, i.e. ===.
6430 * @param arrays The arrays to inspect.
6431 * @return Returns an array of composite values.
6432 **/
6433 union<T>(...arrays: Array<T>[]): T[];
6434
6435 /**
6436 * @see _.union
6437 **/
6438 union<T>(...arrays: List<T>[]): T[];
6439 }
6440
6441 //_.uniq
6442 interface LoDashStatic {
6443 /**
6444 * Creates a duplicate-value-free version of an array using strict equality for comparisons,
6445 * i.e. ===. If the array is sorted, providing true for isSorted will use a faster algorithm.
6446 * If a callback is provided each element of array is passed through the callback before
6447 * uniqueness is computed. The callback is bound to thisArg and invoked with three arguments;
6448 * (value, index, array).
6449 *
6450 * If a property name is provided for callback the created "_.pluck" style callback will
6451 * return the property value of the given element.
6452 *
6453 * If an object is provided for callback the created "_.where" style callback will return
6454 * true for elements that have the properties of the given object, else false.
6455 * @param array Array to remove duplicates from.
6456 * @param isSorted True if `array` is already sorted, optiona, default = false.
6457 * @param iterator Transform the elements of `array` before comparisons for uniqueness.
6458 * @param context 'this' object in `iterator`, optional.
6459 * @return Copy of `array` where all elements are unique.
6460 **/
6461 uniq<T, TSort>(array: Array<T>, isSorted?: boolean): T[];
6462
6463 /**
6464 * @see _.uniq
6465 **/
6466 uniq<T, TSort>(array: List<T>, isSorted?: boolean): T[];
6467
6468 /**
6469 * @see _.uniq
6470 **/
6471 uniq<T, TSort>(
6472 array: Array<T>,
6473 isSorted: boolean,
6474 callback: ListIterator<T, TSort>,
6475 thisArg?: any): T[];
6476
6477 /**
6478 * @see _.uniq
6479 **/
6480 uniq<T, TSort>(
6481 array: List<T>,
6482 isSorted: boolean,
6483 callback: ListIterator<T, TSort>,
6484 thisArg?: any): T[];
6485
6486 /**
6487 * @see _.uniq
6488 **/
6489 uniq<T, TSort>(
6490 array: Array<T>,
6491 callback: ListIterator<T, TSort>,
6492 thisArg?: any): T[];
6493
6494 /**
6495 * @see _.uniq
6496 **/
6497 uniq<T, TSort>(
6498 array: List<T>,
6499 callback: ListIterator<T, TSort>,
6500 thisArg?: any): T[];
6501
6502 /**
6503 * @see _.uniq
6504 * @param pluckValue _.pluck style callback
6505 **/
6506 uniq<T>(
6507 array: Array<T>,
6508 isSorted: boolean,
6509 pluckValue: string): T[];
6510
6511 /**
6512 * @see _.uniq
6513 * @param pluckValue _.pluck style callback
6514 **/
6515 uniq<T>(
6516 array: List<T>,
6517 isSorted: boolean,
6518 pluckValue: string): T[];
6519
6520 /**
6521 * @see _.uniq
6522 * @param pluckValue _.pluck style callback
6523 **/
6524 uniq<T>(
6525 array: Array<T>,
6526 pluckValue: string): T[];
6527
6528 /**
6529 * @see _.uniq
6530 * @param pluckValue _.pluck style callback
6531 **/
6532 uniq<T>(
6533 array: List<T>,
6534 pluckValue: string): T[];
6535
6536 /**
6537 * @see _.uniq
6538 * @param whereValue _.where style callback
6539 **/
6540 uniq<W, T>(
6541 array: Array<T>,
6542 isSorted: boolean,
6543 whereValue: W): T[];
6544
6545 /**
6546 * @see _.uniq
6547 * @param whereValue _.where style callback
6548 **/
6549 uniq<W, T>(
6550 array: List<T>,
6551 isSorted: boolean,
6552 whereValue: W): T[];
6553
6554 /**
6555 * @see _.uniq
6556 * @param whereValue _.where style callback
6557 **/
6558 uniq<W, T>(
6559 array: Array<T>,
6560 whereValue: W): T[];
6561
6562 /**
6563 * @see _.uniq
6564 * @param whereValue _.where style callback
6565 **/
6566 uniq<W, T>(
6567 array: List<T>,
6568 whereValue: W): T[];
6569
6570 /**
6571 * @see _.uniq
6572 **/
6573 unique<T>(array: Array<T>, isSorted?: boolean): T[];
6574
6575 /**
6576 * @see _.uniq
6577 **/
6578 unique<T>(array: List<T>, isSorted?: boolean): T[];
6579
6580 /**
6581 * @see _.uniq
6582 **/
6583 unique<T, TSort>(
6584 array: Array<T>,
6585 callback: ListIterator<T, TSort>,
6586 thisArg?: any): T[];
6587
6588 /**
6589 * @see _.uniq
6590 **/
6591 unique<T, TSort>(
6592 array: List<T>,
6593 callback: ListIterator<T, TSort>,
6594 thisArg?: any): T[];
6595
6596 /**
6597 * @see _.uniq
6598 **/
6599 unique<T, TSort>(
6600 array: Array<T>,
6601 isSorted: boolean,
6602 callback: ListIterator<T, TSort>,
6603 thisArg?: any): T[];
6604
6605 /**
6606 * @see _.uniq
6607 **/
6608 unique<T, TSort>(
6609 array: List<T>,
6610 isSorted: boolean,
6611 callback: ListIterator<T, TSort>,
6612 thisArg?: any): T[];
6613
6614 /**
6615 * @see _.uniq
6616 * @param pluckValue _.pluck style callback
6617 **/
6618 unique<T>(
6619 array: Array<T>,
6620 isSorted: boolean,
6621 pluckValue: string): T[];
6622
6623 /**
6624 * @see _.uniq
6625 * @param pluckValue _.pluck style callback
6626 **/
6627 unique<T>(
6628 array: List<T>,
6629 isSorted: boolean,
6630 pluckValue: string): T[];
6631
6632 /**
6633 * @see _.uniq
6634 * @param pluckValue _.pluck style callback
6635 **/
6636 unique<T>(
6637 array: Array<T>,
6638 pluckValue: string): T[];
6639
6640 /**
6641 * @see _.uniq
6642 * @param pluckValue _.pluck style callback
6643 **/
6644 unique<T>(
6645 array: List<T>,
6646 pluckValue: string): T[];
6647
6648 /**
6649 * @see _.uniq
6650 * @param whereValue _.where style callback
6651 **/
6652 unique<W, T>(
6653 array: Array<T>,
6654 whereValue?: W): T[];
6655
6656 /**
6657 * @see _.uniq
6658 * @param whereValue _.where style callback
6659 **/
6660 unique<W, T>(
6661 array: List<T>,
6662 whereValue?: W): T[];
6663
6664 /**
6665 * @see _.uniq
6666 * @param whereValue _.where style callback
6667 **/
6668 unique<W, T>(
6669 array: Array<T>,
6670 isSorted: boolean,
6671 whereValue?: W): T[];
6672
6673 /**
6674 * @see _.uniq
6675 * @param whereValue _.where style callback
6676 **/
6677 unique<W, T>(
6678 array: List<T>,
6679 isSorted: boolean,
6680 whereValue?: W): T[];
6681 }
6682
6683 interface LoDashArrayWrapper<T> {
6684 /**
6685 * @see _.uniq
6686 **/
6687 uniq<TSort>(isSorted?: boolean): LoDashArrayWrapper<T>;
6688
6689 /**
6690 * @see _.uniq
6691 **/
6692 uniq<TSort>(
6693 isSorted: boolean,
6694 callback: ListIterator<T, TSort>,
6695 thisArg?: any): LoDashArrayWrapper<T>;
6696
6697 /**
6698 * @see _.uniq
6699 **/
6700 uniq<TSort>(
6701 callback: ListIterator<T, TSort>,
6702 thisArg?: any): LoDashArrayWrapper<T>;
6703
6704 /**
6705 * @see _.uniq
6706 * @param pluckValue _.pluck style callback
6707 **/
6708 uniq(
6709 isSorted: boolean,
6710 pluckValue: string): LoDashArrayWrapper<T>;
6711
6712 /**
6713 * @see _.uniq
6714 * @param pluckValue _.pluck style callback
6715 **/
6716 uniq(pluckValue: string): LoDashArrayWrapper<T>;
6717
6718 /**
6719 * @see _.uniq
6720 * @param whereValue _.where style callback
6721 **/
6722 uniq<W>(
6723 isSorted: boolean,
6724 whereValue: W): LoDashArrayWrapper<T>;
6725
6726 /**
6727 * @see _.uniq
6728 * @param whereValue _.where style callback
6729 **/
6730 uniq<W>(
6731 whereValue: W): LoDashArrayWrapper<T>;
6732
6733 /**
6734 * @see _.uniq
6735 **/
6736 unique<TSort>(isSorted?: boolean): LoDashArrayWrapper<T>;
6737
6738 /**
6739 * @see _.uniq
6740 **/
6741 unique<TSort>(
6742 isSorted: boolean,
6743 callback: ListIterator<T, TSort>,
6744 thisArg?: any): LoDashArrayWrapper<T>;
6745
6746 /**
6747 * @see _.uniq
6748 **/
6749 unique<TSort>(
6750 callback: ListIterator<T, TSort>,
6751 thisArg?: any): LoDashArrayWrapper<T>;
6752
6753 /**
6754 * @see _.uniq
6755 * @param pluckValue _.pluck style callback
6756 **/
6757 unique(
6758 isSorted: boolean,
6759 pluckValue: string): LoDashArrayWrapper<T>;
6760
6761 /**
6762 * @see _.uniq
6763 * @param pluckValue _.pluck style callback
6764 **/
6765 unique(pluckValue: string): LoDashArrayWrapper<T>;
6766
6767 /**
6768 * @see _.uniq
6769 * @param whereValue _.where style callback
6770 **/
6771 unique<W>(
6772 isSorted: boolean,
6773 whereValue: W): LoDashArrayWrapper<T>;
6774
6775 /**
6776 * @see _.uniq
6777 * @param whereValue _.where style callback
6778 **/
6779 unique<W>(
6780 whereValue: W): LoDashArrayWrapper<T>;
6781 }
6782
6783 //_.without
6784 interface LoDashStatic {
6785 /**
6786 * Creates an array excluding all provided values using strict equality for comparisons, i.e. ===.
6787 * @param array The array to filter.
6788 * @param values The value(s) to exclude.
6789 * @return A new array of filtered values.
6790 **/
6791 without<T>(
6792 array: Array<T>,
6793 ...values: T[]): T[];
6794
6795 /**
6796 * @see _.without
6797 **/
6798 without<T>(
6799 array: List<T>,
6800 ...values: T[]): T[];
6801 }
6802
6803 //_.xor
6804 interface LoDashStatic {
6805 /**
6806 * Creates an array that is the symmetric difference of the provided arrays.
6807 * @param array The array to process
6808 * @param others The arrays of values to calculate the symmetric difference.
6809 * @return Returns a new array of filtered values.
6810 **/
6811 xor<T>(
6812 array: Array<T>,
6813 ...others: Array<T>[]): T[];
6814 /**
6815 * @see _.xor
6816 **/
6817 xor<T>(
6818 array: List<T>,
6819 ...others: List<T>[]): T[];
6820 }
6821
6822 interface LoDashArrayWrapper<T> {
6823 /**
6824 * @see _.xor
6825 **/
6826 xor(
6827 ...others: Array<T>[]): LoDashArrayWrapper<T>;
6828 /**
6829 * @see _.xor
6830 **/
6831 xor(
6832 ...others: List<T>[]): LoDashArrayWrapper<T>;
6833 }
6834
6835 //_.zip
6836 interface LoDashStatic {
6837 /**
6838 * Creates an array of grouped elements, the first of which contains the first
6839 * elements of the given arrays, the second of which contains the second elements
6840 * of the given arrays, and so on.
6841 * @param arrays Arrays to process.
6842 * @return A new array of grouped elements.
6843 **/
6844 zip(...arrays: any[][]): any[][];
6845
6846 /**
6847 * @see _.zip
6848 **/
6849 zip(...arrays: any[]): any[];
6850
6851 /**
6852 * @see _.zip
6853 **/
6854 unzip(...arrays: any[][]): any[][];
6855
6856 /**
6857 * @see _.zip
6858 **/
6859 unzip(...arrays: any[]): any[];
6860 }
6861
6862 interface LoDashArrayWrapper<T> {
6863 /**
6864 * @see _.zip
6865 **/
6866 zip(...arrays: any[][]): _.LoDashArrayWrapper<any[][]>;
6867
6868 /**
6869 * @see _.zip
6870 **/
6871 unzip(...arrays: any[]): _.LoDashArrayWrapper<any[][]>;
6872 }
6873
6874 //_.zipObject
6875 interface LoDashStatic {
6876 /**
6877 * Creates an object composed from arrays of keys and values. Provide either a single
6878 * two dimensional array, i.e. [[key1, value1], [key2, value2]] or two arrays, one of
6879 * keys and one of corresponding values.
6880 * @param keys The array of keys.
6881 * @param values The array of values.
6882 * @return An object composed of the given keys and corresponding values.
6883 **/
6884 zipObject<TResult extends {}>(
6885 keys: List<string>,
6886 values: List<any>): TResult;
6887
6888 /**
6889 * @see _.object
6890 **/
6891 object<TResult extends {}>(
6892 keys: List<string>,
6893 values: List<any>): TResult;
6894 }
6895
6896 /* *************
6897 * Collections *
6898 ************* */
6899
6900 //_.at
6901 interface LoDashStatic {
6902 /**
6903 * Creates an array of elements from the specified indexes, or keys, of the collection.
6904 * Indexes may be specified as individual arguments or as arrays of indexes.
6905 * @param collection The collection to iterate over.
6906 * @param indexes The indexes of collection to retrieve, specified as individual indexes or
6907 * arrays of indexes.
6908 * @return A new array of elements corresponding to the provided indexes.
6909 **/
6910 at<T>(
6911 collection: Array<T>,
6912 indexes: number[]): T[];
6913
6914 /**
6915 * @see _.at
6916 **/
6917 at<T>(
6918 collection: List<T>,
6919 indexes: number[]): T[];
6920
6921 /**
6922 * @see _.at
6923 **/
6924 at<T>(
6925 collection: Dictionary<T>,
6926 indexes: number[]): T[];
6927
6928 /**
6929 * @see _.at
6930 **/
6931 at<T>(
6932 collection: Array<T>,
6933 ...indexes: number[]): T[];
6934
6935 /**
6936 * @see _.at
6937 **/
6938 at<T>(
6939 collection: List<T>,
6940 ...indexes: number[]): T[];
6941
6942 /**
6943 * @see _.at
6944 **/
6945 at<T>(
6946 collection: Dictionary<T>,
6947 ...indexes: number[]): T[];
6948 }
6949
6950 //_.contains
6951 interface LoDashStatic {
6952 /**
6953 * Checks if a given value is present in a collection using strict equality for comparisons,
6954 * i.e. ===. If fromIndex is negative, it is used as the offset from the end of the collection.
6955 * @param collection The collection to iterate over.
6956 * @param target The value to check for.
6957 * @param fromIndex The index to search from.
6958 * @return True if the target element is found, else false.
6959 **/
6960 contains<T>(
6961 collection: Array<T>,
6962 target: T,
6963 fromIndex?: number): boolean;
6964
6965 /**
6966 * @see _.contains
6967 **/
6968 contains<T>(
6969 collection: List<T>,
6970 target: T,
6971 fromIndex?: number): boolean;
6972
6973 /**
6974 * @see _.contains
6975 * @param dictionary The dictionary to iterate over.
6976 * @param key The key in the dictionary to search for.
6977 **/
6978 contains<T>(
6979 dictionary: Dictionary<T>,
6980 key: string,
6981 fromIndex?: number): boolean;
6982
6983 /**
6984 * @see _.contains
6985 * @param searchString the string to search
6986 * @param targetString the string to search for
6987 **/
6988 contains(
6989 searchString: string,
6990 targetString: string,
6991 fromIndex?: number): boolean;
6992
6993 /**
6994 * @see _.contains
6995 **/
6996 include<T>(
6997 collection: Array<T>,
6998 target: T,
6999 fromIndex?: number): boolean;
7000
7001 /**
7002 * @see _.contains
7003 **/
7004 include<T>(
7005 collection: List<T>,
7006 target: T,
7007 fromIndex?: number): boolean;
7008
7009 /**
7010 * @see _.contains
7011 **/
7012 include<T>(
7013 dictionary: Dictionary<T>,
7014 key: string,
7015 fromIndex?: number): boolean;
7016
7017 /**
7018 * @see _.contains
7019 **/
7020 include(
7021 searchString: string,
7022 targetString: string,
7023 fromIndex?: number): boolean;
7024 }
7025
7026 //_.countBy
7027 interface LoDashStatic {
7028 /**
7029 * Creates an object composed of keys generated from the results of running each element
7030 * of collection through the callback. The corresponding value of each key is the number
7031 * of times the key was returned by the callback. The callback is bound to thisArg and
7032 * invoked with three arguments; (value, index|key, collection).
7033 *
7034 * If a property name is provided for callback the created "_.pluck" style callback will
7035 * return the property value of the given element.
7036 *
7037 * If an object is provided for callback the created "_.where" style callback will return
7038 * true for elements that have the properties of the given object, else false.
7039 * @param collection The collection to iterate over.
7040 * @param callback The function called per iteration.
7041 * @param thisArg The this binding of callback.
7042 * @return Returns the composed aggregate object.
7043 **/
7044 countBy<T>(
7045 collection: Array<T>,
7046 callback?: ListIterator<T, any>,
7047 thisArg?: any): Dictionary<number>;
7048
7049 /**
7050 * @see _.countBy
7051 * @param callback Function name
7052 **/
7053 countBy<T>(
7054 collection: List<T>,
7055 callback?: ListIterator<T, any>,
7056 thisArg?: any): Dictionary<number>;
7057
7058 /**
7059 * @see _.countBy
7060 * @param callback Function name
7061 **/
7062 countBy<T>(
7063 collection: Dictionary<T>,
7064 callback?: ListIterator<T, any>,
7065 thisArg?: any): Dictionary<number>;
7066
7067 /**
7068 * @see _.countBy
7069 * @param callback Function name
7070 **/
7071 countBy<T>(
7072 collection: Array<T>,
7073 callback: string,
7074 thisArg?: any): Dictionary<number>;
7075
7076 /**
7077 * @see _.countBy
7078 * @param callback Function name
7079 **/
7080 countBy<T>(
7081 collection: List<T>,
7082 callback: string,
7083 thisArg?: any): Dictionary<number>;
7084
7085 /**
7086 * @see _.countBy
7087 * @param callback Function name
7088 **/
7089 countBy<T>(
7090 collection: Dictionary<T>,
7091 callback: string,
7092 thisArg?: any): Dictionary<number>;
7093 }
7094
7095 interface LoDashArrayWrapper<T> {
7096 /**
7097 * @see _.countBy
7098 **/
7099 countBy(
7100 callback?: ListIterator<T, any>,
7101 thisArg?: any): LoDashObjectWrapper<Dictionary<number>>;
7102
7103 /**
7104 * @see _.countBy
7105 * @param callback Function name
7106 **/
7107 countBy(
7108 callback: string,
7109 thisArg?: any): LoDashObjectWrapper<Dictionary<number>>;
7110 }
7111
7112 //_.every
7113 interface LoDashStatic {
7114 /**
7115 * Checks if the given callback returns truey value for all elements of a collection.
7116 * The callback is bound to thisArg and invoked with three arguments; (value, index|key,
7117 * collection).
7118 *
7119 * If a property name is provided for callback the created "_.pluck" style callback will
7120 * return the property value of the given element.
7121 *
7122 * If an object is provided for callback the created "_.where" style callback will return
7123 * true for elements that have the properties of the given object, else false.
7124 * @param collection The collection to iterate over.
7125 * @param callback The function called per iteration.
7126 * @param thisArg The this binding of callback.
7127 * @return True if all elements passed the callback check, else false.
7128 **/
7129 every<T>(
7130 collection: Array<T>,
7131 callback?: ListIterator<T, boolean>,
7132 thisArg?: any): boolean;
7133
7134 /**
7135 * @see _.every
7136 * @param pluckValue _.pluck style callback
7137 **/
7138 every<T>(
7139 collection: List<T>,
7140 callback?: ListIterator<T, boolean>,
7141 thisArg?: any): boolean;
7142
7143 /**
7144 * @see _.every
7145 * @param pluckValue _.pluck style callback
7146 **/
7147 every<T>(
7148 collection: Dictionary<T>,
7149 callback?: ListIterator<T, boolean>,
7150 thisArg?: any): boolean;
7151
7152 /**
7153 * @see _.every
7154 * @param pluckValue _.pluck style callback
7155 **/
7156 every<T>(
7157 collection: Array<T>,
7158 pluckValue: string): boolean;
7159
7160 /**
7161 * @see _.every
7162 * @param pluckValue _.pluck style callback
7163 **/
7164 every<T>(
7165 collection: List<T>,
7166 pluckValue: string): boolean;
7167
7168 /**
7169 * @see _.every
7170 * @param pluckValue _.pluck style callback
7171 **/
7172 every<T>(
7173 collection: Dictionary<T>,
7174 pluckValue: string): boolean;
7175
7176 /**
7177 * @see _.every
7178 * @param whereValue _.where style callback
7179 **/
7180 every<W, T>(
7181 collection: Array<T>,
7182 whereValue: W): boolean;
7183
7184 /**
7185 * @see _.every
7186 * @param whereValue _.where style callback
7187 **/
7188 every<W, T>(
7189 collection: List<T>,
7190 whereValue: W): boolean;
7191
7192 /**
7193 * @see _.every
7194 * @param whereValue _.where style callback
7195 **/
7196 every<W, T>(
7197 collection: Dictionary<T>,
7198 whereValue: W): boolean;
7199
7200 /**
7201 * @see _.every
7202 **/
7203 all<T>(
7204 collection: Array<T>,
7205 callback?: ListIterator<T, boolean>,
7206 thisArg?: any): boolean;
7207
7208 /**
7209 * @see _.every
7210 **/
7211 all<T>(
7212 collection: List<T>,
7213 callback?: ListIterator<T, boolean>,
7214 thisArg?: any): boolean;
7215
7216 /**
7217 * @see _.every
7218 **/
7219 all<T>(
7220 collection: Dictionary<T>,
7221 callback?: ListIterator<T, boolean>,
7222 thisArg?: any): boolean;
7223
7224 /**
7225 * @see _.every
7226 * @param pluckValue _.pluck style callback
7227 **/
7228 all<T>(
7229 collection: Array<T>,
7230 pluckValue: string): boolean;
7231
7232 /**
7233 * @see _.every
7234 * @param pluckValue _.pluck style callback
7235 **/
7236 all<T>(
7237 collection: List<T>,
7238 pluckValue: string): boolean;
7239
7240 /**
7241 * @see _.every
7242 * @param pluckValue _.pluck style callback
7243 **/
7244 all<T>(
7245 collection: Dictionary<T>,
7246 pluckValue: string): boolean;
7247
7248 /**
7249 * @see _.every
7250 * @param whereValue _.where style callback
7251 **/
7252 all<W, T>(
7253 collection: Array<T>,
7254 whereValue: W): boolean;
7255
7256 /**
7257 * @see _.every
7258 * @param whereValue _.where style callback
7259 **/
7260 all<W, T>(
7261 collection: List<T>,
7262 whereValue: W): boolean;
7263
7264 /**
7265 * @see _.every
7266 * @param whereValue _.where style callback
7267 **/
7268 all<W, T>(
7269 collection: Dictionary<T>,
7270 whereValue: W): boolean;
7271 }
7272
7273 //_.filter
7274 interface LoDashStatic {
7275 /**
7276 * Iterates over elements of a collection, returning an array of all elements the
7277 * callback returns truey for. The callback is bound to thisArg and invoked with three
7278 * arguments; (value, index|key, collection).
7279 *
7280 * If a property name is provided for callback the created "_.pluck" style callback will
7281 * return the property value of the given element.
7282 *
7283 * If an object is provided for callback the created "_.where" style callback will return
7284 * true for elements that have the properties of the given object, else false.
7285 * @param collection The collection to iterate over.
7286 * @param callback The function called per iteration.
7287 * @param context The this binding of callback.
7288 * @return Returns a new array of elements that passed the callback check.
7289 **/
7290 filter<T>(
7291 collection: Array<T>,
7292 callback: ListIterator<T, boolean>,
7293 thisArg?: any): T[];
7294
7295 /**
7296 * @see _.filter
7297 **/
7298 filter<T>(
7299 collection: List<T>,
7300 callback: ListIterator<T, boolean>,
7301 thisArg?: any): T[];
7302
7303 /**
7304 * @see _.filter
7305 **/
7306 filter<T>(
7307 collection: Dictionary<T>,
7308 callback: ListIterator<T, boolean>,
7309 thisArg?: any): T[];
7310
7311 /**
7312 * @see _.filter
7313 * @param pluckValue _.pluck style callback
7314 **/
7315 filter<T>(
7316 collection: Array<T>,
7317 pluckValue: string): T[];
7318
7319 /**
7320 * @see _.filter
7321 * @param pluckValue _.pluck style callback
7322 **/
7323 filter<T>(
7324 collection: List<T>,
7325 pluckValue: string): T[];
7326
7327 /**
7328 * @see _.filter
7329 * @param pluckValue _.pluck style callback
7330 **/
7331 filter<T>(
7332 collection: Dictionary<T>,
7333 pluckValue: string): T[];
7334
7335 /**
7336 * @see _.filter
7337 * @param pluckValue _.pluck style callback
7338 **/
7339 filter<W, T>(
7340 collection: Array<T>,
7341 whereValue: W): T[];
7342
7343 /**
7344 * @see _.filter
7345 * @param pluckValue _.pluck style callback
7346 **/
7347 filter<W, T>(
7348 collection: List<T>,
7349 whereValue: W): T[];
7350
7351 /**
7352 * @see _.filter
7353 * @param pluckValue _.pluck style callback
7354 **/
7355 filter<W, T>(
7356 collection: Dictionary<T>,
7357 whereValue: W): T[];
7358
7359 /**
7360 * @see _.filter
7361 **/
7362 select<T>(
7363 collection: Array<T>,
7364 callback: ListIterator<T, boolean>,
7365 thisArg?: any): T[];
7366
7367 /**
7368 * @see _.filter
7369 **/
7370 select<T>(
7371 collection: List<T>,
7372 callback: ListIterator<T, boolean>,
7373 thisArg?: any): T[];
7374
7375 /**
7376 * @see _.filter
7377 **/
7378 select<T>(
7379 collection: Dictionary<T>,
7380 callback: ListIterator<T, boolean>,
7381 thisArg?: any): T[];
7382
7383 /**
7384 * @see _.filter
7385 * @param pluckValue _.pluck style callback
7386 **/
7387 select<T>(
7388 collection: Array<T>,
7389 pluckValue: string): T[];
7390
7391 /**
7392 * @see _.filter
7393 * @param pluckValue _.pluck style callback
7394 **/
7395 select<T>(
7396 collection: List<T>,
7397 pluckValue: string): T[];
7398
7399 /**
7400 * @see _.filter
7401 * @param pluckValue _.pluck style callback
7402 **/
7403 select<T>(
7404 collection: Dictionary<T>,
7405 pluckValue: string): T[];
7406
7407 /**
7408 * @see _.filter
7409 * @param pluckValue _.pluck style callback
7410 **/
7411 select<W, T>(
7412 collection: Array<T>,
7413 whereValue: W): T[];
7414
7415 /**
7416 * @see _.filter
7417 * @param pluckValue _.pluck style callback
7418 **/
7419 select<W, T>(
7420 collection: List<T>,
7421 whereValue: W): T[];
7422
7423 /**
7424 * @see _.filter
7425 * @param pluckValue _.pluck style callback
7426 **/
7427 select<W, T>(
7428 collection: Dictionary<T>,
7429 whereValue: W): T[];
7430 }
7431
7432 interface LoDashArrayWrapper<T> {
7433 /**
7434 * @see _.filter
7435 **/
7436 filter(
7437 callback: ListIterator<T, boolean>,
7438 thisArg?: any): LoDashArrayWrapper<T>;
7439
7440 /**
7441 * @see _.filter
7442 * @param pluckValue _.pluck style callback
7443 **/
7444 filter(
7445 pluckValue: string): LoDashArrayWrapper<T>;
7446
7447 /**
7448 * @see _.filter
7449 * @param pluckValue _.pluck style callback
7450 **/
7451 filter<W>(
7452 whereValue: W): LoDashArrayWrapper<T>;
7453
7454 /**
7455 * @see _.filter
7456 **/
7457 select(
7458 callback: ListIterator<T, boolean>,
7459 thisArg?: any): LoDashArrayWrapper<T>;
7460
7461 /**
7462 * @see _.filter
7463 * @param pluckValue _.pluck style callback
7464 **/
7465 select(
7466 pluckValue: string): LoDashArrayWrapper<T>;
7467
7468 /**
7469 * @see _.filter
7470 * @param pluckValue _.pluck style callback
7471 **/
7472 select<W>(
7473 whereValue: W): LoDashArrayWrapper<T>;
7474 }
7475
7476 interface LoDashObjectWrapper<T> {
7477 /**
7478 * @see _.filter
7479 **/
7480 filter<T extends {}>(
7481 callback: ObjectIterator<T, boolean>,
7482 thisArg?: any): LoDashObjectWrapper<T>;
7483 }
7484
7485 //_.find
7486 interface LoDashStatic {
7487 /**
7488 * Iterates over elements of a collection, returning the first element that the callback
7489 * returns truey for. The callback is bound to thisArg and invoked with three arguments;
7490 * (value, index|key, collection).
7491 *
7492 * If a property name is provided for callback the created "_.pluck" style callback will
7493 * return the property value of the given element.
7494 *
7495 * If an object is provided for callback the created "_.where" style callback will return
7496 * true for elements that have the properties of the given object, else false.
7497 * @param collection Searches for a value in this list.
7498 * @param callback The function called per iteration.
7499 * @param thisArg The this binding of callback.
7500 * @return The found element, else undefined.
7501 **/
7502 find<T>(
7503 collection: Array<T>,
7504 callback: ListIterator<T, boolean>,
7505 thisArg?: any): T;
7506
7507 /**
7508 * @see _.find
7509 **/
7510 find<T>(
7511 collection: List<T>,
7512 callback: ListIterator<T, boolean>,
7513 thisArg?: any): T;
7514
7515 /**
7516 * @see _.find
7517 **/
7518 find<T>(
7519 collection: Dictionary<T>,
7520 callback: ListIterator<T, boolean>,
7521 thisArg?: any): T;
7522
7523 /**
7524 * @see _.find
7525 * @param _.pluck style callback
7526 **/
7527 find<W, T>(
7528 collection: Array<T>,
7529 whereValue: W): T;
7530
7531 /**
7532 * @see _.find
7533 * @param _.pluck style callback
7534 **/
7535 find<W, T>(
7536 collection: List<T>,
7537 whereValue: W): T;
7538
7539 /**
7540 * @see _.find
7541 * @param _.pluck style callback
7542 **/
7543 find<W, T>(
7544 collection: Dictionary<T>,
7545 whereValue: W): T;
7546
7547 /**
7548 * @see _.find
7549 * @param _.where style callback
7550 **/
7551 find<T>(
7552 collection: Array<T>,
7553 pluckValue: string): T;
7554
7555 /**
7556 * @see _.find
7557 * @param _.where style callback
7558 **/
7559 find<T>(
7560 collection: List<T>,
7561 pluckValue: string): T;
7562
7563 /**
7564 * @see _.find
7565 * @param _.where style callback
7566 **/
7567 find<T>(
7568 collection: Dictionary<T>,
7569 pluckValue: string): T;
7570
7571 /**
7572 * @see _.find
7573 **/
7574 detect<T>(
7575 collection: Array<T>,
7576 callback: ListIterator<T, boolean>,
7577 thisArg?: any): T;
7578
7579 /**
7580 * @see _.find
7581 **/
7582 detect<T>(
7583 collection: List<T>,
7584 callback: ListIterator<T, boolean>,
7585 thisArg?: any): T;
7586
7587 /**
7588 * @see _.find
7589 **/
7590 detect<T>(
7591 collection: Dictionary<T>,
7592 callback: ListIterator<T, boolean>,
7593 thisArg?: any): T;
7594
7595 /**
7596 * @see _.find
7597 * @param _.pluck style callback
7598 **/
7599 detect<W, T>(
7600 collection: Array<T>,
7601 whereValue: W): T;
7602
7603 /**
7604 * @see _.find
7605 * @param _.pluck style callback
7606 **/
7607 detect<W, T>(
7608 collection: List<T>,
7609 whereValue: W): T;
7610
7611 /**
7612 * @see _.find
7613 * @param _.pluck style callback
7614 **/
7615 detect<W, T>(
7616 collection: Dictionary<T>,
7617 whereValue: W): T;
7618
7619 /**
7620 * @see _.find
7621 * @param _.where style callback
7622 **/
7623 detect<T>(
7624 collection: Array<T>,
7625 pluckValue: string): T;
7626
7627 /**
7628 * @see _.find
7629 * @param _.where style callback
7630 **/
7631 detect<T>(
7632 collection: List<T>,
7633 pluckValue: string): T;
7634
7635 /**
7636 * @see _.find
7637 * @param _.where style callback
7638 **/
7639 detect<T>(
7640 collection: Dictionary<T>,
7641 pluckValue: string): T;
7642
7643 /**
7644 * @see _.find
7645 **/
7646 findWhere<T>(
7647 collection: Array<T>,
7648 callback: ListIterator<T, boolean>,
7649 thisArg?: any): T;
7650
7651 /**
7652 * @see _.find
7653 **/
7654 findWhere<T>(
7655 collection: List<T>,
7656 callback: ListIterator<T, boolean>,
7657 thisArg?: any): T;
7658
7659 /**
7660 * @see _.find
7661 **/
7662 findWhere<T>(
7663 collection: Dictionary<T>,
7664 callback: ListIterator<T, boolean>,
7665 thisArg?: any): T;
7666
7667 /**
7668 * @see _.find
7669 * @param _.pluck style callback
7670 **/
7671 findWhere<W, T>(
7672 collection: Array<T>,
7673 whereValue: W): T;
7674
7675 /**
7676 * @see _.find
7677 * @param _.pluck style callback
7678 **/
7679 findWhere<W, T>(
7680 collection: List<T>,
7681 whereValue: W): T;
7682
7683 /**
7684 * @see _.find
7685 * @param _.pluck style callback
7686 **/
7687 findWhere<W, T>(
7688 collection: Dictionary<T>,
7689 whereValue: W): T;
7690
7691 /**
7692 * @see _.find
7693 * @param _.where style callback
7694 **/
7695 findWhere<T>(
7696 collection: Array<T>,
7697 pluckValue: string): T;
7698
7699 /**
7700 * @see _.find
7701 * @param _.where style callback
7702 **/
7703 findWhere<T>(
7704 collection: List<T>,
7705 pluckValue: string): T;
7706
7707 /**
7708 * @see _.find
7709 * @param _.where style callback
7710 **/
7711 findWhere<T>(
7712 collection: Dictionary<T>,
7713 pluckValue: string): T;
7714 }
7715
7716 interface LoDashArrayWrapper<T> {
7717 /**
7718 * @see _.find
7719 */
7720 find(
7721 callback: ListIterator<T, boolean>,
7722 thisArg?: any): T;
7723 /**
7724 * @see _.find
7725 * @param _.where style callback
7726 */
7727 find<W>(
7728 whereValue: W): T;
7729
7730 /**
7731 * @see _.find
7732 * @param _.where style callback
7733 */
7734 find(
7735 pluckValue: string): T;
7736 }
7737
7738 //_.findLast
7739 interface LoDashStatic {
7740 /**
7741 * This method is like _.find except that it iterates over elements of a collection from
7742 * right to left.
7743 * @param collection Searches for a value in this list.
7744 * @param callback The function called per iteration.
7745 * @param thisArg The this binding of callback.
7746 * @return The found element, else undefined.
7747 **/
7748 findLast<T>(
7749 collection: Array<T>,
7750 callback: ListIterator<T, boolean>,
7751 thisArg?: any): T;
7752
7753 /**
7754 * @see _.find
7755 **/
7756 findLast<T>(
7757 collection: List<T>,
7758 callback: ListIterator<T, boolean>,
7759 thisArg?: any): T;
7760
7761 /**
7762 * @see _.find
7763 **/
7764 findLast<T>(
7765 collection: Dictionary<T>,
7766 callback: ListIterator<T, boolean>,
7767 thisArg?: any): T;
7768
7769 /**
7770 * @see _.find
7771 * @param _.pluck style callback
7772 **/
7773 findLast<W, T>(
7774 collection: Array<T>,
7775 whereValue: W): T;
7776
7777 /**
7778 * @see _.find
7779 * @param _.pluck style callback
7780 **/
7781 findLast<W, T>(
7782 collection: List<T>,
7783 whereValue: W): T;
7784
7785 /**
7786 * @see _.find
7787 * @param _.pluck style callback
7788 **/
7789 findLast<W, T>(
7790 collection: Dictionary<T>,
7791 whereValue: W): T;
7792
7793 /**
7794 * @see _.find
7795 * @param _.where style callback
7796 **/
7797 findLast<T>(
7798 collection: Array<T>,
7799 pluckValue: string): T;
7800
7801 /**
7802 * @see _.find
7803 * @param _.where style callback
7804 **/
7805 findLast<T>(
7806 collection: List<T>,
7807 pluckValue: string): T;
7808
7809 /**
7810 * @see _.find
7811 * @param _.where style callback
7812 **/
7813 findLast<T>(
7814 collection: Dictionary<T>,
7815 pluckValue: string): T;
7816 }
7817
7818 interface LoDashArrayWrapper<T> {
7819 /**
7820 * @see _.findLast
7821 */
7822 findLast(
7823 callback: ListIterator<T, boolean>,
7824 thisArg?: any): T;
7825 /**
7826 * @see _.findLast
7827 * @param _.where style callback
7828 */
7829 findLast<W>(
7830 whereValue: W): T;
7831
7832 /**
7833 * @see _.findLast
7834 * @param _.where style callback
7835 */
7836 findLast(
7837 pluckValue: string): T;
7838 }
7839
7840 //_.groupBy
7841 interface LoDashStatic {
7842 /**
7843 * Creates an object composed of keys generated from the results of running each element
7844 * of a collection through the callback. The corresponding value of each key is an array
7845 * of the elements responsible for generating the key. The callback is bound to thisArg
7846 * and invoked with three arguments; (value, index|key, collection).
7847 *
7848 * If a property name is provided for callback the created "_.pluck" style callback will
7849 * return the property value of the given element.
7850 * If an object is provided for callback the created "_.where" style callback will return
7851 * true for elements that have the properties of the given object, else false
7852 * @param collection The collection to iterate over.
7853 * @param callback The function called per iteration.
7854 * @param thisArg The this binding of callback.
7855 * @return Returns the composed aggregate object.
7856 **/
7857 groupBy<T>(
7858 collection: Array<T>,
7859 callback?: ListIterator<T, any>,
7860 thisArg?: any): Dictionary<T[]>;
7861
7862 /**
7863 * @see _.groupBy
7864 **/
7865 groupBy<T>(
7866 collection: List<T>,
7867 callback?: ListIterator<T, any>,
7868 thisArg?: any): Dictionary<T[]>;
7869
7870 /**
7871 * @see _.groupBy
7872 * @param pluckValue _.pluck style callback
7873 **/
7874 groupBy<T>(
7875 collection: Array<T>,
7876 pluckValue: string): Dictionary<T[]>;
7877
7878 /**
7879 * @see _.groupBy
7880 * @param pluckValue _.pluck style callback
7881 **/
7882 groupBy<T>(
7883 collection: List<T>,
7884 pluckValue: string): Dictionary<T[]>;
7885
7886 /**
7887 * @see _.groupBy
7888 * @param whereValue _.where style callback
7889 **/
7890 groupBy<W, T>(
7891 collection: Array<T>,
7892 whereValue: W): Dictionary<T[]>;
7893
7894 /**
7895 * @see _.groupBy
7896 * @param whereValue _.where style callback
7897 **/
7898 groupBy<W, T>(
7899 collection: List<T>,
7900 whereValue: W): Dictionary<T[]>;
7901
7902 /**
7903 * @see _.groupBy
7904 **/
7905 groupBy<T>(
7906 collection: Dictionary<T>,
7907 callback?: ListIterator<T, any>,
7908 thisArg?: any): Dictionary<T[]>;
7909
7910 /**
7911 * @see _.groupBy
7912 * @param pluckValue _.pluck style callback
7913 **/
7914 groupBy<TValue>(
7915 collection: Dictionary<TValue>,
7916 pluckValue: string): Dictionary<TValue[]>;
7917
7918 /**
7919 * @see _.groupBy
7920 * @param whereValue _.where style callback
7921 **/
7922 groupBy<W, TValue>(
7923 collection: Dictionary<TValue>,
7924 whereValue: W): Dictionary<TValue[]>;
7925 }
7926
7927 interface LoDashArrayWrapper<T> {
7928 /**
7929 * @see _.groupBy
7930 **/
7931 groupBy(
7932 callback: ListIterator<T, any>,
7933 thisArg?: any): _.LoDashObjectWrapper<_.Dictionary<T[]>>;
7934
7935 /**
7936 * @see _.groupBy
7937 **/
7938 groupBy(
7939 pluckValue: string): _.LoDashObjectWrapper<_.Dictionary<T[]>>;
7940
7941 /**
7942 * @see _.groupBy
7943 **/
7944 groupBy<W>(
7945 whereValue: W): _.LoDashObjectWrapper<_.Dictionary<T[]>>;
7946 }
7947
7948 interface LoDashObjectWrapper<T> {
7949 /**
7950 * @see _.groupBy
7951 **/
7952 groupBy<TValue>(
7953 callback: ListIterator<TValue, any>,
7954 thisArg?: any): _.LoDashObjectWrapper<_.Dictionary<TValue[]>>;
7955
7956 /**
7957 * @see _.groupBy
7958 **/
7959 groupBy<TValue>(
7960 pluckValue: string): _.LoDashObjectWrapper<_.Dictionary<TValue[]>>;
7961
7962 /**
7963 * @see _.groupBy
7964 **/
7965 groupBy<W, TValue>(
7966 whereValue: W): _.LoDashObjectWrapper<_.Dictionary<TValue[]>>;
7967 }
7968
7969 //_.indexBy
7970 interface LoDashStatic {
7971 /**
7972 * Creates an object composed of keys generated from the results of running each element
7973 * of the collection through the given callback. The corresponding value of each key is
7974 * the last element responsible for generating the key. The callback is bound to thisArg
7975 * and invoked with three arguments; (value, index|key, collection).
7976 *
7977 * If a property name is provided for callback the created "_.pluck" style callback will
7978 * return the property value of the given element.
7979 *
7980 * If an object is provided for callback the created "_.where" style callback will return
7981 * true for elements that have the properties of the given object, else false.
7982 * @param collection The collection to iterate over.
7983 * @param callback The function called per iteration.
7984 * @param thisArg The this binding of callback.
7985 * @return Returns the composed aggregate object.
7986 **/
7987 indexBy<T>(
7988 list: Array<T>,
7989 iterator: ListIterator<T, any>,
7990 context?: any): Dictionary<T>;
7991
7992 /**
7993 * @see _.indexBy
7994 **/
7995 indexBy<T>(
7996 list: List<T>,
7997 iterator: ListIterator<T, any>,
7998 context?: any): Dictionary<T>;
7999
8000 /**
8001 * @see _.indexBy
8002 * @param pluckValue _.pluck style callback
8003 **/
8004 indexBy<T>(
8005 collection: Array<T>,
8006 pluckValue: string): Dictionary<T>;
8007
8008 /**
8009 * @see _.indexBy
8010 * @param pluckValue _.pluck style callback
8011 **/
8012 indexBy<T>(
8013 collection: List<T>,
8014 pluckValue: string): Dictionary<T>;
8015
8016 /**
8017 * @see _.indexBy
8018 * @param whereValue _.where style callback
8019 **/
8020 indexBy<W, T>(
8021 collection: Array<T>,
8022 whereValue: W): Dictionary<T>;
8023
8024 /**
8025 * @see _.indexBy
8026 * @param whereValue _.where style callback
8027 **/
8028 indexBy<W, T>(
8029 collection: List<T>,
8030 whereValue: W): Dictionary<T>;
8031 }
8032
8033 //_.invoke
8034 interface LoDashStatic {
8035 /**
8036 * Invokes the method named by methodName on each element in the collection returning
8037 * an array of the results of each invoked method. Additional arguments will be provided
8038 * to each invoked method. If methodName is a function it will be invoked for, and this
8039 * bound to, each element in the collection.
8040 * @param collection The collection to iterate over.
8041 * @param methodName The name of the method to invoke.
8042 * @param args Arguments to invoke the method with.
8043 **/
8044 invoke<T extends {}>(
8045 collection: Array<T>,
8046 methodName: string,
8047 ...args: any[]): any;
8048
8049 /**
8050 * @see _.invoke
8051 **/
8052 invoke<T extends {}>(
8053 collection: List<T>,
8054 methodName: string,
8055 ...args: any[]): any;
8056
8057 /**
8058 * @see _.invoke
8059 **/
8060 invoke<T extends {}>(
8061 collection: Dictionary<T>,
8062 methodName: string,
8063 ...args: any[]): any;
8064
8065 /**
8066 * @see _.invoke
8067 **/
8068 invoke<T extends {}>(
8069 collection: Array<T>,
8070 method: Function,
8071 ...args: any[]): any;
8072
8073 /**
8074 * @see _.invoke
8075 **/
8076 invoke<T extends {}>(
8077 collection: List<T>,
8078 method: Function,
8079 ...args: any[]): any;
8080
8081 /**
8082 * @see _.invoke
8083 **/
8084 invoke<T extends {}>(
8085 collection: Dictionary<T>,
8086 method: Function,
8087 ...args: any[]): any;
8088 }
8089
8090 //_.map
8091 interface LoDashStatic {
8092 /**
8093 * Creates an array of values by running each element in the collection through the callback.
8094 * The callback is bound to thisArg and invoked with three arguments; (value, index|key,
8095 * collection).
8096 *
8097 * If a property name is provided for callback the created "_.pluck" style callback will return
8098 * the property value of the given element.
8099 *
8100 * If an object is provided for callback the created "_.where" style callback will return true
8101 * for elements that have the properties of the given object, else false.
8102 * @param collection The collection to iterate over.
8103 * @param callback The function called per iteration.
8104 * @param theArg The this binding of callback.
8105 * @return The mapped array result.
8106 **/
8107 map<T, TResult>(
8108 collection: Array<T>,
8109 callback: ListIterator<T, TResult>,
8110 thisArg?: any): TResult[];
8111
8112 /**
8113 * @see _.map
8114 **/
8115 map<T, TResult>(
8116 collection: List<T>,
8117 callback: ListIterator<T, TResult>,
8118 thisArg?: any): TResult[];
8119
8120 /**
8121 * @see _.map
8122 * @param object The object to iterate over.
8123 * @param callback The function called per iteration.
8124 * @param thisArg `this` object in `iterator`, optional.
8125 * @return The mapped object result.
8126 **/
8127 map<T extends {}, TResult>(
8128 object: Dictionary<T>,
8129 callback: ObjectIterator<T, TResult>,
8130 thisArg?: any): TResult[];
8131
8132 /**
8133 * @see _.map
8134 * @param pluckValue _.pluck style callback
8135 **/
8136 map<T, TResult>(
8137 collection: Array<T>,
8138 pluckValue: string): TResult[];
8139
8140 /**
8141 * @see _.map
8142 * @param pluckValue _.pluck style callback
8143 **/
8144 map<T, TResult>(
8145 collection: List<T>,
8146 pluckValue: string): TResult[];
8147
8148 /**
8149 * @see _.map
8150 **/
8151 collect<T, TResult>(
8152 collection: Array<T>,
8153 callback: ListIterator<T, TResult>,
8154 thisArg?: any): TResult[];
8155
8156 /**
8157 * @see _.map
8158 **/
8159 collect<T, TResult>(
8160 collection: List<T>,
8161 callback: ListIterator<T, TResult>,
8162 thisArg?: any): TResult[];
8163
8164 /**
8165 * @see _.map
8166 **/
8167 collect<T extends {}, TResult>(
8168 object: Dictionary<T>,
8169 callback: ObjectIterator<T, TResult>,
8170 thisArg?: any): TResult[];
8171
8172 /**
8173 * @see _.map
8174 **/
8175 collect<T, TResult>(
8176 collection: Array<T>,
8177 pluckValue: string): TResult[];
8178
8179 /**
8180 * @see _.map
8181 **/
8182 collect<T, TResult>(
8183 collection: List<T>,
8184 pluckValue: string): TResult[];
8185 }
8186
8187 interface LoDashArrayWrapper<T> {
8188 /**
8189 * @see _.map
8190 **/
8191 map<TResult>(
8192 callback: ListIterator<T, TResult>,
8193 thisArg?: any): LoDashArrayWrapper<TResult>;
8194
8195 /**
8196 * @see _.map
8197 * @param pluckValue _.pluck style callback
8198 **/
8199 map<TResult>(
8200 pluckValue: string): LoDashArrayWrapper<TResult>;
8201
8202 /**
8203 * @see _.map
8204 **/
8205 collect<TResult>(
8206 callback: ListIterator<T, TResult>,
8207 thisArg?: any): LoDashArrayWrapper<TResult>;
8208
8209 /**
8210 * @see _.map
8211 **/
8212 collect<TResult>(
8213 pluckValue: string): LoDashArrayWrapper<TResult>;
8214 }
8215
8216 interface LoDashObjectWrapper<T> {
8217 /**
8218 * @see _.map
8219 **/
8220 map<T extends {}, TResult>(
8221 callback: ObjectIterator<T, TResult>,
8222 thisArg?: any): LoDashArrayWrapper<TResult>;
8223
8224 /**
8225 * @see _.map
8226 **/
8227 collect<T extends {}, TResult>(
8228 callback: ObjectIterator<T, TResult>,
8229 thisArg?: any): LoDashArrayWrapper<TResult>;
8230 }
8231
8232 //_.max
8233 interface LoDashStatic {
8234 /**
8235 * Retrieves the maximum value of a collection. If the collection is empty or falsey -Infinity is
8236 * returned. If a callback is provided it will be executed for each value in the collection to
8237 * generate the criterion by which the value is ranked. The callback is bound to thisArg and invoked
8238 * with three arguments; (value, index, collection).
8239 *
8240 * If a property name is provided for callback the created "_.pluck" style callback will return the
8241 * property value of the given element.
8242 *
8243 * If an object is provided for callback the created "_.where" style callback will return true for
8244 * elements that have the properties of the given object, else false.
8245 * @param collection The collection to iterate over.
8246 * @param callback The function called per iteration.
8247 * @param thisArg The this binding of callback.
8248 * @return Returns the maximum value.
8249 **/
8250 max<T>(
8251 collection: Array<T>,
8252 callback?: ListIterator<T, any>,
8253 thisArg?: any): T;
8254
8255 /**
8256 * @see _.max
8257 **/
8258 max<T>(
8259 collection: List<T>,
8260 callback?: ListIterator<T, any>,
8261 thisArg?: any): T;
8262
8263 /**
8264 * @see _.max
8265 **/
8266 max<T>(
8267 collection: Dictionary<T>,
8268 callback?: ListIterator<T, any>,
8269 thisArg?: any): T;
8270
8271 /**
8272 * @see _.max
8273 * @param pluckValue _.pluck style callback
8274 **/
8275 max<T>(
8276 collection: Array<T>,
8277 pluckValue: string): T;
8278
8279 /**
8280 * @see _.max
8281 * @param pluckValue _.pluck style callback
8282 **/
8283 max<T>(
8284 collection: List<T>,
8285 pluckValue: string): T;
8286
8287 /**
8288 * @see _.max
8289 * @param pluckValue _.pluck style callback
8290 **/
8291 max<T>(
8292 collection: Dictionary<T>,
8293 pluckValue: string): T;
8294
8295 /**
8296 * @see _.max
8297 * @param whereValue _.where style callback
8298 **/
8299 max<W, T>(
8300 collection: Array<T>,
8301 whereValue: W): T;
8302
8303 /**
8304 * @see _.max
8305 * @param whereValue _.where style callback
8306 **/
8307 max<W, T>(
8308 collection: List<T>,
8309 whereValue: W): T;
8310
8311 /**
8312 * @see _.max
8313 * @param whereValue _.where style callback
8314 **/
8315 max<W, T>(
8316 collection: Dictionary<T>,
8317 whereValue: W): T;
8318 }
8319
8320 interface LoDashArrayWrapper<T> {
8321 /**
8322 * @see _.max
8323 **/
8324 max(
8325 callback?: ListIterator<T, any>,
8326 thisArg?: any): LoDashWrapper<T>;
8327
8328 /**
8329 * @see _.max
8330 * @param pluckValue _.pluck style callback
8331 **/
8332 max(
8333 pluckValue: string): LoDashWrapper<T>;
8334
8335 /**
8336 * @see _.max
8337 * @param whereValue _.where style callback
8338 **/
8339 max<W>(
8340 whereValue: W): LoDashWrapper<T>;
8341 }
8342
8343 //_.min
8344 interface LoDashStatic {
8345 /**
8346 * Retrieves the minimum value of a collection. If the collection is empty or falsey
8347 * Infinity is returned. If a callback is provided it will be executed for each value
8348 * in the collection to generate the criterion by which the value is ranked. The callback
8349 * is bound to thisArg and invoked with three arguments; (value, index, collection).
8350 *
8351 * If a property name is provided for callback the created "_.pluck" style callback
8352 * will return the property value of the given element.
8353 *
8354 * If an object is provided for callback the created "_.where" style callback will
8355 * return true for elements that have the properties of the given object, else false.
8356 * @param collection The collection to iterate over.
8357 * @param callback The function called per iteration.
8358 * @param thisArg The this binding of callback.
8359 * @return Returns the maximum value.
8360 **/
8361 min<T>(
8362 collection: Array<T>,
8363 callback?: ListIterator<T, any>,
8364 thisArg?: any): T;
8365
8366 /**
8367 * @see _.min
8368 **/
8369 min<T>(
8370 collection: List<T>,
8371 callback?: ListIterator<T, any>,
8372 thisArg?: any): T;
8373
8374 /**
8375 * @see _.min
8376 **/
8377 min<T>(
8378 collection: Dictionary<T>,
8379 callback?: ListIterator<T, any>,
8380 thisArg?: any): T;
8381
8382 /**
8383 * @see _.min
8384 * @param pluckValue _.pluck style callback
8385 **/
8386 min<T>(
8387 collection: Array<T>,
8388 pluckValue: string): T;
8389
8390 /**
8391 * @see _.min
8392 * @param pluckValue _.pluck style callback
8393 **/
8394 min<T>(
8395 collection: List<T>,
8396 pluckValue: string): T;
8397
8398 /**
8399 * @see _.min
8400 * @param pluckValue _.pluck style callback
8401 **/
8402 min<T>(
8403 collection: Dictionary<T>,
8404 pluckValue: string): T;
8405
8406 /**
8407 * @see _.min
8408 * @param whereValue _.where style callback
8409 **/
8410 min<W, T>(
8411 collection: Array<T>,
8412 whereValue: W): T;
8413
8414 /**
8415 * @see _.min
8416 * @param whereValue _.where style callback
8417 **/
8418 min<W, T>(
8419 collection: List<T>,
8420 whereValue: W): T;
8421
8422 /**
8423 * @see _.min
8424 * @param whereValue _.where style callback
8425 **/
8426 min<W, T>(
8427 collection: Dictionary<T>,
8428 whereValue: W): T;
8429 }
8430
8431 interface LoDashArrayWrapper<T> {
8432 /**
8433 * @see _.min
8434 **/
8435 min(
8436 callback?: ListIterator<T, any>,
8437 thisArg?: any): LoDashWrapper<T>;
8438
8439 /**
8440 * @see _.min
8441 * @param pluckValue _.pluck style callback
8442 **/
8443 min(
8444 pluckValue: string): LoDashWrapper<T>;
8445
8446 /**
8447 * @see _.min
8448 * @param whereValue _.where style callback
8449 **/
8450 min<W>(
8451 whereValue: W): LoDashWrapper<T>;
8452 }
8453
8454 //_.sum
8455 interface LoDashStatic {
8456 /**
8457 * Gets the sum of the values in collection.
8458 *
8459 * @param collection The collection to iterate over.
8460 * @param iteratee The function invoked per iteration.
8461 * @param thisArg The this binding of iteratee.
8462 * @return Returns the sum.
8463 **/
8464 sum(
8465 collection: Array<number>): number;
8466
8467 /**
8468 * @see _.sum
8469 **/
8470 sum(
8471 collection: List<number>): number;
8472
8473 /**
8474 * @see _.sum
8475 **/
8476 sum(
8477 collection: Dictionary<number>): number;
8478
8479 /**
8480 * @see _.sum
8481 **/
8482 sum<T>(
8483 collection: Array<T>,
8484 iteratee: ListIterator<T, number>,
8485 thisArg?: any): number;
8486
8487 /**
8488 * @see _.sum
8489 **/
8490 sum<T>(
8491 collection: List<T>,
8492 iteratee: ListIterator<T, number>,
8493 thisArg?: any): number;
8494
8495 /**
8496 * @see _.sum
8497 **/
8498 sum<T>(
8499 collection: Dictionary<T>,
8500 iteratee: ObjectIterator<T, number>,
8501 thisArg?: any): number;
8502
8503 /**
8504 * @see _.sum
8505 * @param property _.property callback shorthand.
8506 **/
8507 sum<T>(
8508 collection: Array<T>,
8509 property: string): number;
8510
8511 /**
8512 * @see _.sum
8513 * @param property _.property callback shorthand.
8514 **/
8515 sum<T>(
8516 collection: List<T>,
8517 property: string): number;
8518
8519 /**
8520 * @see _.sum
8521 * @param property _.property callback shorthand.
8522 **/
8523 sum<T>(
8524 collection: Dictionary<T>,
8525 property: string): number;
8526 }
8527
8528 interface LoDashNumberArrayWrapper {
8529 /**
8530 * @see _.sum
8531 **/
8532 sum(): number;
8533
8534 /**
8535 * @see _.sum
8536 **/
8537 sum(
8538 iteratee: ListIterator<number, number>,
8539 thisArg?: any): number;
8540 }
8541
8542 interface LoDashArrayWrapper<T> {
8543 /**
8544 * @see _.sum
8545 **/
8546 sum(): number;
8547
8548 /**
8549 * @see _.sum
8550 **/
8551 sum(
8552 iteratee: ListIterator<T, number>,
8553 thisArg?: any): number;
8554
8555 /**
8556 * @see _.sum
8557 * @param property _.property callback shorthand.
8558 **/
8559 sum(
8560 property: string): number;
8561 }
8562
8563 interface LoDashObjectWrapper<T> {
8564 /**
8565 * @see _.sum
8566 **/
8567 sum(): number;
8568
8569 /**
8570 * @see _.sum
8571 **/
8572 sum(
8573 iteratee: ObjectIterator<any, number>,
8574 thisArg?: any): number;
8575
8576 /**
8577 * @see _.sum
8578 * @param property _.property callback shorthand.
8579 **/
8580 sum(
8581 property: string): number;
8582 }
8583
8584 //_.pluck
8585 interface LoDashStatic {
8586 /**
8587 * Retrieves the value of a specified property from all elements in the collection.
8588 * @param collection The collection to iterate over.
8589 * @param property The property to pluck.
8590 * @return A new array of property values.
8591 **/
8592 pluck<T extends {}>(
8593 collection: Array<T>,
8594 property: string): any[];
8595
8596 /**
8597 * @see _.pluck
8598 **/
8599 pluck<T extends {}>(
8600 collection: List<T>,
8601 property: string): any[];
8602
8603 /**
8604 * @see _.pluck
8605 **/
8606 pluck<T extends {}>(
8607 collection: Dictionary<T>,
8608 property: string): any[];
8609 }
8610
8611 interface LoDashArrayWrapper<T> {
8612 /**
8613 * @see _.pluck
8614 **/
8615 pluck<TResult>(
8616 property: string): LoDashArrayWrapper<TResult>;
8617 }
8618
8619 interface LoDashObjectWrapper<T> {
8620 /**
8621 * @see _.pluck
8622 **/
8623 pluck<TResult>(
8624 property: string): LoDashArrayWrapper<TResult>;
8625 }
8626
8627 //_.reduce
8628 interface LoDashStatic {
8629 /**
8630 * Reduces a collection to a value which is the accumulated result of running each
8631 * element in the collection through the callback, where each successive callback execution
8632 * consumes the return value of the previous execution. If accumulator is not provided the
8633 * first element of the collection will be used as the initial accumulator value. The callback
8634 * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
8635 * @param collection The collection to iterate over.
8636 * @param callback The function called per iteration.
8637 * @param accumulator Initial value of the accumulator.
8638 * @param thisArg The this binding of callback.
8639 * @return Returns the accumulated value.
8640 **/
8641 reduce<T, TResult>(
8642 collection: Array<T>,
8643 callback: MemoIterator<T, TResult>,
8644 accumulator: TResult,
8645 thisArg?: any): TResult;
8646
8647 /**
8648 * @see _.reduce
8649 **/
8650 reduce<T, TResult>(
8651 collection: List<T>,
8652 callback: MemoIterator<T, TResult>,
8653 accumulator: TResult,
8654 thisArg?: any): TResult;
8655
8656 /**
8657 * @see _.reduce
8658 **/
8659 reduce<T, TResult>(
8660 collection: Dictionary<T>,
8661 callback: MemoIterator<T, TResult>,
8662 accumulator: TResult,
8663 thisArg?: any): TResult;
8664
8665 /**
8666 * @see _.reduce
8667 **/
8668 reduce<T, TResult>(
8669 collection: Array<T>,
8670 callback: MemoIterator<T, TResult>,
8671 thisArg?: any): TResult;
8672
8673 /**
8674 * @see _.reduce
8675 **/
8676 reduce<T, TResult>(
8677 collection: List<T>,
8678 callback: MemoIterator<T, TResult>,
8679 thisArg?: any): TResult;
8680
8681 /**
8682 * @see _.reduce
8683 **/
8684 reduce<T, TResult>(
8685 collection: Dictionary<T>,
8686 callback: MemoIterator<T, TResult>,
8687 thisArg?: any): TResult;
8688
8689 /**
8690 * @see _.reduce
8691 **/
8692 inject<T, TResult>(
8693 collection: Array<T>,
8694 callback: MemoIterator<T, TResult>,
8695 accumulator: TResult,
8696 thisArg?: any): TResult;
8697
8698 /**
8699 * @see _.reduce
8700 **/
8701 inject<T, TResult>(
8702 collection: List<T>,
8703 callback: MemoIterator<T, TResult>,
8704 accumulator: TResult,
8705 thisArg?: any): TResult;
8706
8707 /**
8708 * @see _.reduce
8709 **/
8710 inject<T, TResult>(
8711 collection: Dictionary<T>,
8712 callback: MemoIterator<T, TResult>,
8713 accumulator: TResult,
8714 thisArg?: any): TResult;
8715
8716 /**
8717 * @see _.reduce
8718 **/
8719 inject<T, TResult>(
8720 collection: Array<T>,
8721 callback: MemoIterator<T, TResult>,
8722 thisArg?: any): TResult;
8723
8724 /**
8725 * @see _.reduce
8726 **/
8727 inject<T, TResult>(
8728 collection: List<T>,
8729 callback: MemoIterator<T, TResult>,
8730 thisArg?: any): TResult;
8731
8732 /**
8733 * @see _.reduce
8734 **/
8735 inject<T, TResult>(
8736 collection: Dictionary<T>,
8737 callback: MemoIterator<T, TResult>,
8738 thisArg?: any): TResult;
8739
8740 /**
8741 * @see _.reduce
8742 **/
8743 foldl<T, TResult>(
8744 collection: Array<T>,
8745 callback: MemoIterator<T, TResult>,
8746 accumulator: TResult,
8747 thisArg?: any): TResult;
8748
8749 /**
8750 * @see _.reduce
8751 **/
8752 foldl<T, TResult>(
8753 collection: List<T>,
8754 callback: MemoIterator<T, TResult>,
8755 accumulator: TResult,
8756 thisArg?: any): TResult;
8757
8758 /**
8759 * @see _.reduce
8760 **/
8761 foldl<T, TResult>(
8762 collection: Dictionary<T>,
8763 callback: MemoIterator<T, TResult>,
8764 accumulator: TResult,
8765 thisArg?: any): TResult;
8766
8767 /**
8768 * @see _.reduce
8769 **/
8770 foldl<T, TResult>(
8771 collection: Array<T>,
8772 callback: MemoIterator<T, TResult>,
8773 thisArg?: any): TResult;
8774
8775 /**
8776 * @see _.reduce
8777 **/
8778 foldl<T, TResult>(
8779 collection: List<T>,
8780 callback: MemoIterator<T, TResult>,
8781 thisArg?: any): TResult;
8782
8783 /**
8784 * @see _.reduce
8785 **/
8786 foldl<T, TResult>(
8787 collection: Dictionary<T>,
8788 callback: MemoIterator<T, TResult>,
8789 thisArg?: any): TResult;
8790 }
8791
8792 interface LoDashArrayWrapper<T> {
8793 /**
8794 * @see _.reduce
8795 **/
8796 reduce<TResult>(
8797 callback: MemoIterator<T, TResult>,
8798 accumulator: TResult,
8799 thisArg?: any): TResult;
8800
8801 /**
8802 * @see _.reduce
8803 **/
8804 reduce<TResult>(
8805 callback: MemoIterator<T, TResult>,
8806 thisArg?: any): TResult;
8807
8808 /**
8809 * @see _.reduce
8810 **/
8811 inject<TResult>(
8812 callback: MemoIterator<T, TResult>,
8813 accumulator: TResult,
8814 thisArg?: any): TResult;
8815
8816 /**
8817 * @see _.reduce
8818 **/
8819 inject<TResult>(
8820 callback: MemoIterator<T, TResult>,
8821 thisArg?: any): TResult;
8822
8823 /**
8824 * @see _.reduce
8825 **/
8826 foldl<TResult>(
8827 callback: MemoIterator<T, TResult>,
8828 accumulator: TResult,
8829 thisArg?: any): TResult;
8830
8831 /**
8832 * @see _.reduce
8833 **/
8834 foldl<TResult>(
8835 callback: MemoIterator<T, TResult>,
8836 thisArg?: any): TResult;
8837 }
8838
8839 interface LoDashObjectWrapper<T> {
8840 /**
8841 * @see _.reduce
8842 **/
8843 reduce<TValue, TResult>(
8844 callback: MemoIterator<TValue, TResult>,
8845 accumulator: TResult,
8846 thisArg?: any): TResult;
8847
8848 /**
8849 * @see _.reduce
8850 **/
8851 reduce<TValue, TResult>(
8852 callback: MemoIterator<TValue, TResult>,
8853 thisArg?: any): TResult;
8854
8855 /**
8856 * @see _.reduce
8857 **/
8858 inject<TValue, TResult>(
8859 callback: MemoIterator<TValue, TResult>,
8860 accumulator: TResult,
8861 thisArg?: any): TResult;
8862
8863 /**
8864 * @see _.reduce
8865 **/
8866 inject<TValue, TResult>(
8867 callback: MemoIterator<TValue, TResult>,
8868 thisArg?: any): TResult;
8869
8870 /**
8871 * @see _.reduce
8872 **/
8873 foldl<TValue, TResult>(
8874 callback: MemoIterator<TValue, TResult>,
8875 accumulator: TResult,
8876 thisArg?: any): TResult;
8877
8878 /**
8879 * @see _.reduce
8880 **/
8881 foldl<TValue, TResult>(
8882 callback: MemoIterator<TValue, TResult>,
8883 thisArg?: any): TResult;
8884 }
8885
8886 //_.reduceRight
8887 interface LoDashStatic {
8888 /**
8889 * This method is like _.reduce except that it iterates over elements of a collection from
8890 * right to left.
8891 * @param collection The collection to iterate over.
8892 * @param callback The function called per iteration.
8893 * @param accumulator Initial value of the accumulator.
8894 * @param thisArg The this binding of callback.
8895 * @return The accumulated value.
8896 **/
8897 reduceRight<T, TResult>(
8898 collection: Array<T>,
8899 callback: MemoIterator<T, TResult>,
8900 accumulator: TResult,
8901 thisArg?: any): TResult;
8902
8903 /**
8904 * @see _.reduceRight
8905 **/
8906 reduceRight<T, TResult>(
8907 collection: List<T>,
8908 callback: MemoIterator<T, TResult>,
8909 accumulator: TResult,
8910 thisArg?: any): TResult;
8911
8912 /**
8913 * @see _.reduceRight
8914 **/
8915 reduceRight<T, TResult>(
8916 collection: Dictionary<T>,
8917 callback: MemoIterator<T, TResult>,
8918 accumulator: TResult,
8919 thisArg?: any): TResult;
8920
8921 /**
8922 * @see _.reduceRight
8923 **/
8924 reduceRight<T, TResult>(
8925 collection: Array<T>,
8926 callback: MemoIterator<T, TResult>,
8927 thisArg?: any): TResult;
8928
8929 /**
8930 * @see _.reduceRight
8931 **/
8932 reduceRight<T, TResult>(
8933 collection: List<T>,
8934 callback: MemoIterator<T, TResult>,
8935 thisArg?: any): TResult;
8936
8937 /**
8938 * @see _.reduceRight
8939 **/
8940 reduceRight<T, TResult>(
8941 collection: Dictionary<T>,
8942 callback: MemoIterator<T, TResult>,
8943 thisArg?: any): TResult;
8944
8945 /**
8946 * @see _.reduceRight
8947 **/
8948 foldr<T, TResult>(
8949 collection: Array<T>,
8950 callback: MemoIterator<T, TResult>,
8951 accumulator: TResult,
8952 thisArg?: any): TResult;
8953
8954 /**
8955 * @see _.reduceRight
8956 **/
8957 foldr<T, TResult>(
8958 collection: List<T>,
8959 callback: MemoIterator<T, TResult>,
8960 accumulator: TResult,
8961 thisArg?: any): TResult;
8962
8963 /**
8964 * @see _.reduceRight
8965 **/
8966 foldr<T, TResult>(
8967 collection: Dictionary<T>,
8968 callback: MemoIterator<T, TResult>,
8969 accumulator: TResult,
8970 thisArg?: any): TResult;
8971
8972 /**
8973 * @see _.reduceRight
8974 **/
8975 foldr<T, TResult>(
8976 collection: Array<T>,
8977 callback: MemoIterator<T, TResult>,
8978 thisArg?: any): TResult;
8979
8980 /**
8981 * @see _.reduceRight
8982 **/
8983 foldr<T, TResult>(
8984 collection: List<T>,
8985 callback: MemoIterator<T, TResult>,
8986 thisArg?: any): TResult;
8987
8988 /**
8989 * @see _.reduceRight
8990 **/
8991 foldr<T, TResult>(
8992 collection: Dictionary<T>,
8993 callback: MemoIterator<T, TResult>,
8994 thisArg?: any): TResult;
8995 }
8996
8997 //_.reject
8998 interface LoDashStatic {
8999 /**
9000 * The opposite of _.filter this method returns the elements of a collection that
9001 * the callback does not return truey for.
9002 *
9003 * If a property name is provided for callback the created "_.pluck" style callback
9004 * will return the property value of the given element.
9005 *
9006 * If an object is provided for callback the created "_.where" style callback will
9007 * return true for elements that have the properties of the given object, else false.
9008 * @param collection The collection to iterate over.
9009 * @param callback The function called per iteration.
9010 * @param thisArg The this binding of callback.
9011 * @return A new array of elements that failed the callback check.
9012 **/
9013 reject<T>(
9014 collection: Array<T>,
9015 callback: ListIterator<T, boolean>,
9016 thisArg?: any): T[];
9017
9018 /**
9019 * @see _.reject
9020 **/
9021 reject<T>(
9022 collection: List<T>,
9023 callback: ListIterator<T, boolean>,
9024 thisArg?: any): T[];
9025
9026 /**
9027 * @see _.reject
9028 **/
9029 reject<T>(
9030 collection: Dictionary<T>,
9031 callback: ListIterator<T, boolean>,
9032 thisArg?: any): T[];
9033
9034 /**
9035 * @see _.reject
9036 * @param pluckValue _.pluck style callback
9037 **/
9038 reject<T>(
9039 collection: Array<T>,
9040 pluckValue: string): T[];
9041
9042 /**
9043 * @see _.reject
9044 * @param pluckValue _.pluck style callback
9045 **/
9046 reject<T>(
9047 collection: List<T>,
9048 pluckValue: string): T[];
9049
9050 /**
9051 * @see _.reject
9052 * @param pluckValue _.pluck style callback
9053 **/
9054 reject<T>(
9055 collection: Dictionary<T>,
9056 pluckValue: string): T[];
9057
9058 /**
9059 * @see _.reject
9060 * @param whereValue _.where style callback
9061 **/
9062 reject<W, T>(
9063 collection: Array<T>,
9064 whereValue: W): T[];
9065
9066 /**
9067 * @see _.reject
9068 * @param whereValue _.where style callback
9069 **/
9070 reject<W, T>(
9071 collection: List<T>,
9072 whereValue: W): T[];
9073
9074 /**
9075 * @see _.reject
9076 * @param whereValue _.where style callback
9077 **/
9078 reject<W, T>(
9079 collection: Dictionary<T>,
9080 whereValue: W): T[];
9081 }
9082
9083 interface LoDashArrayWrapper<T> {
9084 /**
9085 * @see _.reject
9086 **/
9087 reject(
9088 callback: ListIterator<T, boolean>,
9089 thisArg?: any): LoDashArrayWrapper<T>;
9090
9091 /**
9092 * @see _.reject
9093 * @param pluckValue _.pluck style callback
9094 **/
9095 reject(pluckValue: string): LoDashArrayWrapper<T>;
9096
9097 /**
9098 * @see _.reject
9099 * @param whereValue _.where style callback
9100 **/
9101 reject<W>(whereValue: W): LoDashArrayWrapper<T>;
9102 }
9103
9104 //_.sample
9105 interface LoDashStatic {
9106 /**
9107 * Retrieves a random element or n random elements from a collection.
9108 * @param collection The collection to sample.
9109 * @return Returns the random sample(s) of collection.
9110 **/
9111 sample<T>(collection: Array<T>): T;
9112
9113 /**
9114 * @see _.sample
9115 **/
9116 sample<T>(collection: List<T>): T;
9117
9118 /**
9119 * @see _.sample
9120 **/
9121 sample<T>(collection: Dictionary<T>): T;
9122
9123 /**
9124 * @see _.sample
9125 * @param n The number of elements to sample.
9126 **/
9127 sample<T>(collection: Array<T>, n: number): T[];
9128
9129 /**
9130 * @see _.sample
9131 * @param n The number of elements to sample.
9132 **/
9133 sample<T>(collection: List<T>, n: number): T[];
9134
9135 /**
9136 * @see _.sample
9137 * @param n The number of elements to sample.
9138 **/
9139 sample<T>(collection: Dictionary<T>, n: number): T[];
9140 }
9141
9142 //_.shuffle
9143 interface LoDashStatic {
9144 /**
9145 * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.
9146 * See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
9147 * @param collection The collection to shuffle.
9148 * @return Returns a new shuffled collection.
9149 **/
9150 shuffle<T>(collection: Array<T>): T[];
9151
9152 /**
9153 * @see _.shuffle
9154 **/
9155 shuffle<T>(collection: List<T>): T[];
9156
9157 /**
9158 * @see _.shuffle
9159 **/
9160 shuffle<T>(collection: Dictionary<T>): T[];
9161 }
9162
9163 //_.size
9164 interface LoDashStatic {
9165 /**
9166 * Gets the size of the collection by returning collection.length for arrays and array-like
9167 * objects or the number of own enumerable properties for objects.
9168 * @param collection The collection to inspect.
9169 * @return collection.length
9170 **/
9171 size<T>(collection: Array<T>): number;
9172
9173 /**
9174 * @see _.size
9175 **/
9176 size<T>(collection: List<T>): number;
9177
9178 /**
9179 * @see _.size
9180 * @param object The object to inspect
9181 * @return The number of own enumerable properties.
9182 **/
9183 size<T extends {}>(object: T): number;
9184
9185 /**
9186 * @see _.size
9187 * @param aString The string to inspect
9188 * @return The length of aString
9189 **/
9190 size(aString: string): number;
9191 }
9192
9193 //_.some
9194 interface LoDashStatic {
9195 /**
9196 * Checks if the callback returns a truey value for any element of a collection. The function
9197 * returns as soon as it finds a passing value and does not iterate over the entire collection.
9198 * The callback is bound to thisArg and invoked with three arguments; (value, index|key, collection).
9199 *
9200 * If a property name is provided for callback the created "_.pluck" style callback will return
9201 * the property value of the given element.
9202 *
9203 * If an object is provided for callback the created "_.where" style callback will return true for
9204 * elements that have the properties of the given object, else false.
9205 * @param collection The collection to iterate over.
9206 * @param callback The function called per iteration.
9207 * @param thisArg The this binding of callback.
9208 * @return True if any element passed the callback check, else false.
9209 **/
9210 some<T>(
9211 collection: Array<T>,
9212 callback?: ListIterator<T, boolean>,
9213 thisArg?: any): boolean;
9214
9215 /**
9216 * @see _.some
9217 **/
9218 some<T>(
9219 collection: List<T>,
9220 callback?: ListIterator<T, boolean>,
9221 thisArg?: any): boolean;
9222
9223 /**
9224 * @see _.some
9225 **/
9226 some<T>(
9227 collection: Dictionary<T>,
9228 callback?: ListIterator<T, boolean>,
9229 thisArg?: any): boolean;
9230
9231 /**
9232 * @see _.some
9233 **/
9234 some(
9235 collection: {},
9236 callback?: ListIterator<{}, boolean>,
9237 thisArg?: any): boolean;
9238
9239 /**
9240 * @see _.some
9241 * @param pluckValue _.pluck style callback
9242 **/
9243 some<T>(
9244 collection: Array<T>,
9245 pluckValue: string): boolean;
9246
9247 /**
9248 * @see _.some
9249 * @param pluckValue _.pluck style callback
9250 **/
9251 some<T>(
9252 collection: List<T>,
9253 pluckValue: string): boolean;
9254
9255 /**
9256 * @see _.some
9257 * @param pluckValue _.pluck style callback
9258 **/
9259 some<T>(
9260 collection: Dictionary<T>,
9261 pluckValue: string): boolean;
9262
9263 /**
9264 * @see _.some
9265 * @param whereValue _.where style callback
9266 **/
9267 some<W, T>(
9268 collection: Array<T>,
9269 whereValue: W): boolean;
9270
9271 /**
9272 * @see _.some
9273 * @param whereValue _.where style callback
9274 **/
9275 some<W, T>(
9276 collection: List<T>,
9277 whereValue: W): boolean;
9278
9279 /**
9280 * @see _.some
9281 * @param whereValue _.where style callback
9282 **/
9283 some<W, T>(
9284 collection: Dictionary<T>,
9285 whereValue: W): boolean;
9286
9287 /**
9288 * @see _.some
9289 **/
9290 any<T>(
9291 collection: Array<T>,
9292 callback?: ListIterator<T, boolean>,
9293 thisArg?: any): boolean;
9294
9295 /**
9296 * @see _.some
9297 **/
9298 any<T>(
9299 collection: List<T>,
9300 callback?: ListIterator<T, boolean>,
9301 thisArg?: any): boolean;
9302
9303 /**
9304 * @see _.some
9305 **/
9306 any<T>(
9307 collection: Dictionary<T>,
9308 callback?: ListIterator<T, boolean>,
9309 thisArg?: any): boolean;
9310
9311 /**
9312 * @see _.some
9313 **/
9314 any(
9315 collection: {},
9316 callback?: ListIterator<{}, boolean>,
9317 thisArg?: any): boolean;
9318
9319 /**
9320 * @see _.some
9321 * @param pluckValue _.pluck style callback
9322 **/
9323 any<T>(
9324 collection: Array<T>,
9325 pluckValue: string): boolean;
9326
9327 /**
9328 * @see _.some
9329 * @param pluckValue _.pluck style callback
9330 **/
9331 any<T>(
9332 collection: List<T>,
9333 pluckValue: string): boolean;
9334
9335 /**
9336 * @see _.some
9337 * @param pluckValue _.pluck style callback
9338 **/
9339 any<T>(
9340 collection: Dictionary<T>,
9341 pluckValue: string): boolean;
9342
9343 /**
9344 * @see _.some
9345 * @param whereValue _.where style callback
9346 **/
9347 any<W, T>(
9348 collection: Array<T>,
9349 whereValue: W): boolean;
9350
9351 /**
9352 * @see _.some
9353 * @param whereValue _.where style callback
9354 **/
9355 any<W, T>(
9356 collection: List<T>,
9357 whereValue: W): boolean;
9358
9359 /**
9360 * @see _.some
9361 * @param whereValue _.where style callback
9362 **/
9363 any<W, T>(
9364 collection: Dictionary<T>,
9365 whereValue: W): boolean;
9366 }
9367
9368 //_.sortBy
9369 interface LoDashStatic {
9370 /**
9371 * Creates an array of elements, sorted in ascending order by the results of running each
9372 * element in a collection through the callback. This method performs a stable sort, that
9373 * is, it will preserve the original sort order of equal elements. The callback is bound
9374 * to thisArg and invoked with three arguments; (value, index|key, collection).
9375 *
9376 * If a property name is provided for callback the created "_.pluck" style callback will
9377 * return the property value of the given element.
9378 *
9379 * If an object is provided for callback the created "_.where" style callback will return
9380 * true for elements that have the properties of the given object, else false.
9381 * @param collection The collection to iterate over.
9382 * @param callback The function called per iteration.
9383 * @param thisArg The this binding of callback.
9384 * @return A new array of sorted elements.
9385 **/
9386 sortBy<T, TSort>(
9387 collection: Array<T>,
9388 callback?: ListIterator<T, TSort>,
9389 thisArg?: any): T[];
9390
9391 /**
9392 * @see _.sortBy
9393 **/
9394 sortBy<T, TSort>(
9395 collection: List<T>,
9396 callback?: ListIterator<T, TSort>,
9397 thisArg?: any): T[];
9398
9399 /**
9400 * @see _.sortBy
9401 * @param pluckValue _.pluck style callback
9402 **/
9403 sortBy<T>(
9404 collection: Array<T>,
9405 pluckValue: string): T[];
9406
9407 /**
9408 * @see _.sortBy
9409 * @param pluckValue _.pluck style callback
9410 **/
9411 sortBy<T>(
9412 collection: List<T>,
9413 pluckValue: string): T[];
9414
9415 /**
9416 * @see _.sortBy
9417 * @param whereValue _.where style callback
9418 **/
9419 sortBy<W, T>(
9420 collection: Array<T>,
9421 whereValue: W): T[];
9422
9423 /**
9424 * @see _.sortBy
9425 * @param whereValue _.where style callback
9426 **/
9427 sortBy<W, T>(
9428 collection: List<T>,
9429 whereValue: W): T[];
9430 }
9431
9432 interface LoDashArrayWrapper<T> {
9433 /**
9434 * @see _.sortBy
9435 **/
9436 sortBy<TSort>(
9437 callback?: ListIterator<T, TSort>,
9438 thisArg?: any): LoDashArrayWrapper<T>;
9439
9440 /**
9441 * @see _.sortBy
9442 * @param pluckValue _.pluck style callback
9443 **/
9444 sortBy(pluckValue: string): LoDashArrayWrapper<T>;
9445
9446 /**
9447 * @see _.sortBy
9448 * @param whereValue _.where style callback
9449 **/
9450 sortBy<W>(whereValue: W): LoDashArrayWrapper<T>;
9451 }
9452
9453 //_.toArray
9454 interface LoDashStatic {
9455 /**
9456 * Converts the collection to an array.
9457 * @param collection The collection to convert.
9458 * @return The new converted array.
9459 **/
9460 toArray<T>(collection: Array<T>): T[];
9461
9462 /**
9463 * @see _.toArray
9464 **/
9465 toArray<T>(collection: List<T>): T[];
9466
9467 /**
9468 * @see _.toArray
9469 **/
9470 toArray<T>(collection: Dictionary<T>): T[];
9471 }
9472
9473 interface LoDashArrayWrapper<T> {
9474 /**
9475 * @see _.toArray
9476 **/
9477 toArray(): LoDashArrayWrapper<T>;
9478 }
9479
9480 interface LoDashObjectWrapper<T> {
9481 /**
9482 * @see _.toArray
9483 **/
9484 toArray<TValue>(): LoDashArrayWrapper<TValue>;
9485 }
9486
9487 //_.toPlainObject
9488 interface LoDashStatic {
9489 /**
9490 * Converts value to a plain object flattening inherited enumerable properties of value to own properties
9491 * of the plain object.
9492 *
9493 * @param value The value to convert.
9494 * @return Returns the converted plain object.
9495 */
9496 toPlainObject<TResult extends {}>(value?: any): TResult;
9497 }
9498
9499 //_.where
9500 interface LoDashStatic {
9501 /**
9502 * Performs a deep comparison of each element in a collection to the given properties
9503 * object, returning an array of all elements that have equivalent property values.
9504 * @param collection The collection to iterate over.
9505 * @param properties The object of property values to filter by.
9506 * @return A new array of elements that have the given properties.
9507 **/
9508 where<T, U extends {}>(
9509 list: Array<T>,
9510 properties: U): T[];
9511
9512 /**
9513 * @see _.where
9514 **/
9515 where<T, U extends {}>(
9516 list: List<T>,
9517 properties: U): T[];
9518
9519 /**
9520 * @see _.where
9521 **/
9522 where<T, U extends {}>(
9523 list: Dictionary<T>,
9524 properties: U): T[];
9525 }
9526
9527 interface LoDashArrayWrapper<T> {
9528 /**
9529 * @see _.where
9530 **/
9531 where<T, U extends {}>(properties: U): LoDashArrayWrapper<T>;
9532 }
9533
9534 /*************
9535 * Functions *
9536 *************/
9537
9538 //_.after
9539 interface LoDashStatic {
9540 /**
9541 * Creates a function that executes func, with the this binding and arguments of the
9542 * created function, only after being called n times.
9543 * @param n The number of times the function must be called before func is executed.
9544 * @param func The function to restrict.
9545 * @return The new restricted function.
9546 **/
9547 after(
9548 n: number,
9549 func: Function): Function;
9550 }
9551
9552 interface LoDashWrapper<T> {
9553 /**
9554 * @see _.after
9555 **/
9556 after(func: Function): LoDashObjectWrapper<Function>;
9557 }
9558
9559 //_.bind
9560 interface LoDashStatic {
9561 /**
9562 * Creates a function that, when called, invokes func with the this binding of thisArg
9563 * and prepends any additional bind arguments to those provided to the bound function.
9564 * @param func The function to bind.
9565 * @param thisArg The this binding of func.
9566 * @param args Arguments to be partially applied.
9567 * @return The new bound function.
9568 **/
9569 bind(
9570 func: Function,
9571 thisArg: any,
9572 ...args: any[]): () => any;
9573 }
9574
9575 interface LoDashObjectWrapper<T> {
9576 /**
9577 * @see _.bind
9578 **/
9579 bind(
9580 thisArg: any,
9581 ...args: any[]): LoDashObjectWrapper<() => any>;
9582 }
9583
9584 //_.bindAll
9585 interface LoDashStatic {
9586 /**
9587 * Binds methods of an object to the object itself, overwriting the existing method. Method
9588 * names may be specified as individual arguments or as arrays of method names. If no method
9589 * names are provided all the function properties of object will be bound.
9590 * @param object The object to bind and assign the bound methods to.
9591 * @param methodNames The object method names to bind, specified as individual method names
9592 * or arrays of method names.
9593 * @return object
9594 **/
9595 bindAll<T>(
9596 object: T,
9597 ...methodNames: string[]): T;
9598 }
9599
9600 interface LoDashObjectWrapper<T> {
9601 /**
9602 * @see _.bindAll
9603 **/
9604 bindAll(...methodNames: string[]): LoDashWrapper<T>;
9605 }
9606
9607 //_.bindKey
9608 interface LoDashStatic {
9609 /**
9610 * Creates a function that, when called, invokes the method at object[key] and prepends any
9611 * additional bindKey arguments to those provided to the bound function. This method differs
9612 * from _.bind by allowing bound functions to reference methods that will be redefined or don't
9613 * yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern.
9614 * @param object The object the method belongs to.
9615 * @param key The key of the method.
9616 * @param args Arguments to be partially applied.
9617 * @return The new bound function.
9618 **/
9619 bindKey<T>(
9620 object: T,
9621 key: string,
9622 ...args: any[]): Function;
9623 }
9624
9625 interface LoDashObjectWrapper<T> {
9626 /**
9627 * @see _.bindKey
9628 **/
9629 bindKey(
9630 key: string,
9631 ...args: any[]): LoDashObjectWrapper<Function>;
9632 }
9633
9634 //_.compose
9635 interface LoDashStatic {
9636 /**
9637 * Creates a function that is the composition of the provided functions, where each function
9638 * consumes the return value of the function that follows. For example, composing the functions
9639 * f(), g(), and h() produces f(g(h())). Each function is executed with the this binding of the
9640 * composed function.
9641 * @param funcs Functions to compose.
9642 * @return The new composed function.
9643 **/
9644 compose(...funcs: Function[]): Function;
9645 }
9646
9647 interface LoDashObjectWrapper<T> {
9648 /**
9649 * @see _.compose
9650 **/
9651 compose(...funcs: Function[]): LoDashObjectWrapper<Function>;
9652 }
9653
9654 //_.createCallback
9655 interface LoDashStatic {
9656 /**
9657 * Produces a callback bound to an optional thisArg. If func is a property name the created
9658 * callback will return the property value for a given element. If func is an object the created
9659 * callback will return true for elements that contain the equivalent object properties,
9660 * otherwise it will return false.
9661 * @param func The value to convert to a callback.
9662 * @param thisArg The this binding of the created callback.
9663 * @param argCount The number of arguments the callback accepts.
9664 * @return A callback function.
9665 **/
9666 createCallback(
9667 func: string,
9668 thisArg?: any,
9669 argCount?: number): () => any;
9670
9671 /**
9672 * @see _.createCallback
9673 **/
9674 createCallback(
9675 func: Dictionary<any>,
9676 thisArg?: any,
9677 argCount?: number): () => boolean;
9678 }
9679
9680 interface LoDashWrapper<T> {
9681 /**
9682 * @see _.createCallback
9683 **/
9684 createCallback(
9685 thisArg?: any,
9686 argCount?: number): LoDashObjectWrapper<() => any>;
9687 }
9688
9689 interface LoDashObjectWrapper<T> {
9690 /**
9691 * @see _.createCallback
9692 **/
9693 createCallback(
9694 thisArg?: any,
9695 argCount?: number): LoDashObjectWrapper<() => any>;
9696 }
9697
9698 //_.curry
9699 interface LoDashStatic {
9700 /**
9701 * Creates a function which accepts one or more arguments of func that when invoked either
9702 * executes func returning its result, if all func arguments have been provided, or returns
9703 * a function that accepts one or more of the remaining func arguments, and so on. The arity
9704 * of func can be specified if func.length is not sufficient.
9705 * @param func The function to curry.
9706 * @param arity The arity of func.
9707 * @return The new curried function.
9708 **/
9709 curry(
9710 func: Function,
9711 arity?: number): Function;
9712 }
9713
9714 interface LoDashObjectWrapper<T> {
9715 /**
9716 * @see _.curry
9717 **/
9718 curry(arity?: number): LoDashObjectWrapper<Function>;
9719 }
9720
9721 //_.debounce
9722 interface LoDashStatic {
9723 /**
9724 * Creates a function that will delay the execution of func until after wait milliseconds have
9725 * elapsed since the last time it was invoked. Provide an options object to indicate that func
9726 * should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls
9727 * to the debounced function will return the result of the last func call.
9728 *
9729 * Note: If leading and trailing options are true func will be called on the trailing edge of
9730 * the timeout only if the the debounced function is invoked more than once during the wait
9731 * timeout.
9732 * @param func The function to debounce.
9733 * @param wait The number of milliseconds to delay.
9734 * @param options The options object.
9735 * @param options.leading Specify execution on the leading edge of the timeout.
9736 * @param options.maxWait The maximum time func is allowed to be delayed before it’s called.
9737 * @param options.trailing Specify execution on the trailing edge of the timeout.
9738 * @return The new debounced function.
9739 **/
9740 debounce<T extends Function>(
9741 func: T,
9742 wait: number,
9743 options?: DebounceSettings): T;
9744 }
9745
9746 interface LoDashObjectWrapper<T> {
9747 /**
9748 * @see _.debounce
9749 **/
9750 debounce(
9751 wait: number,
9752 options?: DebounceSettings): LoDashObjectWrapper<Function>;
9753 }
9754
9755 interface DebounceSettings {
9756 /**
9757 * Specify execution on the leading edge of the timeout.
9758 **/
9759 leading?: boolean;
9760
9761 /**
9762 * The maximum time func is allowed to be delayed before it’s called.
9763 **/
9764 maxWait?: number;
9765
9766 /**
9767 * Specify execution on the trailing edge of the timeout.
9768 **/
9769 trailing?: boolean;
9770 }
9771
9772 //_.defer
9773 interface LoDashStatic {
9774 /**
9775 * Defers executing the func function until the current call stack has cleared. Additional
9776 * arguments will be provided to func when it is invoked.
9777 * @param func The function to defer.
9778 * @param args Arguments to invoke the function with.
9779 * @return The timer id.
9780 **/
9781 defer(
9782 func: Function,
9783 ...args: any[]): number;
9784 }
9785
9786 interface LoDashObjectWrapper<T> {
9787 /**
9788 * @see _.defer
9789 **/
9790 defer(...args: any[]): LoDashWrapper<number>;
9791 }
9792
9793 //_.delay
9794 interface LoDashStatic {
9795 /**
9796 * Executes the func function after wait milliseconds. Additional arguments will be provided
9797 * to func when it is invoked.
9798 * @param func The function to delay.
9799 * @param wait The number of milliseconds to delay execution.
9800 * @param args Arguments to invoke the function with.
9801 * @return The timer id.
9802 **/
9803 delay(
9804 func: Function,
9805 wait: number,
9806 ...args: any[]): number;
9807 }
9808
9809 interface LoDashObjectWrapper<T> {
9810 /**
9811 * @see _.delay
9812 **/
9813 delay(
9814 wait: number,
9815 ...args: any[]): LoDashWrapper<number>;
9816 }
9817
9818 //_.memoize
9819 interface LoDashStatic {
9820 /**
9821 * Creates a function that memoizes the result of func. If resolver is provided it will be
9822 * used to determine the cache key for storing the result based on the arguments provided to
9823 * the memoized function. By default, the first argument provided to the memoized function is
9824 * used as the cache key. The func is executed with the this binding of the memoized function.
9825 * The result cache is exposed as the cache property on the memoized function.
9826 * @param func Computationally expensive function that will now memoized results.
9827 * @param resolver Hash function for storing the result of `fn`.
9828 * @return Returns the new memoizing function.
9829 **/
9830 memoize<T extends Function>(
9831 func: T,
9832 resolver?: Function): T;
9833 }
9834
9835 //_.once
9836 interface LoDashStatic {
9837 /**
9838 * Creates a function that is restricted to execute func once. Repeat calls to the function
9839 * will return the value of the first call. The func is executed with the this binding of the
9840 * created function.
9841 * @param func Function to only execute once.
9842 * @return The new restricted function.
9843 **/
9844 once<T extends Function>(func: T): T;
9845 }
9846
9847 //_.partial
9848 interface LoDashStatic {
9849 /**
9850 * Creates a function that, when called, invokes func with any additional partial arguments
9851 * prepended to those provided to the new function. This method is similar to _.bind except
9852 * it does not alter the this binding.
9853 * @param func The function to partially apply arguments to.
9854 * @param args Arguments to be partially applied.
9855 * @return The new partially applied function.
9856 **/
9857 partial(
9858 func: Function,
9859 ...args: any[]): Function;
9860 }
9861
9862 //_.partialRight
9863 interface LoDashStatic {
9864 /**
9865 * This method is like _.partial except that partial arguments are appended to those provided
9866 * to the new function.
9867 * @param func The function to partially apply arguments to.
9868 * @param args Arguments to be partially applied.
9869 * @return The new partially applied function.
9870 **/
9871 partialRight(
9872 func: Function,
9873 ...args: any[]): Function;
9874 }
9875
9876 //_.throttle
9877 interface LoDashStatic {
9878 /**
9879 * Creates a function that, when executed, will only call the func function at most once per
9880 * every wait milliseconds. Provide an options object to indicate that func should be invoked
9881 * on the leading and/or trailing edge of the wait timeout. Subsequent calls to the throttled
9882 * function will return the result of the last func call.
9883 *
9884 * Note: If leading and trailing options are true func will be called on the trailing edge of
9885 * the timeout only if the the throttled function is invoked more than once during the wait timeout.
9886 * @param func The function to throttle.
9887 * @param wait The number of milliseconds to throttle executions to.
9888 * @param options The options object.
9889 * @param options.leading Specify execution on the leading edge of the timeout.
9890 * @param options.trailing Specify execution on the trailing edge of the timeout.
9891 * @return The new throttled function.
9892 **/
9893 throttle<T extends Function>(
9894 func: T,
9895 wait: number,
9896 options?: ThrottleSettings): T;
9897 }
9898
9899 interface ThrottleSettings {
9900
9901 /**
9902 * If you'd like to disable the leading-edge call, pass this as false.
9903 **/
9904 leading?: boolean;
9905
9906 /**
9907 * If you'd like to disable the execution on the trailing-edge, pass false.
9908 **/
9909 trailing?: boolean;
9910 }
9911
9912 //_.wrap
9913 interface LoDashStatic {
9914 /**
9915 * Creates a function that provides value to the wrapper function as its first argument.
9916 * Additional arguments provided to the function are appended to those provided to the
9917 * wrapper function. The wrapper is executed with the this binding of the created function.
9918 * @param value The value to wrap.
9919 * @param wrapper The wrapper function.
9920 * @return The new function.
9921 **/
9922 wrap(
9923 value: any,
9924 wrapper: (func: Function, ...args: any[]) => any): Function;
9925 }
9926
9927 /*************
9928 * Objects *
9929 *************/
9930
9931 //_.assign
9932 interface LoDashStatic {
9933 /**
9934 * Assigns own enumerable properties of source object(s) to the destination object. Subsequent
9935 * sources will overwrite property assignments of previous sources. If a callback is provided
9936 * it will be executed to produce the assigned values. The callback is bound to thisArg and
9937 * invoked with two arguments; (objectValue, sourceValue).
9938 * @param object The destination object.
9939 * @param s1-8 The source object(s)
9940 * @param callback The function to customize merging properties.
9941 * @param thisArg The this binding of callback.
9942 * @return The destination object.
9943 **/
9944 assign<P, T, S1, Value, Result>(
9945 object: T,
9946 s1: S1,
9947 callback?: (objectValue: Value, sourceValue: Value) => Value,
9948 thisArg?: any): Result;
9949
9950 /**
9951 * @see _.assign
9952 **/
9953 assign<P, T, S1, S2, Value, Result>(
9954 object: T,
9955 s1: S1,
9956 s2: S2,
9957 callback?: (objectValue: Value, sourceValue: Value) => Value,
9958 thisArg?: any): Result;
9959
9960 /**
9961 * @see _.assign
9962 **/
9963 assign<P, T, S1, S2, S3, Value, Result>(
9964 object: T,
9965 s1: S1,
9966 s2: S2,
9967 s3: S3,
9968 callback?: (objectValue: Value, sourceValue: Value) => Value,
9969 thisArg?: any): Result;
9970
9971 /**
9972 * @see _.assign
9973 **/
9974 assign<P, T, S1, S2, S3, S4, Value, Result>(
9975 object: T,
9976 s1: S1,
9977 s2: S2,
9978 s3: S3,
9979 s4: S4,
9980 callback?: (objectValue: Value, sourceValue: Value) => Value,
9981 thisArg?: any): Result;
9982
9983 /**
9984 * @see _.assign
9985 **/
9986 extend<P, T, S1, Value, Result>(
9987 object: T,
9988 s1: S1,
9989 callback?: (objectValue: Value, sourceValue: Value) => Value,
9990 thisArg?: any): Result;
9991
9992 /**
9993 * @see _.assign
9994 **/
9995 extend<P, T, S1, S2, Value, Result>(
9996 object: T,
9997 s1: S1,
9998 s2: S2,
9999 callback?: (objectValue: Value, sourceValue: Value) => Value,
10000 thisArg?: any): Result;
10001
10002 /**
10003 * @see _.assign
10004 **/
10005 extend<P, T, S1, S2, S3, Value, Result>(
10006 object: T,
10007 s1: S1,
10008 s2: S2,
10009 s3: S3,
10010 callback?: (objectValue: Value, sourceValue: Value) => Value,
10011 thisArg?: any): Result;
10012
10013 /**
10014 * @see _.assign
10015 **/
10016 extend<P, T, S1, S2, S3, S4, Value, Result>(
10017 object: T,
10018 s1: S1,
10019 s2: S2,
10020 s3: S3,
10021 s4: S4,
10022 callback?: (objectValue: Value, sourceValue: Value) => Value,
10023 thisArg?: any): Result;
10024 }
10025
10026 interface LoDashObjectWrapper<T> {
10027 /**
10028 * @see _.assign
10029 **/
10030 assign<S1, Value, TResult>(
10031 s1: S1,
10032 callback?: (objectValue: Value, sourceValue: Value) => Value,
10033 thisArg?: any): TResult;
10034
10035 /**
10036 * @see _.assign
10037 **/
10038 assign<S1, S2, Value, TResult>(
10039 s1: S1,
10040 s2: S2,
10041 callback?: (objectValue: Value, sourceValue: Value) => Value,
10042 thisArg?: any): TResult;
10043 /**
10044 * @see _.assign
10045 **/
10046 assign<S1, S2, S3, Value, TResult>(
10047 s1: S1,
10048 s2: S2,
10049 s3: S3,
10050 callback?: (objectValue: Value, sourceValue: Value) => Value,
10051 thisArg?: any): TResult;
10052 /**
10053 * @see _.assign
10054 **/
10055 assign<S1, S2, S3, S4, Value, TResult>(
10056 s1: S1,
10057 s2: S2,
10058 s3: S3,
10059 s4: S4,
10060 callback?: (objectValue: Value, sourceValue: Value) => Value,
10061 thisArg?: any): TResult;
10062 /**
10063 * @see _.assign
10064 **/
10065 assign<S1, S2, S3, S4, S5, Value, TResult>(
10066 s1: S1,
10067 s2: S2,
10068 s3: S3,
10069 s4: S4,
10070 s5: S5,
10071 callback?: (objectValue: Value, sourceValue: Value) => Value,
10072 thisArg?: any): TResult;
10073
10074 /**
10075 * @see _.assign
10076 **/
10077 extend<S1, Value, TResult>(
10078 s1: S1,
10079 callback?: (objectValue: Value, sourceValue: Value) => Value,
10080 thisArg?: any): TResult;
10081
10082 /**
10083 * @see _.assign
10084 **/
10085 extend<S1, S2, Value, TResult>(
10086 s1: S1,
10087 s2: S2,
10088 callback?: (objectValue: Value, sourceValue: Value) => Value,
10089 thisArg?: any): TResult;
10090 /**
10091 * @see _.assign
10092 **/
10093 extend<S1, S2, S3, Value, TResult>(
10094 s1: S1,
10095 s2: S2,
10096 s3: S3,
10097 callback?: (objectValue: Value, sourceValue: Value) => Value,
10098 thisArg?: any): TResult;
10099 /**
10100 * @see _.assign
10101 **/
10102 extend<S1, S2, S3, S4, Value, TResult>(
10103 s1: S1,
10104 s2: S2,
10105 s3: S3,
10106 s4: S4,
10107 callback?: (objectValue: Value, sourceValue: Value) => Value,
10108 thisArg?: any): TResult;
10109 /**
10110 * @see _.assign
10111 **/
10112 extend<S1, S2, S3, S4, S5, Value, TResult>(
10113 s1: S1,
10114 s2: S2,
10115 s3: S3,
10116 s4: S4,
10117 s5: S5,
10118 callback?: (objectValue: Value, sourceValue: Value) => Value,
10119 thisArg?: any): TResult;
10120
10121 }
10122
10123 //_.clone
10124 interface LoDashStatic {
10125 /**
10126 * Creates a clone of value. If deep is true nested objects will also be cloned, otherwise
10127 * they will be assigned by reference. If a callback is provided it will be executed to produce
10128 * the cloned values. If the callback returns undefined cloning will be handled by the method
10129 * instead. The callback is bound to thisArg and invoked with one argument; (value).
10130 * @param value The value to clone.
10131 * @param deep Specify a deep clone.
10132 * @param callback The function to customize cloning values.
10133 * @param thisArg The this binding of callback.
10134 * @return The cloned value.
10135 **/
10136 clone<T>(
10137 value: T,
10138 deep?: boolean,
10139 callback?: (value: any) => any,
10140 thisArg?: any): T;
10141 }
10142
10143 //_.cloneDeep
10144 interface LoDashStatic {
10145 /**
10146 * Creates a deep clone of value. If a callback is provided it will be executed to produce the
10147 * cloned values. If the callback returns undefined cloning will be handled by the method instead.
10148 * The callback is bound to thisArg and invoked with one argument; (value).
10149 *
10150 * Note: This method is loosely based on the structured clone algorithm. Functions and DOM nodes
10151 * are not cloned. The enumerable properties of arguments objects and objects created by constructors
10152 * other than Object are cloned to plain Object objects.
10153 * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm.
10154 * @param value The value to clone.
10155 * @param callback The function to customize cloning values.
10156 * @param thisArg The this binding of callback.
10157 * @return The cloned value.
10158 **/
10159 cloneDeep<T>(
10160 value: T,
10161 callback?: (value: any) => any,
10162 thisArg?: any): T;
10163 }
10164
10165 //_.defaults
10166 interface LoDashStatic {
10167 /**
10168 * Assigns own enumerable properties of source object(s) to the destination object for all
10169 * destination properties that resolve to undefined. Once a property is set, additional defaults
10170 * of the same property will be ignored.
10171 * @param object The destination object.
10172 * @param sources The source objects.
10173 * @return The destination object.
10174 **/
10175 defaults<T, TResult>(
10176 object: T,
10177 ...sources: any[]): TResult;
10178 }
10179
10180 interface LoDashObjectWrapper<T> {
10181 /**
10182 * @see _.defaults
10183 **/
10184 defaults<T, TResult>(...sources: any[]): LoDashObjectWrapper<TResult>
10185 }
10186
10187 //_.findKey
10188 interface LoDashStatic {
10189 /**
10190 * This method is like _.findIndex except that it returns the key of the first element that
10191 * passes the callback check, instead of the element itself.
10192 * @param object The object to search.
10193 * @param callback The function called per iteration.
10194 * @param thisArg The this binding of callback.
10195 * @return The key of the found element, else undefined.
10196 **/
10197 findKey(
10198 object: any,
10199 callback: (value: any) => boolean,
10200 thisArg?: any): string;
10201
10202 /**
10203 * @see _.findKey
10204 * @param pluckValue _.pluck style callback
10205 **/
10206 findKey(
10207 object: any,
10208 pluckValue: string): string;
10209
10210 /**
10211 * @see _.findKey
10212 * @param whereValue _.where style callback
10213 **/
10214 findKey<W extends Dictionary<any>, T>(
10215 object: T,
10216 whereValue: W): string;
10217 }
10218
10219 //_.findLastKey
10220 interface LoDashStatic {
10221 /**
10222 * This method is like _.findKey except that it iterates over elements of a collection in the opposite order.
10223 * @param object The object to search.
10224 * @param callback The function called per iteration.
10225 * @param thisArg The this binding of callback.
10226 * @return The key of the found element, else undefined.
10227 **/
10228 findLastKey(
10229 object: any,
10230 callback: (value: any) => boolean,
10231 thisArg?: any): string;
10232
10233 /**
10234 * @see _.findLastKey
10235 * @param pluckValue _.pluck style callback
10236 **/
10237 findLastKey(
10238 object: any,
10239 pluckValue: string): string;
10240
10241 /**
10242 * @see _.findLastKey
10243 * @param whereValue _.where style callback
10244 **/
10245 findLastKey<W extends Dictionary<any>, T>(
10246 object: T,
10247 whereValue: W): string;
10248 }
10249
10250 //_.forOwn
10251 interface LoDashStatic {
10252 /**
10253 * Iterates over own enumerable properties of an object, executing the callback for each
10254 * property. The callback is bound to thisArg and invoked with three arguments; (value, key,
10255 * object). Callbacks may exit iteration early by explicitly returning false.
10256 * @param object The object to iterate over.
10257 * @param callback The function called per iteration.
10258 * @param thisArg The this binding of callback.
10259 * @return object
10260 **/
10261 forOwn<T extends {}>(
10262 object: Dictionary<T>,
10263 callback?: ObjectIterator<T, void>,
10264 thisArg?: any): Dictionary<T>;
10265
10266 /**
10267 * @see _.forOwn
10268 **/
10269 forOwn<T extends {}>(
10270 object: T,
10271 callback?: ObjectIterator<any, void>,
10272 thisArg?: any): T;
10273 }
10274
10275 interface LoDashObjectWrapper<T> {
10276 /**
10277 * @see _.forOwn
10278 **/
10279 forOwn<T extends {}>(
10280 callback: ObjectIterator<T, void>,
10281 thisArg?: any): _.LoDashObjectWrapper<T>;
10282 }
10283
10284 //_.forOwnRight
10285 interface LoDashStatic {
10286 /**
10287 * This method is like _.forOwn except that it iterates over elements of a collection in the
10288 * opposite order.
10289 * @param object The object to iterate over.
10290 * @param callback The function called per iteration.
10291 * @param thisArg The this binding of callback.
10292 * @return object
10293 **/
10294 forOwnRight<T extends {}>(
10295 object: Dictionary<T>,
10296 callback?: ObjectIterator<T, void>,
10297 thisArg?: any): Dictionary<T>;
10298 /**
10299 * @see _.forOwnRight
10300 **/
10301 forOwnRight<T extends {}>(
10302 object: T,
10303 callback?: ObjectIterator<any, void>,
10304 thisArg?: any): T;
10305 }
10306
10307 interface LoDashObjectWrapper<T> {
10308 /**
10309 * @see _.forOwnRight
10310 **/
10311 forOwnRight<T extends {}>(
10312 callback: ObjectIterator<T, void>,
10313 thisArg?: any): _.LoDashObjectWrapper<T>;
10314 }
10315
10316 //_.functions
10317 interface LoDashStatic {
10318 /**
10319 * Creates a sorted array of property names of all enumerable properties, own and inherited, of
10320 * object that have function values.
10321 * @param object The object to inspect.
10322 * @return An array of property names that have function values.
10323 **/
10324 functions(object: any): string[];
10325
10326 /**
10327 * @see _functions
10328 **/
10329 methods(object: any): string[];
10330 }
10331
10332 interface LoDashObjectWrapper<T> {
10333 /**
10334 * @see _.functions
10335 **/
10336 functions(): _.LoDashArrayWrapper<string>;
10337
10338 /**
10339 * @see _.functions
10340 **/
10341 methods(): _.LoDashArrayWrapper<string>;
10342 }
10343
10344 //_.has
10345 interface LoDashStatic {
10346 /**
10347 * Checks if the specified object property exists and is a direct property, instead of an
10348 * inherited property.
10349 * @param object The object to check.
10350 * @param property The property to check for.
10351 * @return True if key is a direct property, else false.
10352 **/
10353 has(object: any, property: string): boolean;
10354 }
10355
10356 //_.invert
10357 interface LoDashStatic {
10358 /**
10359 * Creates an object composed of the inverted keys and values of the given object.
10360 * @param object The object to invert.
10361 * @return The created inverted object.
10362 **/
10363 invert(object: any): any;
10364 }
10365
10366 //_.isArguments
10367 interface LoDashStatic {
10368 /**
10369 * Checks if value is an arguments object.
10370 * @param value The value to check.
10371 * @return True if the value is an arguments object, else false.
10372 **/
10373 isArguments(value: any): boolean;
10374 }
10375
10376 //_.isArray
10377 interface LoDashStatic {
10378 /**
10379 * Checks if value is an array.
10380 * @param value The value to check.
10381 * @return True if the value is an array, else false.
10382 **/
10383 isArray(value: any): boolean;
10384 }
10385
10386 //_.isBoolean
10387 interface LoDashStatic {
10388 /**
10389 * Checks if value is a boolean value.
10390 * @param value The value to check.
10391 * @return True if the value is a boolean value, else false.
10392 **/
10393 isBoolean(value: any): boolean;
10394 }
10395
10396 //_.isDate
10397 interface LoDashStatic {
10398 /**
10399 * Checks if value is a date.
10400 * @param value The value to check.
10401 * @return True if the value is a date, else false.
10402 **/
10403 isDate(value: any): boolean;
10404 }
10405
10406 //_.isElement
10407 interface LoDashStatic {
10408 /**
10409 * Checks if value is a DOM element.
10410 * @param value The value to check.
10411 * @return True if the value is a DOM element, else false.
10412 **/
10413 isElement(value: any): boolean;
10414 }
10415
10416 //_.isEmpty
10417 interface LoDashStatic {
10418 /**
10419 * Checks if value is empty. Arrays, strings, or arguments objects with a length of 0 and objects
10420 * with no own enumerable properties are considered "empty".
10421 * @param value The value to inspect.
10422 * @return True if the value is empty, else false.
10423 **/
10424 isEmpty(value: any[]): boolean;
10425
10426 /**
10427 * @see _.isEmpty
10428 **/
10429 isEmpty(value: Dictionary<any>): boolean;
10430
10431 /**
10432 * @see _.isEmpty
10433 **/
10434 isEmpty(value: string): boolean;
10435
10436 /**
10437 * @see _.isEmpty
10438 **/
10439 isEmpty(value: any): boolean;
10440 }
10441
10442 //_.isEqual
10443 interface LoDashStatic {
10444 /**
10445 * Performs a deep comparison between two values to determine if they are equivalent to each
10446 * other. If a callback is provided it will be executed to compare values. If the callback
10447 * returns undefined comparisons will be handled by the method instead. The callback is bound to
10448 * thisArg and invoked with two arguments; (a, b).
10449 * @param a The value to compare.
10450 * @param b The other value to compare.
10451 * @param callback The function to customize comparing values.
10452 * @param thisArg The this binding of callback.
10453 * @return True if the values are equivalent, else false.
10454 **/
10455 isEqual(
10456 a: any,
10457 b: any,
10458 callback?: (a: any, b: any) => boolean,
10459 thisArg?: any): boolean;
10460 }
10461
10462 //_.isFinite
10463 interface LoDashStatic {
10464 /**
10465 * Checks if value is, or can be coerced to, a finite number.
10466 *
10467 * Note: This is not the same as native isFinite which will return true for booleans and empty
10468 * strings. See http://es5.github.io/#x15.1.2.5.
10469 * @param value The value to check.
10470 * @return True if the value is finite, else false.
10471 **/
10472 isFinite(value: any): boolean;
10473 }
10474
10475 //_.isFunction
10476 interface LoDashStatic {
10477 /**
10478 * Checks if value is a function.
10479 * @param value The value to check.
10480 * @return True if the value is a function, else false.
10481 **/
10482 isFunction(value: any): boolean;
10483 }
10484
10485 //_.isNaN
10486 interface LoDashStatic {
10487 /**
10488 * Checks if value is NaN.
10489 *
10490 * Note: This is not the same as native isNaN which will return true for undefined and other
10491 * non-numeric values. See http://es5.github.io/#x15.1.2.4.
10492 * @param value The value to check.
10493 * @return True if the value is NaN, else false.
10494 **/
10495 isNaN(value: any): boolean;
10496 }
10497
10498 //_.isNumber
10499 interface LoDashStatic {
10500 /**
10501 * Checks if value is a number.
10502 *
10503 * Note: NaN is considered a number. See http://es5.github.io/#x8.5.
10504 * @param value The value to check.
10505 * @return True if the value is a number, else false.
10506 **/
10507 isNumber(value: any): boolean;
10508 }
10509
10510 //_.isObject
10511 interface LoDashStatic {
10512 /**
10513 * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes,
10514 * new Number(0), and new String(''))
10515 * @param value The value to check.
10516 * @return True if the value is an object, else false.
10517 **/
10518 isObject(value: any): boolean;
10519 }
10520
10521 //_.isPlainObject
10522 interface LoDashStatic {
10523 /**
10524 * Checks if value is an object created by the Object constructor.
10525 * @param value The value to check.
10526 * @return True if value is a plain object, else false.
10527 **/
10528 isPlainObject(value: any): boolean;
10529 }
10530
10531 //_.isRegExp
10532 interface LoDashStatic {
10533 /**
10534 * Checks if value is a regular expression.
10535 * @param value The value to check.
10536 * @return True if the value is a regular expression, else false.
10537 **/
10538 isRegExp(value: any): boolean;
10539 }
10540
10541 //_.isString
10542 interface LoDashStatic {
10543 /**
10544 * Checks if value is a string.
10545 * @param value The value to check.
10546 * @return True if the value is a string, else false.
10547 **/
10548 isString(value: any): boolean;
10549 }
10550
10551 //_.keys
10552 interface LoDashStatic {
10553 /**
10554 * Creates an array composed of the own enumerable property names of an object.
10555 * @param object The object to inspect.
10556 * @return An array of property names.
10557 **/
10558 keys(object: any): string[];
10559 }
10560
10561 interface LoDashObjectWrapper<T> {
10562 /**
10563 * @see _.keys
10564 **/
10565 keys(): LoDashArrayWrapper<string>
10566 }
10567
10568 //_.mapValues
10569 interface LoDashStatic {
10570 /**
10571 * Creates an object with the same keys as object and values generated by running each own
10572 * enumerable property of object through the callback. The callback is bound to thisArg and
10573 * invoked with three arguments; (value, key, object).
10574 *
10575 * If a property name is provided for callback the created "_.pluck" style callback will return
10576 * the property value of the given element.
10577 *
10578 * If an object is provided for callback the created "_.where" style callback will return true
10579 * for elements that have the properties of the given object, else false.
10580 *
10581 * @param object The object to iterate over.
10582 * @param callback The function called per iteration.
10583 * @param thisArg `this` object in `iterator`, optional.
10584 * @return Returns a new object with values of the results of each callback execution.
10585 */
10586 mapValues<T, TResult>(obj: Dictionary<T>, callback: ObjectIterator<T, TResult>, thisArg?: any): Dictionary<TResult>;
10587 mapValues<T>(obj: Dictionary<T>, where: Dictionary<T>): Dictionary<boolean>;
10588 mapValues<T, TMapped>(obj: T, pluck: string): TMapped;
10589 mapValues<T>(obj: T, callback: ObjectIterator<any, any>, thisArg?: any): T;
10590 }
10591
10592 //_.merge
10593 interface LoDashStatic {
10594 /**
10595 * Recursively merges own enumerable properties of the source object(s), that don't resolve
10596 * to undefined into the destination object. Subsequent sources will overwrite property
10597 * assignments of previous sources. If a callback is provided it will be executed to produce
10598 * the merged values of the destination and source properties. If the callback returns undefined
10599 * merging will be handled by the method instead. The callback is bound to thisArg and invoked
10600 * with two arguments; (objectValue, sourceValue).
10601 * @param object The destination object.
10602 * @param s1-8 The source object(s)
10603 * @param callback The function to customize merging properties.
10604 * @param thisArg The this binding of callback.
10605 * @return The destination object.
10606 **/
10607 merge<P, T, S1, Value, Result>(
10608 object: T,
10609 s1: S1,
10610 callback?: (objectValue: Value, sourceValue: Value) => Value,
10611 thisArg?: any): Result;
10612
10613 /**
10614 * @see _.merge
10615 **/
10616 merge<P, T, S1, S2, Value, Result>(
10617 object: T,
10618 s1: S1,
10619 s2: S2,
10620 callback?: (objectValue: Value, sourceValue: Value) => Value,
10621 thisArg?: any): Result;
10622
10623 /**
10624 * @see _.merge
10625 **/
10626 merge<P, T, S1, S2, S3, Value, Result>(
10627 object: T,
10628 s1: S1,
10629 s2: S2,
10630 s3: S3,
10631 callback?: (objectValue: Value, sourceValue: Value) => Value,
10632 thisArg?: any): Result;
10633
10634 /**
10635 * @see _.merge
10636 **/
10637 merge<P, T, S1, S2, S3, S4, Value, Result>(
10638 object: T,
10639 s1: S1,
10640 s2: S2,
10641 s3: S3,
10642 s4: S4,
10643 callback?: (objectValue: Value, sourceValue: Value) => Value,
10644 thisArg?: any): Result;
10645 }
10646
10647 //_.omit
10648 interface LoDashStatic {
10649 /**
10650 * Creates a shallow clone of object excluding the specified properties. Property names may be
10651 * specified as individual arguments or as arrays of property names. If a callback is provided
10652 * it will be executed for each property of object omitting the properties the callback returns
10653 * truey for. The callback is bound to thisArg and invoked with three arguments; (value, key,
10654 * object).
10655 * @param object The source object.
10656 * @param keys The properties to omit.
10657 * @return An object without the omitted properties.
10658 **/
10659 omit<Omitted, T>(
10660 object: T,
10661 ...keys: string[]): Omitted;
10662
10663 /**
10664 * @see _.omit
10665 **/
10666 omit<Omitted, T>(
10667 object: T,
10668 keys: string[]): Omitted;
10669
10670 /**
10671 * @see _.omit
10672 **/
10673 omit<Omitted, T>(
10674 object: T,
10675 callback: ObjectIterator<any, boolean>,
10676 thisArg?: any): Omitted;
10677 }
10678
10679 interface LoDashObjectWrapper<T> {
10680 /**
10681 * @see _.omit
10682 **/
10683 omit<Omitted>(
10684 ...keys: string[]): LoDashObjectWrapper<Omitted>;
10685
10686 /**
10687 * @see _.omit
10688 **/
10689 omit<Omitted>(
10690 keys: string[]): LoDashObjectWrapper<Omitted>;
10691
10692 /**
10693 * @see _.omit
10694 **/
10695 omit<Omitted>(
10696 callback: ObjectIterator<any, boolean>,
10697 thisArg?: any): LoDashObjectWrapper<Omitted>;
10698 }
10699
10700 //_.pairs
10701 interface LoDashStatic {
10702 /**
10703 * Creates a two dimensional array of an object’s key-value pairs,
10704 * i.e. [[key1, value1], [key2, value2]].
10705 * @param object The object to inspect.
10706 * @return Aew array of key-value pairs.
10707 **/
10708 pairs(object: any): any[][];
10709 }
10710
10711 interface LoDashObjectWrapper<T> {
10712 /**
10713 * @see _.pairs
10714 **/
10715 pairs(): LoDashArrayWrapper<any[]>;
10716 }
10717
10718 //_.picks
10719 interface LoDashStatic {
10720 /**
10721 * Creates a shallow clone of object composed of the specified properties. Property names may be
10722 * specified as individual arguments or as arrays of property names. If a callback is provided
10723 * it will be executed for each property of object picking the properties the callback returns
10724 * truey for. The callback is bound to thisArg and invoked with three arguments; (value, key,
10725 * object).
10726 * @param object Object to strip unwanted key/value pairs.
10727 * @param keys Property names to pick
10728 * @return An object composed of the picked properties.
10729 **/
10730 pick<Picked, T>(
10731 object: T,
10732 ...keys: string[]): Picked;
10733
10734 /**
10735 * @see _.pick
10736 **/
10737 pick<Picked, T>(
10738 object: T,
10739 keys: string[]): Picked;
10740
10741 /**
10742 * @see _.pick
10743 **/
10744 pick<Picked, T>(
10745 object: T,
10746 callback: ObjectIterator<any, boolean>,
10747 thisArg?: any): Picked;
10748 }
10749
10750 //_.transform
10751 interface LoDashStatic {
10752 /**
10753 * An alternative to _.reduce this method transforms object to a new accumulator object which is
10754 * the result of running each of its elements through a callback, with each callback execution
10755 * potentially mutating the accumulator object. The callback is bound to thisArg and invoked with
10756 * four arguments; (accumulator, value, key, object). Callbacks may exit iteration early by
10757 * explicitly returning false.
10758 * @param collection The collection to iterate over.
10759 * @param callback The function called per iteration.
10760 * @param accumulator The custom accumulator value.
10761 * @param thisArg The this binding of callback.
10762 * @return The accumulated value.
10763 **/
10764 transform<T, Acc>(
10765 collection: Array<T>,
10766 callback: MemoVoidIterator<T, Acc>,
10767 accumulator: Acc,
10768 thisArg?: any): Acc;
10769
10770 /**
10771 * @see _.transform
10772 **/
10773 transform<T, Acc>(
10774 collection: List<T>,
10775 callback: MemoVoidIterator<T, Acc>,
10776 accumulator: Acc,
10777 thisArg?: any): Acc;
10778
10779 /**
10780 * @see _.transform
10781 **/
10782 transform<T, Acc>(
10783 collection: Dictionary<T>,
10784 callback: MemoVoidIterator<T, Acc>,
10785 accumulator: Acc,
10786 thisArg?: any): Acc;
10787
10788 /**
10789 * @see _.transform
10790 **/
10791 transform<T, Acc>(
10792 collection: Array<T>,
10793 callback?: MemoVoidIterator<T, Acc>,
10794 thisArg?: any): Acc;
10795
10796 /**
10797 * @see _.transform
10798 **/
10799 transform<T, Acc>(
10800 collection: List<T>,
10801 callback?: MemoVoidIterator<T, Acc>,
10802 thisArg?: any): Acc;
10803
10804 /**
10805 * @see _.transform
10806 **/
10807 transform<T, Acc>(
10808 collection: Dictionary<T>,
10809 callback?: MemoVoidIterator<T, Acc>,
10810 thisArg?: any): Acc;
10811 }
10812
10813 //_.values
10814 interface LoDashStatic {
10815 /**
10816 * Creates an array composed of the own enumerable property values of object.
10817 * @param object The object to inspect.
10818 * @return Returns an array of property values.
10819 **/
10820 values(object: any): any[];
10821 }
10822
10823 /**********
10824 * String *
10825 **********/
10826
10827 interface LoDashStatic {
10828 camelCase(str?: string): string;
10829 capitalize(str?: string): string;
10830 deburr(str?: string): string;
10831 endsWith(str?: string, target?: string, position?: number): boolean;
10832 escape(str?: string): string;
10833 escapeRegExp(str?: string): string;
10834 kebabCase(str?: string): string;
10835 pad(str?: string, length?: number, chars?: string): string;
10836 padLeft(str?: string, length?: number, chars?: string): string;
10837 padRight(str?: string, length?: number, chars?: string): string;
10838 repeat(str?: string, n?: number): string;
10839 snakeCase(str?: string): string;
10840 startCase(str?: string): string;
10841 startsWith(str?: string, target?: string, position?: number): boolean;
10842 trim(str?: string, chars?: string): string;
10843 trimLeft(str?: string, chars?: string): string;
10844 trimRight(str?: string, chars?: string): string;
10845 trunc(str?: string, len?: number): string;
10846 trunc(str?: string, options?: { length?: number; omission?: string; separator?: string }): string;
10847 trunc(str?: string, options?: { length?: number; omission?: string; separator?: RegExp }): string;
10848 words(str?: string, pattern?: string): string[];
10849 words(str?: string, pattern?: RegExp): string[];
10850 }
10851
10852 //_.parseInt
10853 interface LoDashStatic {
10854 /**
10855 * Converts the given value into an integer of the specified radix. If radix is undefined or 0 a
10856 * radix of 10 is used unless the value is a hexadecimal, in which case a radix of 16 is used.
10857 *
10858 * Note: This method avoids differences in native ES3 and ES5 parseInt implementations. See
10859 * http://es5.github.io/#E.
10860 * @param value The value to parse.
10861 * @param radix The radix used to interpret the value to parse.
10862 * @return The new integer value.
10863 **/
10864 parseInt(value: string, radix?: number): number;
10865 }
10866
10867 /*************
10868 * Utilities *
10869 *************/
10870 //_.escape
10871 interface LoDashStatic {
10872 /**
10873 * Converts the characters &, <, >, ", and ' in string to their corresponding HTML entities.
10874 * @param string The string to escape.
10875 * @return The escaped string.
10876 **/
10877 escape(str: string): string;
10878 }
10879
10880 //_.identity
10881 interface LoDashStatic {
10882 /**
10883 * This method returns the first argument provided to it.
10884 * @param value Any value.
10885 * @return value.
10886 **/
10887 identity<T>(value: T): T;
10888 }
10889
10890 //_.mixin
10891 interface LoDashStatic {
10892 /**
10893 * Adds function properties of a source object to the lodash function and chainable wrapper.
10894 * @param object The object of function properties to add to lodash.
10895 **/
10896 mixin(object: Dictionary<(value: any) => any>): void;
10897 }
10898
10899 //_.noConflict
10900 interface LoDashStatic {
10901 /**
10902 * Reverts the '_' variable to its previous value and returns a reference to the lodash function.
10903 * @return The lodash function.
10904 **/
10905 noConflict(): typeof _;
10906 }
10907
10908 //_.property
10909 interface LoDashStatic {
10910 /**
10911 * # Ⓢ
10912 * Creates a "_.pluck" style function, which returns the key value of a given object.
10913 * @param key (string)
10914 * @return the value of that key on the object
10915 **/
10916 property<T,RT>(key: string): (obj: T) => RT;
10917 }
10918
10919 //_.random
10920 interface LoDashStatic {
10921 /**
10922 * Produces a random number between min and max (inclusive). If only one argument is provided a
10923 * number between 0 and the given number will be returned. If floating is truey or either min or
10924 * max are floats a floating-point number will be returned instead of an integer.
10925 * @param max The maximum possible value.
10926 * @param floating Specify returning a floating-point number.
10927 * @return A random number.
10928 **/
10929 random(max: number, floating?: boolean): number;
10930
10931 /**
10932 * @see _.random
10933 * @param min The minimum possible value.
10934 * @return A random number between `min` and `max`.
10935 **/
10936 random(min: number, max: number, floating?: boolean): number;
10937 }
10938
10939 //_.result
10940 interface LoDashStatic {
10941 /**
10942 * Resolves the value of property on object. If property is a function it will be invoked with
10943 * the this binding of object and its result returned, else the property value is returned. If
10944 * object is falsey then undefined is returned.
10945 * @param object The object to inspect.
10946 * @param property The property to get the value of.
10947 * @return The resolved value.
10948 **/
10949 result(object: any, property: string): any;
10950 }
10951
10952 //_.runInContext
10953 interface LoDashStatic {
10954 /**
10955 * Create a new lodash function using the given context object.
10956 * @param context The context object
10957 * @returns The lodash function.
10958 **/
10959 runInContext(context: any): typeof _;
10960 }
10961
10962 //_.template
10963 interface LoDashStatic {
10964 /**
10965 * A micro-templating method that handles arbitrary delimiters, preserves whitespace, and
10966 * correctly escapes quotes within interpolated code.
10967 *
10968 * Note: In the development build, _.template utilizes sourceURLs for easier debugging. See
10969 * http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
10970 *
10971 * For more information on precompiling templates see:
10972 * http://lodash.com/#custom-builds
10973 *
10974 * For more information on Chrome extension sandboxes see:
10975 * http://developer.chrome.com/stable/extensions/sandboxingEval.html
10976 * @param text The template text.
10977 * @param data The data object used to populate the text.
10978 * @param options The options object.
10979 * @param options.escape The "escape" delimiter.
10980 * @param options.evaluate The "evaluate" delimiter.
10981 * @param options.import An object to import into the template as local variables.
10982 * @param options.interpolate The "interpolate" delimiter.
10983 * @param sourceURL The sourceURL of the template’s compiled source.
10984 * @param variable The data object variable name.
10985 * @return Returns the compiled Lo-Dash HTML template or a TemplateExecutor if no data is passed.
10986 **/
10987 template(
10988 text: string): TemplateExecutor;
10989
10990 /**
10991 * @see _.template
10992 **/
10993 template(
10994 text: string,
10995 data: any,
10996 options?: TemplateSettings,
10997 sourceURL?: string,
10998 variable?: string): any /* string or TemplateExecutor*/;
10999 }
11000
11001 interface TemplateExecutor {
11002 (...data: any[]): string;
11003 source: string;
11004 }
11005
11006 //_.times
11007 interface LoDashStatic {
11008 /**
11009 * Executes the callback n times, returning an array of the results of each callback execution.
11010 * The callback is bound to thisArg and invoked with one argument; (index).
11011 * @param n The number of times to execute the callback.
11012 * @param callback The function called per iteration.
11013 * @param thisArg The this binding of callback.
11014 **/
11015 times<TResult>(
11016 n: number,
11017 callback: (num: number) => TResult,
11018 context?: any): TResult[];
11019 }
11020
11021 //_.unescape
11022 interface LoDashStatic {
11023 /**
11024 * The inverse of _.escape this method converts the HTML entities &amp;, <, &gt;, &quot;, and
11025 * &#39; in string to their corresponding characters.
11026 * @param string The string to unescape.
11027 * @return The unescaped string.
11028 **/
11029 unescape(
11030 string: string): string;
11031 }
11032
11033 //_.uniqueId
11034 interface LoDashStatic {
11035 /**
11036 * Generates a unique ID. If prefix is provided the ID will be appended to it.
11037 * @param prefix The value to prefix the ID with.
11038 * @return Returns the unique ID.
11039 **/
11040 uniqueId(prefix?: string): string;
11041 }
11042
11043 //_.noop
11044 interface LoDashStatic {
11045 /**
11046 * A no-operation function.
11047 **/
11048 noop(): void;
11049 }
11050
11051 //_.constant
11052 interface LoDashStatic {
11053 /**
11054 * Creates a function that returns value..
11055 **/
11056 constant<T>(value: T): () => T;
11057 }
11058
11059 //_.create
11060 interface LoDashStatic {
11061 /**
11062 * Creates an object that inherits from the given prototype object. If a properties object is provided its own enumerable properties are assigned to the created object.
11063 * @param prototype The object to inherit from.
11064 * @param properties The properties to assign to the object.
11065 */
11066 create<T>(prototype: Object, properties?: Object): Object;
11067 }
11068
11069 interface ListIterator<T, TResult> {
11070 (value: T, index: number, list: T[]): TResult;
11071 }
11072
11073 interface ObjectIterator<T, TResult> {
11074 (element: T, key: string, list: any): TResult;
11075 }
11076
11077 interface MemoVoidIterator<T, TResult> {
11078 (prev: TResult, curr: T, indexOrKey: any, list?: T[]): void;
11079 }
11080 interface MemoIterator<T, TResult> {
11081 (prev: TResult, curr: T, indexOrKey: any, list?: T[]): TResult;
11082 }
11083 /*
11084 interface MemoListIterator<T, TResult> {
11085 (prev: TResult, curr: T, index: number, list?: T[]): TResult;
11086 }
11087 interface MemoObjectIterator<T, TResult> {
11088 (prev: TResult, curr: T, index: string, object?: Dictionary<T>): TResult;
11089 }
11090 */
11091
11092 //interface Collection<T> {}
11093
11094 // Common interface between Arrays and jQuery objects
11095 interface List<T> {
11096 [index: number]: T;
11097 length: number;
11098 }
11099
11100 interface Dictionary<T> {
11101 [index: string]: T;
11102 }
11103}
11104
11105declare module "lodash" {
11106 export = _;
11107}
11108
11109// Type definitions for d3JS
11110// Project: http://d3js.org/
11111// Definitions by: Boris Yankov <https://github.com/borisyankov>
11112// Definitions: https://github.com/borisyankov/DefinitelyTyped
11113
11114declare module D3 {
11115 export interface Selectors {
11116 /**
11117 * Select an element from the current document
11118 */
11119 select: {
11120 /**
11121 * Selects the first element that matches the specified selector string
11122 *
11123 * @param selector Selection String to match
11124 */
11125 (selector: string): Selection;
11126 /**
11127 * Selects the specified node
11128 *
11129 * @param element Node element to select
11130 */
11131 (element: EventTarget): Selection;
11132 };
11133
11134 /**
11135 * Select multiple elements from the current document
11136 */
11137 selectAll: {
11138 /**
11139 * Selects all elements that match the specified selector
11140 *
11141 * @param selector Selection String to match
11142 */
11143 (selector: string): Selection;
11144 /**
11145 * Selects the specified array of elements
11146 *
11147 * @param elements Array of node elements to select
11148 */
11149 (elements: EventTarget[]): Selection;
11150 };
11151 }
11152
11153 export interface D3Event extends Event{
11154 dx: number;
11155 dy: number;
11156 clientX: number;
11157 clientY: number;
11158 translate: number[];
11159 scale: number;
11160 sourceEvent: D3Event;
11161 x: number;
11162 y: number;
11163 keyCode: number;
11164 altKey: any;
11165 ctrlKey: any;
11166 shiftKey: any;
11167 type: string;
11168 }
11169
11170 export interface Base extends Selectors {
11171 /**
11172 * Create a behavior
11173 */
11174 behavior: Behavior.Behavior;
11175 /**
11176 * Access the current user event for interaction
11177 */
11178 event: D3Event;
11179
11180 /**
11181 * Compare two values for sorting.
11182 * Returns -1 if a is less than b, or 1 if a is greater than b, or 0
11183 *
11184 * @param a First value
11185 * @param b Second value
11186 */
11187 ascending<T>(a: T, b: T): number;
11188 /**
11189 * Compare two values for sorting.
11190 * Returns -1 if a is greater than b, or 1 if a is less than b, or 0
11191 *
11192 * @param a First value
11193 * @param b Second value
11194 */
11195 descending<T>(a: T, b: T): number;
11196 /**
11197 * Find the minimum value in an array
11198 *
11199 * @param arr Array to search
11200 * @param map Accsessor function
11201 */
11202 min<T, U>(arr: T[], map: (v?: T, i?: number) => U): U;
11203 /**
11204 * Find the minimum value in an array
11205 *
11206 * @param arr Array to search
11207 */
11208 min<T>(arr: T[]): T;
11209 /**
11210 * Find the maximum value in an array
11211 *
11212 * @param arr Array to search
11213 * @param map Accsessor function
11214 */
11215 max<T, U>(arr: T[], map: (v?: T, i?: number) => U): U;
11216 /**
11217 * Find the maximum value in an array
11218 *
11219 * @param arr Array to search
11220 */
11221 max<T>(arr: T[]): T;
11222 /**
11223 * Find the minimum and maximum value in an array
11224 *
11225 * @param arr Array to search
11226 * @param map Accsessor function
11227 */
11228 extent<T, U>(arr: T[], map: (v: T) => U): U[];
11229 /**
11230 * Find the minimum and maximum value in an array
11231 *
11232 * @param arr Array to search
11233 */
11234 extent<T>(arr: T[]): T[];
11235 /**
11236 * Compute the sum of an array of numbers
11237 *
11238 * @param arr Array to search
11239 * @param map Accsessor function
11240 */
11241 sum<T>(arr: T[], map: (v: T) => number): number;
11242 /**
11243 * Compute the sum of an array of numbers
11244 *
11245 * @param arr Array to search
11246 */
11247 sum(arr: number[]): number;
11248 /**
11249 * Compute the arithmetic mean of an array of numbers
11250 *
11251 * @param arr Array to search
11252 * @param map Accsessor function
11253 */
11254 mean<T>(arr: T[], map: (v: T) => number): number;
11255 /**
11256 * Compute the arithmetic mean of an array of numbers
11257 *
11258 * @param arr Array to search
11259 */
11260 mean(arr: number[]): number;
11261 /**
11262 * Compute the median of an array of numbers (the 0.5-quantile).
11263 *
11264 * @param arr Array to search
11265 * @param map Accsessor function
11266 */
11267 median<T>(arr: T[], map: (v: T) => number): number;
11268 /**
11269 * Compute the median of an array of numbers (the 0.5-quantile).
11270 *
11271 * @param arr Array to search
11272 */
11273 median(arr: number[]): number;
11274 /**
11275 * Compute a quantile for a sorted array of numbers.
11276 *
11277 * @param arr Array to search
11278 * @param p The quantile to return
11279 */
11280 quantile: (arr: number[], p: number) => number;
11281 /**
11282 * Locate the insertion point for x in array to maintain sorted order
11283 *
11284 * @param arr Array to search
11285 * @param x Value to search for insertion point
11286 * @param low Minimum value of array subset
11287 * @param hihg Maximum value of array subset
11288 */
11289 bisect<T>(arr: T[], x: T, low?: number, high?: number): number;
11290 /**
11291 * Locate the insertion point for x in array to maintain sorted order
11292 *
11293 * @param arr Array to search
11294 * @param x Value to serch for insertion point
11295 * @param low Minimum value of array subset
11296 * @param high Maximum value of array subset
11297 */
11298 bisectLeft<T>(arr: T[], x: T, low?: number, high?: number): number;
11299 /**
11300 * Locate the insertion point for x in array to maintain sorted order
11301 *
11302 * @param arr Array to search
11303 * @param x Value to serch for insertion point
11304 * @param low Minimum value of array subset
11305 * @param high Maximum value of array subset
11306 */
11307 bisectRight<T>(arr: T[], x: T, low?: number, high?: number): number;
11308 /**
11309 * Bisect using an accessor.
11310 *
11311 * @param accessor Accessor function
11312 */
11313 bisector(accessor: (data: any, index: number) => any): any;
11314 /**
11315 * Randomize the order of an array.
11316 *
11317 * @param arr Array to randomize
11318 */
11319 shuffle<T>(arr: T[]): T[];
11320 /**
11321 * Reorder an array of elements according to an array of indexes
11322 *
11323 * @param arr Array to reorder
11324 * @param indexes Array containing the order the elements should be returned in
11325 */
11326 permute(arr: any[], indexes: any[]): any[];
11327 /**
11328 * Transpose a variable number of arrays.
11329 *
11330 * @param arrs Arrays to transpose
11331 */
11332 zip(...arrs: any[]): any[];
11333 /**
11334 * Parse the given 2D affine transform string, as defined by SVG's transform attribute.
11335 *
11336 * @param definition 2D affine transform string
11337 */
11338 transform(definition: string): any;
11339 /**
11340 * Transpose an array of arrays.
11341 *
11342 * @param matrix Two dimensional array to transpose
11343 */
11344 transpose(matrix: any[]): any[];
11345 /**
11346 * Creates an array containing tuples of adjacent pairs
11347 *
11348 * @param arr An array containing entries to pair
11349 * @returns any[][] An array of 2-element tuples for each pair
11350 */
11351 pairs(arr: any[]): any[][];
11352 /**
11353 * List the keys of an associative array.
11354 *
11355 * @param map Array of objects to get the key values from
11356 */
11357 keys(map: any): string[];
11358 /**
11359 * List the values of an associative array.
11360 *
11361 * @param map Array of objects to get the values from
11362 */
11363 values(map: any): any[];
11364 /**
11365 * List the key-value entries of an associative array.
11366 *
11367 * @param map Array of objects to get the key-value pairs from
11368 */
11369 entries(map: any): any[];
11370 /**
11371 * merge multiple arrays into one array
11372 *
11373 * @param map Arrays to merge
11374 */
11375 merge(...map: any[]): any[];
11376 /**
11377 * Generate a range of numeric values.
11378 */
11379 range: {
11380 /**
11381 * Generate a range of numeric values from 0.
11382 *
11383 * @param stop Value to generate the range to
11384 * @param step Step between each value
11385 */
11386 (stop: number, step?: number): number[];
11387 /**
11388 * Generate a range of numeric values.
11389 *
11390 * @param start Value to start
11391 * @param stop Value to generate the range to
11392 * @param step Step between each value
11393 */
11394 (start: number, stop?: number, step?: number): number[];
11395 };
11396 /**
11397 * Create new nest operator
11398 */
11399 nest(): Nest;
11400 /**
11401 * Request a resource using XMLHttpRequest.
11402 */
11403 xhr: {
11404 /**
11405 * Creates an asynchronous request for specified url
11406 *
11407 * @param url Url to request
11408 * @param callback Function to invoke when resource is loaded or the request fails
11409 */
11410 (url: string, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
11411 /**
11412 * Creates an asynchronous request for specified url
11413 *
11414 * @param url Url to request
11415 * @param mime MIME type to request
11416 * @param callback Function to invoke when resource is loaded or the request fails
11417 */
11418 (url: string, mime: string, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
11419 };
11420 /**
11421 * Request a text file
11422 */
11423 text: {
11424 /**
11425 * Request a text file
11426 *
11427 * @param url Url to request
11428 * @param callback Function to invoke when resource is loaded or the request fails
11429 */
11430 (url: string, callback?: (response: string) => void ): Xhr;
11431 /**
11432 * Request a text file
11433 *
11434 * @param url Url to request
11435 * @param mime MIME type to request
11436 * @param callback Function to invoke when resource is loaded or the request fails
11437 */
11438 (url: string, mime: string, callback?: (response: string) => void ): Xhr;
11439 };
11440 /**
11441 * Request a JSON blob
11442 *
11443 * @param url Url to request
11444 * @param callback Function to invoke when resource is loaded or the request fails
11445 */
11446 json: (url: string, callback?: (error: any, data: any) => void ) => Xhr;
11447 /**
11448 * Request an HTML document fragment.
11449 */
11450 xml: {
11451 /**
11452 * Request an HTML document fragment.
11453 *
11454 * @param url Url to request
11455 * @param callback Function to invoke when resource is loaded or the request fails
11456 */
11457 (url: string, callback?: (response: Document) => void ): Xhr;
11458 /**
11459 * Request an HTML document fragment.
11460 *
11461 * @param url Url to request
11462 * @param mime MIME type to request
11463 * @param callback Function to invoke when resource is loaded or the request fails
11464 */
11465 (url: string, mime: string, callback?: (response: Document) => void ): Xhr;
11466 };
11467 /**
11468 * Request an XML document fragment.
11469 *
11470 * @param url Url to request
11471 * @param callback Function to invoke when resource is loaded or the request fails
11472 */
11473 html: (url: string, callback?: (response: DocumentFragment) => void ) => Xhr;
11474 /**
11475 * Request a comma-separated values (CSV) file.
11476 */
11477 csv: Dsv;
11478 /**
11479 * Request a tab-separated values (TSV) file
11480 */
11481 tsv: Dsv;
11482 /**
11483 * Time Functions
11484 */
11485 time: Time.Time;
11486 /**
11487 * Scales
11488 */
11489 scale: Scale.ScaleBase;
11490 /*
11491 * Interpolate two values
11492 */
11493 interpolate: Transition.BaseInterpolate;
11494 /*
11495 * Interpolate two numbers
11496 */
11497 interpolateNumber: Transition.BaseInterpolate;
11498 /*
11499 * Interpolate two integers
11500 */
11501 interpolateRound: Transition.BaseInterpolate;
11502 /*
11503 * Interpolate two strings
11504 */
11505 interpolateString: Transition.BaseInterpolate;
11506 /*
11507 * Interpolate two RGB colors
11508 */
11509 interpolateRgb: Transition.BaseInterpolate;
11510 /*
11511 * Interpolate two HSL colors
11512 */
11513 interpolateHsl: Transition.BaseInterpolate;
11514 /*
11515 * Interpolate two HCL colors
11516 */
11517 interpolateHcl: Transition.BaseInterpolate;
11518 /*
11519 * Interpolate two L*a*b* colors
11520 */
11521 interpolateLab: Transition.BaseInterpolate;
11522 /*
11523 * Interpolate two arrays of values
11524 */
11525 interpolateArray: Transition.BaseInterpolate;
11526 /*
11527 * Interpolate two arbitary objects
11528 */
11529 interpolateObject: Transition.BaseInterpolate;
11530 /*
11531 * Interpolate two 2D matrix transforms
11532 */
11533 interpolateTransform: Transition.BaseInterpolate;
11534 /*
11535 * The array of built-in interpolator factories
11536 */
11537 interpolators: Transition.InterpolateFactory[];
11538 /**
11539 * Layouts
11540 */
11541 layout: Layout.Layout;
11542 /**
11543 * Svg's
11544 */
11545 svg: Svg.Svg;
11546 /**
11547 * Random number generators
11548 */
11549 random: Random;
11550 /**
11551 * Create a function to format a number as a string
11552 *
11553 * @param specifier The format specifier to use
11554 */
11555 format(specifier: string): (value: number) => string;
11556 /**
11557 * Returns the SI prefix for the specified value at the specified precision
11558 */
11559 formatPrefix(value: number, precision?: number): MetricPrefix;
11560 /**
11561 * The version of the d3 library
11562 */
11563 version: string;
11564 /**
11565 * Returns the root selection
11566 */
11567 selection(): Selection;
11568 ns: {
11569 /**
11570 * The map of registered namespace prefixes
11571 */
11572 prefix: {
11573 svg: string;
11574 xhtml: string;
11575 xlink: string;
11576 xml: string;
11577 xmlns: string;
11578 };
11579 /**
11580 * Qualifies the specified name
11581 */
11582 qualify(name: string): { space: string; local: string; };
11583 };
11584 /**
11585 * Returns a built-in easing function of the specified type
11586 */
11587 ease: (type: string, ...arrs: any[]) => D3.Transition.Transition;
11588 /**
11589 * Constructs a new RGB color.
11590 */
11591 rgb: {
11592 /**
11593 * Constructs a new RGB color with the specified r, g and b channel values
11594 */
11595 (r: number, g: number, b: number): D3.Color.RGBColor;
11596 /**
11597 * Constructs a new RGB color by parsing the specified color string
11598 */
11599 (color: string): D3.Color.RGBColor;
11600 };
11601 /**
11602 * Constructs a new HCL color.
11603 */
11604 hcl: {
11605 /**
11606 * Constructs a new HCL color.
11607 */
11608 (h: number, c: number, l: number): Color.HCLColor;
11609 /**
11610 * Constructs a new HCL color by parsing the specified color string
11611 */
11612 (color: string): Color.HCLColor;
11613 };
11614 /**
11615 * Constructs a new HSL color.
11616 */
11617 hsl: {
11618 /**
11619 * Constructs a new HSL color with the specified hue h, saturation s and lightness l
11620 */
11621 (h: number, s: number, l: number): Color.HSLColor;
11622 /**
11623 * Constructs a new HSL color by parsing the specified color string
11624 */
11625 (color: string): Color.HSLColor;
11626 };
11627 /**
11628 * Constructs a new RGB color.
11629 */
11630 lab: {
11631 /**
11632 * Constructs a new LAB color.
11633 */
11634 (l: number, a: number, b: number): Color.LABColor;
11635 /**
11636 * Constructs a new LAB color by parsing the specified color string
11637 */
11638 (color: string): Color.LABColor;
11639 };
11640 geo: Geo.Geo;
11641 geom: Geom.Geom;
11642 /**
11643 * gets the mouse position relative to a specified container.
11644 */
11645 mouse(container: any): number[];
11646 /**
11647 * gets the touch positions relative to a specified container.
11648 */
11649 touches(container: any): number[][];
11650
11651 /**
11652 * If the specified value is a function, returns the specified value.
11653 * Otherwise, returns a function that returns the specified value.
11654 */
11655 functor<R,T>(value: (p : R) => T): (p : R) => T;
11656 functor<T>(value: T): (p : any) => T;
11657
11658 map(): Map<any>;
11659 set(): Set<any>;
11660 map<T>(object: {[key: string]: T; }): Map<T>;
11661 set<T>(array: T[]): Set<T>;
11662 dispatch(...types: string[]): Dispatch;
11663 rebind(target: any, source: any, ...names: any[]): any;
11664 requote(str: string): string;
11665 timer: {
11666 (funct: () => boolean, delay?: number, mark?: number): void;
11667 flush(): void;
11668 }
11669 transition(): Transition.Transition;
11670
11671 round(x: number, n: number): number;
11672 }
11673
11674 export interface Dispatch {
11675 [event: string]: any;
11676 on: {
11677 (type: string): any;
11678 (type: string, listener: any): any;
11679 }
11680 }
11681
11682 export interface MetricPrefix {
11683 /**
11684 * the scale function, for converting numbers to the appropriate prefixed scale.
11685 */
11686 scale: (d: number) => number;
11687 /**
11688 * the prefix symbol
11689 */
11690 symbol: string;
11691 }
11692
11693 export interface Xhr {
11694 /**
11695 * Get or set request header
11696 */
11697 header: {
11698 /**
11699 * Get the value of specified request header
11700 *
11701 * @param name Name of header to get the value for
11702 */
11703 (name: string): string;
11704 /**
11705 * Set the value of specified request header
11706 *
11707 * @param name Name of header to set the value for
11708 * @param value Value to set the header to
11709 */
11710 (name: string, value: string): Xhr;
11711 };
11712 /**
11713 * Get or set MIME Type
11714 */
11715 mimeType: {
11716 /**
11717 * Get the current MIME Type
11718 */
11719 (): string;
11720 /**
11721 * Set the MIME Type for the request
11722 *
11723 * @param type The MIME type for the request
11724 */
11725 (type: string): Xhr;
11726 };
11727 /*
11728 * Get or Set the function used to map the response to the associated data value
11729 */
11730 response: {
11731 /**
11732 * Get function used to map the response to the associated data value
11733 */
11734 (): (xhr: XMLHttpRequest) => any;
11735 /**
11736 * Set function used to map the response to the associated data value
11737 *
11738 * @param value The function used to map the response to a data value
11739 */
11740 (value: (xhr: XMLHttpRequest) => any): Xhr;
11741 };
11742 /**
11743 * Issue the request using the GET method
11744 *
11745 * @param callback Function to invoke on completion of request
11746 */
11747 get(callback?: (xhr: XMLHttpRequest) => void ): Xhr;
11748 /**
11749 * Issue the request using the POST method
11750 */
11751 post: {
11752 /**
11753 * Issue the request using the POST method
11754 *
11755 * @param callback Function to invoke on completion of request
11756 */
11757 (callback?: (xhr: XMLHttpRequest) => void ): Xhr;
11758 /**
11759 * Issue the request using the POST method
11760 *
11761 * @param data Data to post back in the request
11762 * @param callback Function to invoke on completion of request
11763 */
11764 (data: any, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
11765 };
11766 /**
11767 * Issues this request using the specified method
11768 */
11769 send: {
11770 /**
11771 * Issues this request using the specified method
11772 *
11773 * @param method Method to use to make the request
11774 * @param callback Function to invoke on completion of request
11775 */
11776 (method: string, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
11777 /**
11778 * Issues this request using the specified method
11779 *
11780 * @param method Method to use to make the request
11781 * @param data Data to post back in the request
11782 * @param callback Function to invoke on completion of request
11783 */
11784 (method: string, data: any, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
11785 };
11786 /**
11787 * Aborts this request, if it is currently in-flight
11788 */
11789 abort(): Xhr;
11790 /**
11791 * Registers a listener to receive events
11792 *
11793 * @param type Enent name to attach the listener to
11794 * @param listener Function to attach to event
11795 */
11796 on: (type: string, listener: (data: any, index?: number) => any) => Xhr;
11797 }
11798
11799 export interface Dsv {
11800 /**
11801 * Request a delimited values file
11802 *
11803 * @param url Url to request
11804 * @param callback Function to invoke when resource is loaded or the request fails
11805 */
11806 (url: string, callback?: (error: any, response: any[]) => void ): Xhr;
11807 /**
11808 * Parse a delimited string into objects using the header row.
11809 *
11810 * @param string delimited formatted string to parse
11811 */
11812 parse(string: string): any[];
11813 /**
11814 * Parse a delimited string into tuples, ignoring the header row.
11815 *
11816 * @param string delimited formatted string to parse
11817 */
11818 parseRows(string: string, accessor: (row: any[], index: number) => any): any;
11819 /**
11820 * Format an array of tuples into a delimited string.
11821 *
11822 * @param rows Array to convert to a delimited string
11823 */
11824 format(rows: any[]): string;
11825 }
11826
11827 export interface Selection extends Selectors, Array<any> {
11828 attr: {
11829 (name: string): string;
11830 (name: string, value: any): Selection;
11831 (name: string, valueFunction: (data: any, index: number) => any): Selection;
11832 (attrValueMap : Object): Selection;
11833 };
11834
11835 classed: {
11836 (name: string): string;
11837 (name: string, value: any): Selection;
11838 (name: string, valueFunction: (data: any, index: number) => any): Selection;
11839 (classValueMap: Object): Selection;
11840 };
11841
11842 style: {
11843 (name: string): string;
11844 (name: string, value: any, priority?: string): Selection;
11845 (name: string, valueFunction: (data: any, index: number) => any, priority?: string): Selection;
11846 (styleValueMap : Object): Selection;
11847 };
11848
11849 property: {
11850 (name: string): void;
11851 (name: string, value: any): Selection;
11852 (name: string, valueFunction: (data: any, index: number) => any): Selection;
11853 (propertyValueMap : Object): Selection;
11854 };
11855
11856 text: {
11857 (): string;
11858 (value: any): Selection;
11859 (valueFunction: (data: any, index: number) => any): Selection;
11860 };
11861
11862 html: {
11863 (): string;
11864 (value: any): Selection;
11865 (valueFunction: (data: any, index: number) => any): Selection;
11866 };
11867
11868 append: (name: string) => Selection;
11869 insert: (name: string, before: string) => Selection;
11870 remove: () => Selection;
11871 empty: () => boolean;
11872
11873 data: {
11874 (values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => any): UpdateSelection;
11875 (values: any[], key?: (data: any, index?: number) => any): UpdateSelection;
11876 (): any[];
11877 };
11878
11879 datum: {
11880 (values: (data: any, index: number) => any): UpdateSelection;
11881 (values: any): UpdateSelection;
11882 () : any;
11883 };
11884
11885 filter: {
11886 (filter: (data: any, index: number) => boolean, thisArg?: any): UpdateSelection;
11887 (filter: string): UpdateSelection;
11888 };
11889
11890 call(callback: (selection: Selection, ...args: any[]) => void, ...args: any[]): Selection;
11891 each(eachFunction: (data: any, index: number) => any): Selection;
11892 on: {
11893 (type: string): (data: any, index: number) => any;
11894 (type: string, listener: (data: any, index: number) => any, capture?: boolean): Selection;
11895 };
11896
11897 /**
11898 * Returns the total number of elements in the current selection.
11899 */
11900 size(): number;
11901
11902 /**
11903 * Starts a transition for the current selection. Transitions behave much like selections,
11904 * except operators animate smoothly over time rather than applying instantaneously.
11905 */
11906 transition(): Transition.Transition;
11907
11908 /**
11909 * Interrupts the active transition of the provided name. Does not cancel scheduled transitions.
11910 * @param name the transition name (defaults to "")
11911 */
11912 interrupt(name?: string): Selection;
11913
11914 /**
11915 * Sorts the elements in the current selection according to the specified comparator
11916 * function.
11917 *
11918 * @param comparator a comparison function, which will be passed two data elements a and b
11919 * to compare, and should return either a negative, positive, or zero value to indicate
11920 * their relative order.
11921 */
11922 sort<T>(comparator?: (a: T, b: T) => number): Selection;
11923
11924 /**
11925 * Re-inserts elements into the document such that the document order matches the selection
11926 * order. This is equivalent to calling sort() if the data is already sorted, but much
11927 * faster.
11928 */
11929 order: () => Selection;
11930
11931 /**
11932 * Returns the first non-null element in the current selection. If the selection is empty,
11933 * returns null.
11934 */
11935 node: <T extends Element>() => T;
11936 }
11937
11938 export interface EnterSelection {
11939 append: (name: string) => Selection;
11940 insert: (name: string, before?: string) => Selection;
11941 select: (selector: string) => Selection;
11942 empty: () => boolean;
11943 node: () => Element;
11944 call: (callback: (selection: EnterSelection) => void) => EnterSelection;
11945 size: () => number;
11946 }
11947
11948 export interface UpdateSelection extends Selection {
11949 enter: () => EnterSelection;
11950 update: () => Selection;
11951 exit: () => Selection;
11952 }
11953
11954 export interface NestKeyValue {
11955 key: string;
11956 values: any;
11957 }
11958
11959 export interface Nest {
11960 key(keyFunction: (data: any, index: number) => string): Nest;
11961 sortKeys(comparator: (d1: any, d2: any) => number): Nest;
11962 sortValues(comparator: (d1: any, d2: any) => number): Nest;
11963 rollup(rollupFunction: (data: any, index: number) => any): Nest;
11964 map(values: any[]): any;
11965 entries(values: any[]): NestKeyValue[];
11966 }
11967
11968 export interface MapKeyValue<T> {
11969 key: string;
11970 value: T;
11971 }
11972
11973 export interface Map<T> {
11974 has(key: string): boolean;
11975 get(key: string): T;
11976 set(key: string, value: T): T;
11977 remove(key: string): boolean;
11978 keys(): string[];
11979 values(): T[];
11980 entries(): MapKeyValue<T>[];
11981 forEach(func: (key: string, value: T) => void ): void;
11982 empty(): boolean;
11983 size(): number;
11984 }
11985
11986 export interface Set<T> {
11987 has(value: T): boolean;
11988 add(value: T): T;
11989 remove(value: T): boolean;
11990 values(): string[];
11991 forEach(func: (value: string) => void ): void;
11992 empty(): boolean;
11993 size(): number;
11994 }
11995
11996 export interface Random {
11997 /**
11998 * Returns a function for generating random numbers with a normal distribution
11999 *
12000 * @param mean The expected value of the generated pseudorandom numbers
12001 * @param deviation The given standard deviation
12002 */
12003 normal(mean?: number, deviation?: number): () => number;
12004 /**
12005 * Returns a function for generating random numbers with a log-normal distribution
12006 *
12007 * @param mean The expected value of the generated pseudorandom numbers
12008 * @param deviation The given standard deviation
12009 */
12010 logNormal(mean?: number, deviation?: number): () => number;
12011 /**
12012 * Returns a function for generating random numbers with an Irwin-Hall distribution
12013 *
12014 * @param count The number of independent variables
12015 */
12016 irwinHall(count: number): () => number;
12017 }
12018
12019 // Transitions
12020 export module Transition {
12021 export interface Transition {
12022 duration: {
12023 (duration: number): Transition;
12024 (duration: (data: any, index: number) => any): Transition;
12025 };
12026 delay: {
12027 (delay: number): Transition;
12028 (delay: (data: any, index: number) => any): Transition;
12029 };
12030 attr: {
12031 (name: string): string;
12032 (name: string, value: any): Transition;
12033 (name: string, valueFunction: (data: any, index: number) => any): Transition;
12034 (attrValueMap : any): Transition;
12035 };
12036 style: {
12037 (name: string): string;
12038 (name: string, value: any, priority?: string): Transition;
12039 (name: string, valueFunction: (data: any, index: number) => any, priority?: string): Transition;
12040 (styleValueMap : Object): Transition;
12041 };
12042 call(callback: (selection: Selection) => void): Transition;
12043 call(callback: (selection: any, anything: any) => void, ...arguments: any[]): Transition;
12044 /**
12045 * Select an element from the current document
12046 */
12047 select: {
12048 /**
12049 * Selects the first element that matches the specified selector string
12050 *
12051 * @param selector Selection String to match
12052 */
12053 (selector: string): Transition;
12054 /**
12055 * Selects the specified node
12056 *
12057 * @param element Node element to select
12058 */
12059 (element: EventTarget): Transition;
12060 };
12061
12062 /**
12063 * Select multiple elements from the current document
12064 */
12065 selectAll: {
12066 /**
12067 * Selects all elements that match the specified selector
12068 *
12069 * @param selector Selection String to match
12070 */
12071 (selector: string): Transition;
12072 /**
12073 * Selects the specified array of elements
12074 *
12075 * @param elements Array of node elements to select
12076 */
12077 (elements: EventTarget[]): Transition;
12078 }
12079 each: (type?: string, eachFunction?: (data: any, index: number) => any) => Transition;
12080 transition: () => Transition;
12081 ease: (value: string, ...arrs: any[]) => Transition;
12082 attrTween(name: string, tween: (d: any, i: number, a: any) => BaseInterpolate): Transition;
12083 styleTween(name: string, tween: (d: any, i: number, a: any) => BaseInterpolate, priority?: string): Transition;
12084 text: {
12085 (text: string): Transition;
12086 (text: (d: any, i: number) => string): Transition;
12087 }
12088 tween(name: string, factory: InterpolateFactory): Transition;
12089 filter: {
12090 (selector: string): Transition;
12091 (selector: (data: any, index: number) => boolean): Transition;
12092 };
12093 remove(): Transition;
12094 }
12095
12096 export interface InterpolateFactory {
12097 (a?: any, b?: any): BaseInterpolate;
12098 }
12099
12100 export interface BaseInterpolate {
12101 (a: any, b?: any): any;
12102 }
12103
12104 export interface Interpolate {
12105 (t: any): any;
12106 }
12107 }
12108
12109 //Time
12110 export module Time {
12111 export interface Time {
12112 second: Interval;
12113 minute: Interval;
12114 hour: Interval;
12115 day: Interval;
12116 week: Interval;
12117 sunday: Interval;
12118 monday: Interval;
12119 tuesday: Interval;
12120 wednesday: Interval;
12121 thursday: Interval;
12122 friday: Interval;
12123 saturday: Interval;
12124 month: Interval;
12125 year: Interval;
12126
12127 seconds: Range;
12128 minutes: Range;
12129 hours: Range;
12130 days: Range;
12131 weeks: Range;
12132 months: Range;
12133 years: Range;
12134
12135 sundays: Range;
12136 mondays: Range;
12137 tuesdays: Range;
12138 wednesdays: Range;
12139 thursdays: Range;
12140 fridays: Range;
12141 saturdays: Range;
12142 format: {
12143 /**
12144 * Constructs a new local time formatter using the given specifier.
12145 */
12146 (specifier: string): TimeFormat;
12147 /**
12148 * Returns a new multi-resolution time format given the specified array of predicated formats.
12149 */
12150 multi: (formats: any[][]) => TimeFormat;
12151
12152 utc: {
12153 /**
12154 * Constructs a new local time formatter using the given specifier.
12155 */
12156 (specifier: string): TimeFormat;
12157 /**
12158 * Returns a new multi-resolution UTC time format given the specified array of predicated formats.
12159 */
12160 multi: (formats: any[][]) => TimeFormat;
12161 };
12162
12163 /**
12164 * The full ISO 8601 UTC time format: "%Y-%m-%dT%H:%M:%S.%LZ".
12165 */
12166 iso: TimeFormat;
12167 };
12168
12169 scale: {
12170 /**
12171 * Constructs a new time scale with the default domain and range;
12172 * the ticks and tick format are configured for local time.
12173 */
12174 (): Scale.TimeScale;
12175 /**
12176 * Constructs a new time scale with the default domain and range;
12177 * the ticks and tick format are configured for UTC time.
12178 */
12179 utc(): Scale.TimeScale;
12180 };
12181 }
12182
12183 export interface Range {
12184 (start: Date, end: Date, step?: number): Date[];
12185 }
12186
12187 export interface Interval {
12188 (date: Date): Date;
12189 floor: (date: Date) => Date;
12190 round: (date: Date) => Date;
12191 ceil: (date: Date) => Date;
12192 range: Range;
12193 offset: (date: Date, step: number) => Date;
12194 utc?: Interval;
12195 }
12196
12197 export interface TimeFormat {
12198 (date: Date): string;
12199 parse: (string: string) => Date;
12200 }
12201 }
12202
12203 // Layout
12204 export module Layout {
12205 export interface Layout {
12206 /**
12207 * Creates a new Stack layout
12208 */
12209 stack(): StackLayout;
12210 /**
12211 * Creates a new pie layout
12212 */
12213 pie(): PieLayout;
12214 /**
12215 * Creates a new force layout
12216 */
12217 force(): ForceLayout;
12218 /**
12219 * Creates a new tree layout
12220 */
12221 tree(): TreeLayout;
12222 bundle(): BundleLayout;
12223 chord(): ChordLayout;
12224 cluster(): ClusterLayout;
12225 hierarchy(): HierarchyLayout;
12226 histogram(): HistogramLayout;
12227 pack(): PackLayout;
12228 partition(): PartitionLayout;
12229 treemap(): TreeMapLayout;
12230 }
12231
12232 export interface StackLayout {
12233 <T>(layers: T[], index?: number): T[];
12234 values(accessor?: (d: any) => any): StackLayout;
12235 offset(offset: string): StackLayout;
12236 x(accessor: (d: any, i: number) => any): StackLayout;
12237 y(accessor: (d: any, i: number) => any): StackLayout;
12238 out(setter: (d: any, y0: number, y: number) => void): StackLayout;
12239 }
12240
12241 export interface TreeLayout {
12242 /**
12243 * Gets or sets the sort order of sibling nodes for the layout using the specified comparator function
12244 */
12245 sort: {
12246 /**
12247 * Gets the sort order function of sibling nodes for the layout
12248 */
12249 (): (d1: any, d2: any) => number;
12250 /**
12251 * Sets the sort order of sibling nodes for the layout using the specified comparator function
12252 */
12253 (comparator: (d1: any, d2: any) => number): TreeLayout;
12254 };
12255 /**
12256 * Gets or sets the specified children accessor function
12257 */
12258 children: {
12259 /**
12260 * Gets the children accessor function
12261 */
12262 (): (d: any) => any;
12263 /**
12264 * Sets the specified children accessor function
12265 */
12266 (children: (d: any) => any): TreeLayout;
12267 };
12268 /**
12269 * Runs the tree layout
12270 */
12271 nodes(root: GraphNode): GraphNode[];
12272 /**
12273 * Given the specified array of nodes, such as those returned by nodes, returns an array of objects representing the links from parent to child for each node
12274 */
12275 links(nodes: GraphNode[]): GraphLink[];
12276 /**
12277 * If separation is specified, uses the specified function to compute separation between neighboring nodes. If separation is not specified, returns the current separation function
12278 */
12279 seperation: {
12280 /**
12281 * Gets the current separation function
12282 */
12283 (): (a: GraphNode, b: GraphNode) => number;
12284 /**
12285 * Sets the specified function to compute separation between neighboring nodes
12286 */
12287 (seperation: (a: GraphNode, b: GraphNode) => number): TreeLayout;
12288 };
12289 /**
12290 * Gets or sets the available layout size
12291 */
12292 size: {
12293 /**
12294 * Gets the available layout size
12295 */
12296 (): number[];
12297 /**
12298 * Sets the available layout size
12299 */
12300 (size: number[]): TreeLayout;
12301 };
12302 /**
12303 * Gets or sets the available node size
12304 */
12305 nodeSize: {
12306 /**
12307 * Gets the available node size
12308 */
12309 (): number[];
12310 /**
12311 * Sets the available node size
12312 */
12313 (size: number[]): TreeLayout;
12314 };
12315 }
12316
12317 export interface PieLayout {
12318 (values: any[], index?: number): ArcDescriptor[];
12319 value: {
12320 (): (d: any, index: number) => number;
12321 (accessor: (d: any, index: number) => number): PieLayout;
12322 };
12323 sort: {
12324 (): (d1: any, d2: any) => number;
12325 (comparator: (d1: any, d2: any) => number): PieLayout;
12326 };
12327 startAngle: {
12328 (): number;
12329 (angle: number): PieLayout;
12330 (angle: () => number): PieLayout;
12331 (angle: (d : any) => number): PieLayout;
12332 (angle: (d : any, i: number) => number): PieLayout;
12333 };
12334 endAngle: {
12335 (): number;
12336 (angle: number): PieLayout;
12337 (angle: () => number): PieLayout;
12338 (angle: (d : any) => number): PieLayout
12339 (angle: (d : any, i: number) => number): PieLayout;
12340 };
12341 }
12342
12343 export interface ArcDescriptor {
12344 value: any;
12345 data: any;
12346 startAngle: number;
12347 endAngle: number;
12348 index: number;
12349 }
12350
12351 export interface GraphNode {
12352 id?: number;
12353 index?: number;
12354 name: string;
12355 dx?: number;
12356 dy?: number;
12357 px?: number;
12358 py?: number;
12359 size?: number;
12360 weight?: number;
12361 x?: number;
12362 y?: number;
12363 subindex?: number;
12364 startAngle?: number;
12365 endAngle?: number;
12366 value?: number;
12367 fixed?: boolean;
12368 children?: GraphNode[];
12369 _children?: GraphNode[];
12370 parent?: GraphNode;
12371 depth?: number;
12372 }
12373
12374 export interface GraphLink {
12375 source: GraphNode;
12376 target: GraphNode;
12377 }
12378
12379 export interface GraphNodeForce {
12380 index?: number;
12381 x?: number;
12382 y?: number;
12383 px?: number;
12384 py?: number;
12385 fixed?: boolean;
12386 weight?: number;
12387 }
12388
12389 export interface GraphLinkForce {
12390 source: GraphNodeForce;
12391 target: GraphNodeForce;
12392 }
12393
12394 export interface ForceLayout {
12395 (): ForceLayout;
12396 size: {
12397 (): number;
12398 (mysize: number[]): ForceLayout;
12399 (accessor: (d: any, index: number) => {}): ForceLayout;
12400
12401 };
12402 linkDistance: {
12403 (): number;
12404 (number:number): ForceLayout;
12405 (accessor: (d: any, index: number) => number): ForceLayout;
12406 };
12407 linkStrength:
12408 {
12409 (): number;
12410 (number:number): ForceLayout;
12411 (accessor: (d: any, index: number) => number): ForceLayout;
12412 };
12413 friction:
12414 {
12415 (): number;
12416 (number:number): ForceLayout;
12417 (accessor: (d: any, index: number) => number): ForceLayout;
12418 };
12419 alpha: {
12420 (): number;
12421 (number:number): ForceLayout;
12422 (accessor: (d: any, index: number) => number): ForceLayout;
12423 };
12424 charge: {
12425 (): number;
12426 (number:number): ForceLayout;
12427 (accessor: (d: any, index: number) => number): ForceLayout;
12428 };
12429
12430 theta: {
12431 (): number;
12432 (number:number): ForceLayout;
12433 (accessor: (d: any, index: number) => number): ForceLayout;
12434 };
12435
12436 gravity: {
12437 (): number;
12438 (number:number): ForceLayout;
12439 (accessor: (d: any, index: number) => number): ForceLayout;
12440 };
12441
12442 links: {
12443 (): GraphLinkForce[];
12444 (arLinks: GraphLinkForce[]): ForceLayout;
12445
12446 };
12447 nodes:
12448 {
12449 (): GraphNodeForce[];
12450 (arNodes: GraphNodeForce[]): ForceLayout;
12451
12452 };
12453 start(): ForceLayout;
12454 resume(): ForceLayout;
12455 stop(): ForceLayout;
12456 tick(): ForceLayout;
12457 on(type: string, listener: () => void ): ForceLayout;
12458 drag(): ForceLayout;
12459 }
12460
12461 export interface BundleLayout{
12462 (links: GraphLink[]): GraphNode[][];
12463 }
12464
12465 export interface ChordLayout {
12466 matrix: {
12467 (): number[][];
12468 (matrix: number[][]): ChordLayout;
12469 }
12470 padding: {
12471 (): number;
12472 (padding: number): ChordLayout;
12473 }
12474 sortGroups: {
12475 (): (a: number, b: number) => number;
12476 (comparator: (a: number, b: number) => number): ChordLayout;
12477 }
12478 sortSubgroups: {
12479 (): (a: number, b: number) => number;
12480 (comparator: (a: number, b: number) => number): ChordLayout;
12481 }
12482 sortChords: {
12483 (): (a: number, b: number) => number;
12484 (comparator: (a: number, b: number) => number): ChordLayout;
12485 }
12486 chords(): GraphLink[];
12487 groups(): ArcDescriptor[];
12488 }
12489
12490 export interface ClusterLayout{
12491 sort: {
12492 (): (a: GraphNode, b: GraphNode) => number;
12493 (comparator: (a: GraphNode, b: GraphNode) => number): ClusterLayout;
12494 }
12495 children: {
12496 (): (d: any, i?: number) => GraphNode[];
12497 (children: (d: any, i?: number) => GraphNode[]): ClusterLayout;
12498 }
12499 nodes(root: GraphNode): GraphNode[];
12500 links(nodes: GraphNode[]): GraphLink[];
12501 seperation: {
12502 (): (a: GraphNode, b: GraphNode) => number;
12503 (seperation: (a: GraphNode, b: GraphNode) => number): ClusterLayout;
12504 }
12505 size: {
12506 (): number[];
12507 (size: number[]): ClusterLayout;
12508 }
12509 value: {
12510 (): (node: GraphNode) => number;
12511 (value: (node: GraphNode) => number): ClusterLayout;
12512 }
12513 }
12514
12515 export interface HierarchyLayout {
12516 sort: {
12517 (): (a: GraphNode, b: GraphNode) => number;
12518 (comparator: (a: GraphNode, b: GraphNode) => number): HierarchyLayout;
12519 }
12520 children: {
12521 (): (d: any, i?: number) => GraphNode[];
12522 (children: (d: any, i?: number) => GraphNode[]): HierarchyLayout;
12523 }
12524 nodes(root: GraphNode): GraphNode[];
12525 links(nodes: GraphNode[]): GraphLink[];
12526 value: {
12527 (): (node: GraphNode) => number;
12528 (value: (node: GraphNode) => number): HierarchyLayout;
12529 }
12530 reValue(root: GraphNode): HierarchyLayout;
12531 }
12532
12533 export interface Bin extends Array<any> {
12534 x: number;
12535 dx: number;
12536 y: number;
12537 }
12538
12539 export interface HistogramLayout {
12540 (values: any[], index?: number): Bin[];
12541 value: {
12542 (): (value: any) => any;
12543 (accessor: (value: any) => any): HistogramLayout
12544 }
12545 range: {
12546 (): (value: any, index: number) => number[];
12547 (range: (value: any, index: number) => number[]): HistogramLayout;
12548 (range: number[]): HistogramLayout;
12549 }
12550 bins: {
12551 (): (range: any[], index: number) => number[];
12552 (bins: (range: any[], index: number) => number[]): HistogramLayout;
12553 (bins: number): HistogramLayout;
12554 (bins: number[]): HistogramLayout;
12555 }
12556 frequency: {
12557 (): boolean;
12558 (frequency: boolean): HistogramLayout;
12559 }
12560 }
12561
12562 export interface PackLayout {
12563 sort: {
12564 (): (a: GraphNode, b: GraphNode) => number;
12565 (comparator: (a: GraphNode, b: GraphNode) => number): PackLayout;
12566 }
12567 children: {
12568 (): (d: any, i?: number) => GraphNode[];
12569 (children: (d: any, i?: number) => GraphNode[]): PackLayout;
12570 }
12571 nodes(root: GraphNode): GraphNode[];
12572 links(nodes: GraphNode[]): GraphLink[];
12573 value: {
12574 (): (node: GraphNode) => number;
12575 (value: (node: GraphNode) => number): PackLayout;
12576 }
12577 size: {
12578 (): number[];
12579 (size: number[]): PackLayout;
12580 }
12581 padding: {
12582 (): number;
12583 (padding: number): PackLayout;
12584 }
12585 }
12586
12587 export interface PartitionLayout {
12588 sort: {
12589 (): (a: GraphNode, b: GraphNode) => number;
12590 (comparator: (a: GraphNode, b: GraphNode) => number): PackLayout;
12591 }
12592 children: {
12593 (): (d: any, i?: number) => GraphNode[];
12594 (children: (d: any, i?: number) => GraphNode[]): PackLayout;
12595 }
12596 nodes(root: GraphNode): GraphNode[];
12597 links(nodes: GraphNode[]): GraphLink[];
12598 value: {
12599 (): (node: GraphNode) => number;
12600 (value: (node: GraphNode) => number): PackLayout;
12601 }
12602 size: {
12603 (): number[];
12604 (size: number[]): PackLayout;
12605 }
12606 }
12607
12608 export interface TreeMapLayout {
12609 sort: {
12610 (): (a: GraphNode, b: GraphNode) => number;
12611 (comparator: (a: GraphNode, b: GraphNode) => number): TreeMapLayout;
12612 }
12613 children: {
12614 (): (d: any, i?: number) => GraphNode[];
12615 (children: (d: any, i?: number) => GraphNode[]): TreeMapLayout;
12616 }
12617 nodes(root: GraphNode): GraphNode[];
12618 links(nodes: GraphNode[]): GraphLink[];
12619 value: {
12620 (): (node: GraphNode) => number;
12621 (value: (node: GraphNode) => number): TreeMapLayout;
12622 }
12623 size: {
12624 (): number[];
12625 (size: number[]): TreeMapLayout;
12626 }
12627 padding: {
12628 (): number;
12629 (padding: number): TreeMapLayout;
12630 }
12631 round: {
12632 (): boolean;
12633 (round: boolean): TreeMapLayout;
12634 }
12635 sticky: {
12636 (): boolean;
12637 (sticky: boolean): TreeMapLayout;
12638 }
12639 mode: {
12640 (): string;
12641 (mode: string): TreeMapLayout;
12642 }
12643 }
12644 }
12645
12646 // Color
12647 export module Color {
12648 export interface Color {
12649 /**
12650 * increase lightness by some exponential factor (gamma)
12651 */
12652 brighter(k?: number): Color;
12653 /**
12654 * decrease lightness by some exponential factor (gamma)
12655 */
12656 darker(k?: number): Color;
12657 /**
12658 * convert the color to a string.
12659 */
12660 toString(): string;
12661 }
12662
12663 export interface RGBColor extends Color{
12664 /**
12665 * the red color channel.
12666 */
12667 r: number;
12668 /**
12669 * the green color channel.
12670 */
12671 g: number;
12672 /**
12673 * the blue color channel.
12674 */
12675 b: number;
12676 /**
12677 * convert from RGB to HSL.
12678 */
12679 hsl(): HSLColor;
12680 }
12681
12682 export interface HSLColor extends Color{
12683 /**
12684 * hue
12685 */
12686 h: number;
12687 /**
12688 * saturation
12689 */
12690 s: number;
12691 /**
12692 * lightness
12693 */
12694 l: number;
12695 /**
12696 * convert from HSL to RGB.
12697 */
12698 rgb(): RGBColor;
12699 }
12700
12701 export interface LABColor extends Color{
12702 /**
12703 * lightness
12704 */
12705 l: number;
12706 /**
12707 * a-dimension
12708 */
12709 a: number;
12710 /**
12711 * b-dimension
12712 */
12713 b: number;
12714 /**
12715 * convert from LAB to RGB.
12716 */
12717 rgb(): RGBColor;
12718 }
12719
12720 export interface HCLColor extends Color{
12721 /**
12722 * hue
12723 */
12724 h: number;
12725 /**
12726 * chroma
12727 */
12728 c: number;
12729 /**
12730 * luminance
12731 */
12732 l: number;
12733 /**
12734 * convert from HCL to RGB.
12735 */
12736 rgb(): RGBColor;
12737 }
12738 }
12739
12740 // SVG
12741 export module Svg {
12742 export interface Svg {
12743 /**
12744 * Create a new symbol generator
12745 */
12746 symbol(): Symbol;
12747 /**
12748 * Create a new axis generator
12749 */
12750 axis(): Axis;
12751 /**
12752 * Create a new arc generator
12753 */
12754 arc(): Arc;
12755 /**
12756 * Create a new line generator
12757 */
12758 line: {
12759 (): Line;
12760 radial(): LineRadial;
12761 }
12762 /**
12763 * Create a new area generator
12764 */
12765 area: {
12766 (): Area;
12767 radial(): AreaRadial;
12768 }
12769 /**
12770 * Create a new brush generator
12771 */
12772 brush(): Brush;
12773 /**
12774 * Create a new chord generator
12775 */
12776 chord(): Chord;
12777 /**
12778 * Create a new diagonal generator
12779 */
12780 diagonal: {
12781 (): Diagonal;
12782 radial(): Diagonal;
12783 }
12784 /**
12785 * The array of supported symbol types.
12786 */
12787 symbolTypes: string[];
12788 }
12789
12790 export interface Symbol {
12791 type: (string:string) => Symbol;
12792 size: (number:number) => Symbol;
12793 (datum:any, index:number): string;
12794 }
12795
12796 export interface Brush {
12797 /**
12798 * Draws or redraws this brush into the specified selection of elements
12799 */
12800 (selection: Selection): void;
12801 /**
12802 * Gets or sets the x-scale associated with the brush
12803 */
12804 x: {
12805 /**
12806 * Gets the x-scale associated with the brush
12807 */
12808 (): D3.Scale.Scale;
12809 /**
12810 * Sets the x-scale associated with the brush
12811 *
12812 * @param accessor The new Scale
12813 */
12814 (scale: D3.Scale.Scale): Brush;
12815 };
12816 /**
12817 * Gets or sets the x-scale associated with the brush
12818 */
12819 y: {
12820 /**
12821 * Gets the x-scale associated with the brush
12822 */
12823 (): D3.Scale.Scale;
12824 /**
12825 * Sets the x-scale associated with the brush
12826 *
12827 * @param accessor The new Scale
12828 */
12829 (scale: D3.Scale.Scale): Brush;
12830 };
12831 /**
12832 * Gets or sets the current brush extent
12833 */
12834 extent: {
12835 /**
12836 * Gets the current brush extent
12837 */
12838 (): any[];
12839 /**
12840 * Sets the current brush extent
12841 */
12842 (values: any[]): Brush;
12843 };
12844 /**
12845 * Clears the extent, making the brush extent empty.
12846 */
12847 clear(): Brush;
12848 /**
12849 * Returns true if and only if the brush extent is empty
12850 */
12851 empty(): boolean;
12852 /**
12853 * Gets or sets the listener for the specified event type
12854 */
12855 on: {
12856 /**
12857 * Gets the listener for the specified event type
12858 */
12859 (type: string): (data: any, index: number) => any;
12860 /**
12861 * Sets the listener for the specified event type
12862 */
12863 (type: string, listener: (data: any, index: number) => any, capture?: boolean): Brush;
12864 };
12865 }
12866
12867 export interface Axis {
12868 (selection: Selection): void;
12869 scale: {
12870 (): any;
12871 (scale: any): Axis;
12872 };
12873
12874 orient: {
12875 (): string;
12876 (orientation: string): Axis;
12877 };
12878
12879 ticks: {
12880 (): any[];
12881 (...arguments: any[]): Axis;
12882 };
12883
12884 tickPadding: {
12885 (): number;
12886 (padding: number): Axis;
12887 };
12888
12889 tickValues: {
12890 (): any[];
12891 (values: any[]): Axis;
12892 };
12893 tickSubdivide(count: number): Axis;
12894 tickSize: {
12895 (): number;
12896 (inner: number, outer?: number): Axis;
12897 }
12898 innerTickSize: {
12899 (): number;
12900 (value: number): Axis;
12901 }
12902 outerTickSize: {
12903 (): number;
12904 (value: number): Axis;
12905 }
12906 tickFormat(): (any) => string;
12907 tickFormat(formatter: (value: any) => string): Axis;
12908 nice(count?: number): Axis;
12909 }
12910
12911 export interface Arc {
12912 /**
12913 * Returns the path data string
12914 *
12915 * @param data Array of data elements
12916 * @param index Optional index
12917 */
12918 (data: any, index?: number): string;
12919 innerRadius: {
12920 (): (data: any, index?: number) => number;
12921 (radius: number): Arc;
12922 (radius: () => number): Arc;
12923 (radius: (data: any) => number): Arc;
12924 (radius: (data: any, index: number) => number): Arc;
12925 };
12926 outerRadius: {
12927 (): (data: any, index?: number) => number;
12928 (radius: number): Arc;
12929 (radius: () => number): Arc;
12930 (radius: (data: any) => number): Arc;
12931 (radius: (data: any, index: number) => number): Arc;
12932 };
12933 startAngle: {
12934 (): (data: any, index?: number) => number;
12935 (angle: number): Arc;
12936 (angle: () => number): Arc;
12937 (angle: (data: any) => number): Arc;
12938 (angle: (data: any, index: number) => number): Arc;
12939 };
12940 endAngle: {
12941 (): (data: any, index?: number) => number;
12942 (angle: number): Arc;
12943 (angle: () => number): Arc;
12944 (angle: (data: any) => number): Arc;
12945 (angle: (data: any, index: number) => number): Arc;
12946 };
12947 centroid(data: any, index?: number): number[];
12948 }
12949
12950 export interface Line {
12951 /**
12952 * Returns the path data string
12953 *
12954 * @param data Array of data elements
12955 * @param index Optional index
12956 */
12957 (data: any[], index?: number): string;
12958 /**
12959 * Get or set the x-coordinate accessor.
12960 */
12961 x: {
12962 /**
12963 * Get the x-coordinate accessor.
12964 */
12965 (): (data: any, index ?: number) => number;
12966 /**
12967 * Set the x-coordinate accessor.
12968 *
12969 * @param accessor The new accessor function
12970 */
12971 (accessor: (data: any) => number): Line;
12972 (accessor: (data: any, index: number) => number): Line;
12973 /**
12974 * Set the x-coordinate to a constant.
12975 *
12976 * @param cnst The new constant value.
12977 */
12978 (cnst: number): Line;
12979 };
12980 /**
12981 * Get or set the y-coordinate accessor.
12982 */
12983 y: {
12984 /**
12985 * Get the y-coordinate accessor.
12986 */
12987 (): (data: any, index ?: number) => number;
12988 /**
12989 * Set the y-coordinate accessor.
12990 *
12991 * @param accessor The new accessor function
12992 */
12993 (accessor: (data: any) => number): Line;
12994 (accessor: (data: any, index: number) => number): Line;
12995 /**
12996 * Set the y-coordinate to a constant.
12997 *
12998 * @param cnst The new constant value.
12999 */
13000 (cnst: number): Line;
13001 };
13002 /**
13003 * Get or set the interpolation mode.
13004 */
13005 interpolate: {
13006 /**
13007 * Get the interpolation accessor.
13008 */
13009 (): string;
13010 /**
13011 * Set the interpolation accessor.
13012 *
13013 * @param interpolate The interpolation mode
13014 */
13015 (interpolate: string): Line;
13016 };
13017 /**
13018 * Get or set the cardinal spline tension.
13019 */
13020 tension: {
13021 /**
13022 * Get the cardinal spline accessor.
13023 */
13024 (): number;
13025 /**
13026 * Set the cardinal spline accessor.
13027 *
13028 * @param tension The Cardinal spline interpolation tension
13029 */
13030 (tension: number): Line;
13031 };
13032 /**
13033 * Control whether the line is defined at a given point.
13034 */
13035 defined: {
13036 /**
13037 * Get the accessor function that controls where the line is defined.
13038 */
13039 (): (data: any, index?: number) => boolean;
13040 /**
13041 * Set the accessor function that controls where the area is defined.
13042 *
13043 * @param defined The new accessor function
13044 */
13045 (defined: (data: any, index?: number) => boolean): Line;
13046 };
13047 }
13048
13049 export interface LineRadial {
13050 /**
13051 * Returns the path data string
13052 *
13053 * @param data Array of data elements
13054 * @param index Optional index
13055 */
13056 (data: any[], index?: number): string;
13057 /**
13058 * Get or set the x-coordinate accessor.
13059 */
13060 x: {
13061 /**
13062 * Get the x-coordinate accessor.
13063 */
13064 (): (data: any, index ?: number) => number;
13065 /**
13066 * Set the x-coordinate accessor.
13067 *
13068 * @param accessor The new accessor function
13069 */
13070 (accessor: (data: any) => number): LineRadial;
13071 (accessor: (data: any, index: number) => number): LineRadial;
13072
13073 /**
13074 * Set the x-coordinate to a constant.
13075 *
13076 * @param cnst The new constant value.
13077 */
13078 (cnst: number): LineRadial;
13079 };
13080 /**
13081 * Get or set the y-coordinate accessor.
13082 */
13083 y: {
13084 /**
13085 * Get the y-coordinate accessor.
13086 */
13087 (): (data: any, index ?: number) => number;
13088 /**
13089 * Set the y-coordinate accessor.
13090 *
13091 * @param accessor The new accessor function
13092 */
13093 (accessor: (data: any) => number): LineRadial;
13094 (accessor: (data: any, index: number) => number): LineRadial;
13095 /**
13096 * Set the y-coordinate to a constant.
13097 *
13098 * @param cnst The new constant value.
13099 */
13100 (cnst: number): LineRadial;
13101 };
13102 /**
13103 * Get or set the interpolation mode.
13104 */
13105 interpolate: {
13106 /**
13107 * Get the interpolation accessor.
13108 */
13109 (): string;
13110 /**
13111 * Set the interpolation accessor.
13112 *
13113 * @param interpolate The interpolation mode
13114 */
13115 (interpolate: string): LineRadial;
13116 };
13117 /**
13118 * Get or set the cardinal spline tension.
13119 */
13120 tension: {
13121 /**
13122 * Get the cardinal spline accessor.
13123 */
13124 (): number;
13125 /**
13126 * Set the cardinal spline accessor.
13127 *
13128 * @param tension The Cardinal spline interpolation tension
13129 */
13130 (tension: number): LineRadial;
13131 };
13132 /**
13133 * Control whether the line is defined at a given point.
13134 */
13135 defined: {
13136 /**
13137 * Get the accessor function that controls where the line is defined.
13138 */
13139 (): (data: any) => any;
13140 /**
13141 * Set the accessor function that controls where the area is defined.
13142 *
13143 * @param defined The new accessor function
13144 */
13145 (defined: (data: any) => any): LineRadial;
13146 };
13147 radius: {
13148 (): (d: any, i?: number) => number;
13149 (radius: number): LineRadial;
13150 (radius: (d: any) => number): LineRadial;
13151 (radius: (d: any, i: number) => number): LineRadial;
13152 }
13153 angle: {
13154 (): (d: any, i?: any) => number;
13155 (angle: number): LineRadial;
13156 (angle: (d: any) => number): LineRadial;
13157 (angle: (d: any, i: any) => number): LineRadial;
13158 }
13159 }
13160
13161 export interface Area {
13162 /**
13163 * Generate a piecewise linear area, as in an area chart.
13164 */
13165 (data: any[], index?: number): string;
13166 /**
13167 * Get or set the x-coordinate accessor.
13168 */
13169 x: {
13170 /**
13171 * Get the x-coordinate accessor.
13172 */
13173 (): (data: any, index ?: number) => number;
13174 /**
13175 * Set the x-coordinate accessor.
13176 *
13177 * @param accessor The new accessor function
13178 */
13179 (accessor: (data: any) => number): Area;
13180 (accessor: (data: any, index: number) => number): Area;
13181 /**
13182 * Set the x-coordinate to a constant.
13183 *
13184 * @param cnst The new constant value.
13185 */
13186 (cnst: number): Area;
13187 };
13188 /**
13189 * Get or set the x0-coordinate (baseline) accessor.
13190 */
13191 x0: {
13192 /**
13193 * Get the x0-coordinate (baseline) accessor.
13194 */
13195 (): (data: any, index ?: number) => number;
13196 /**
13197 * Set the x0-coordinate (baseline) accessor.
13198 *
13199 * @param accessor The new accessor function
13200 */
13201 (accessor: (data: any) => number): Area;
13202 (accessor: (data: any, index: number) => number): Area;
13203 /**
13204 * Set the x0-coordinate (baseline) to a constant.
13205 *
13206 * @param cnst The new constant value.
13207 */
13208 (cnst: number): Area;
13209 };
13210 /**
13211 * Get or set the x1-coordinate (topline) accessor.
13212 */
13213 x1: {
13214 /**
13215 * Get the x1-coordinate (topline) accessor.
13216 */
13217 (): (data: any, index ?: number) => number;
13218 /**
13219 * Set the x1-coordinate (topline) accessor.
13220 *
13221 * @param accessor The new accessor function
13222 */
13223 (accessor: (data: any) => number): Area;
13224 (accessor: (data: any, index: number) => number): Area;
13225 /**
13226 * Set the x1-coordinate (topline) to a constant.
13227 *
13228 * @param cnst The new constant value.
13229 */
13230 (cnst: number): Area;
13231 };
13232 /**
13233 * Get or set the y-coordinate accessor.
13234 */
13235 y: {
13236 /**
13237 * Get the y-coordinate accessor.
13238 */
13239 (): (data: any, index ?: number) => number;
13240 /**
13241 * Set the y-coordinate accessor.
13242 *
13243 * @param accessor The new accessor function
13244 */
13245 (accessor: (data: any) => number): Area;
13246 (accessor: (data: any, index: number) => number): Area;
13247 /**
13248 * Set the y-coordinate to a constant.
13249 *
13250 * @param cnst The constant value
13251 */
13252 (cnst: number): Area;
13253 };
13254 /**
13255 * Get or set the y0-coordinate (baseline) accessor.
13256 */
13257 y0: {
13258 /**
13259 * Get the y0-coordinate (baseline) accessor.
13260 */
13261 (): (data: any, index ?: number) => number;
13262 /**
13263 * Set the y0-coordinate (baseline) accessor.
13264 *
13265 * @param accessor The new accessor function
13266 */
13267 (accessor: (data: any) => number): Area;
13268 (accessor: (data: any, index: number) => number): Area;
13269 /**
13270 * Set the y0-coordinate (baseline) to a constant.
13271 *
13272 * @param cnst The constant value
13273 */
13274 (cnst: number): Area;
13275 };
13276 /**
13277 * Get or set the y1-coordinate (topline) accessor.
13278 */
13279 y1: {
13280 /**
13281 * Get the y1-coordinate (topline) accessor.
13282 */
13283 (): (data: any, index ?: number) => number;
13284 /**
13285 * Set the y1-coordinate (topline) accessor.
13286 *
13287 * @param accessor The new accessor function
13288 */
13289 (accessor: (data: any) => number): Area;
13290 (accessor: (data: any, index: number) => number): Area;
13291 /**
13292 * Set the y1-coordinate (baseline) to a constant.
13293 *
13294 * @param cnst The constant value
13295 */
13296 (cnst: number): Area;
13297 };
13298 /**
13299 * Get or set the interpolation mode.
13300 */
13301 interpolate: {
13302 /**
13303 * Get the interpolation accessor.
13304 */
13305 (): string;
13306 /**
13307 * Set the interpolation accessor.
13308 *
13309 * @param interpolate The interpolation mode
13310 */
13311 (interpolate: string): Area;
13312 };
13313 /**
13314 * Get or set the cardinal spline tension.
13315 */
13316 tension: {
13317 /**
13318 * Get the cardinal spline accessor.
13319 */
13320 (): number;
13321 /**
13322 * Set the cardinal spline accessor.
13323 *
13324 * @param tension The Cardinal spline interpolation tension
13325 */
13326 (tension: number): Area;
13327 };
13328 /**
13329 * Control whether the area is defined at a given point.
13330 */
13331 defined: {
13332 /**
13333 * Get the accessor function that controls where the area is defined.
13334 */
13335 (): (data: any, index?: number) => any;
13336 /**
13337 * Set the accessor function that controls where the area is defined.
13338 *
13339 * @param defined The new accessor function
13340 */
13341 (defined: (data: any, index?: number) => any): Area;
13342 };
13343 }
13344
13345 export interface AreaRadial {
13346 /**
13347 * Generate a piecewise linear area, as in an area chart.
13348 */
13349 (data: any[], index?: number): string;
13350 /**
13351 * Get or set the x-coordinate accessor.
13352 */
13353 x: {
13354 /**
13355 * Get the x-coordinate accessor.
13356 */
13357 (): (data: any, index ?: number) => number;
13358 /**
13359 * Set the x-coordinate accessor.
13360 *
13361 * @param accessor The new accessor function
13362 */
13363 (accessor: (data: any) => number): AreaRadial;
13364 (accessor: (data: any, index: number) => number): AreaRadial;
13365 /**
13366 * Set the x-coordinate to a constant.
13367 *
13368 * @param cnst The new constant value.
13369 */
13370 (cnst: number): AreaRadial;
13371 };
13372 /**
13373 * Get or set the x0-coordinate (baseline) accessor.
13374 */
13375 x0: {
13376 /**
13377 * Get the x0-coordinate (baseline) accessor.
13378 */
13379 (): (data: any, index ?: number) => number;
13380 /**
13381 * Set the x0-coordinate (baseline) accessor.
13382 *
13383 * @param accessor The new accessor function
13384 */
13385 (accessor: (data: any) => number): AreaRadial;
13386 (accessor: (data: any, index: number) => number): AreaRadial;
13387 /**
13388 * Set the x0-coordinate to a constant.
13389 *
13390 * @param cnst The new constant value.
13391 */
13392 (cnst: number): AreaRadial;
13393 };
13394 /**
13395 * Get or set the x1-coordinate (topline) accessor.
13396 */
13397 x1: {
13398 /**
13399 * Get the x1-coordinate (topline) accessor.
13400 */
13401 (): (data: any, index ?: number) => number;
13402 /**
13403 * Set the x1-coordinate (topline) accessor.
13404 *
13405 * @param accessor The new accessor function
13406 */
13407 (accessor: (data: any) => number): AreaRadial;
13408 (accessor: (data: any, index: number) => number): AreaRadial;
13409 /**
13410 * Set the x1-coordinate to a constant.
13411 *
13412 * @param cnst The new constant value.
13413 */
13414 (cnst: number): AreaRadial;
13415 };
13416 /**
13417 * Get or set the y-coordinate accessor.
13418 */
13419 y: {
13420 /**
13421 * Get the y-coordinate accessor.
13422 */
13423 (): (data: any, index ?: number) => number;
13424 /**
13425 * Set the y-coordinate accessor.
13426 *
13427 * @param accessor The new accessor function
13428 */
13429 (accessor: (data: any) => number): AreaRadial;
13430 (accessor: (data: any, index: number) => number): AreaRadial;
13431 /**
13432 * Set the y-coordinate to a constant.
13433 *
13434 * @param cnst The new constant value.
13435 */
13436 (cnst: number): AreaRadial;
13437 };
13438 /**
13439 * Get or set the y0-coordinate (baseline) accessor.
13440 */
13441 y0: {
13442 /**
13443 * Get the y0-coordinate (baseline) accessor.
13444 */
13445 (): (data: any, index ?: number) => number;
13446 /**
13447 * Set the y0-coordinate (baseline) accessor.
13448 *
13449 * @param accessor The new accessor function
13450 */
13451 (accessor: (data: any) => number): AreaRadial;
13452 (accessor: (data: any, index: number) => number): AreaRadial;
13453 /**
13454 * Set the y0-coordinate to a constant.
13455 *
13456 * @param cnst The new constant value.
13457 */
13458 (cnst: number): AreaRadial;
13459 };
13460 /**
13461 * Get or set the y1-coordinate (topline) accessor.
13462 */
13463 y1: {
13464 /**
13465 * Get the y1-coordinate (topline) accessor.
13466 */
13467 (): (data: any, index ?: number) => number;
13468 /**
13469 * Set the y1-coordinate (topline) accessor.
13470 *
13471 * @param accessor The new accessor function
13472 */
13473 (accessor: (data: any) => number): AreaRadial;
13474 (accessor: (data: any, index: number) => number): AreaRadial;
13475 /**
13476 * Set the y1-coordinate to a constant.
13477 *
13478 * @param cnst The new constant value.
13479 */
13480 (cnst: number): AreaRadial;
13481 };
13482 /**
13483 * Get or set the interpolation mode.
13484 */
13485 interpolate: {
13486 /**
13487 * Get the interpolation accessor.
13488 */
13489 (): string;
13490 /**
13491 * Set the interpolation accessor.
13492 *
13493 * @param interpolate The interpolation mode
13494 */
13495 (interpolate: string): AreaRadial;
13496 };
13497 /**
13498 * Get or set the cardinal spline tension.
13499 */
13500 tension: {
13501 /**
13502 * Get the cardinal spline accessor.
13503 */
13504 (): number;
13505 /**
13506 * Set the cardinal spline accessor.
13507 *
13508 * @param tension The Cardinal spline interpolation tension
13509 */
13510 (tension: number): AreaRadial;
13511 };
13512 /**
13513 * Control whether the area is defined at a given point.
13514 */
13515 defined: {
13516 /**
13517 * Get the accessor function that controls where the area is defined.
13518 */
13519 (): (data: any) => any;
13520 /**
13521 * Set the accessor function that controls where the area is defined.
13522 *
13523 * @param defined The new accessor function
13524 */
13525 (defined: (data: any) => any): AreaRadial;
13526 };
13527 radius: {
13528 (): number;
13529 (radius: number): AreaRadial;
13530 (radius: () => number): AreaRadial;
13531 (radius: (data: any) => number): AreaRadial;
13532 (radius: (data: any, index: number) => number): AreaRadial;
13533 };
13534 innerRadius: {
13535 (): number;
13536 (radius: number): AreaRadial;
13537 (radius: () => number): AreaRadial;
13538 (radius: (data: any) => number): AreaRadial;
13539 (radius: (data: any, index: number) => number): AreaRadial;
13540 };
13541 outerRadius: {
13542 (): number;
13543 (radius: number): AreaRadial;
13544 (radius: () => number): AreaRadial;
13545 (radius: (data: any) => number): AreaRadial;
13546 (radius: (data: any, index: number) => number): AreaRadial;
13547 };
13548 angle: {
13549 (): number;
13550 (angle: number): AreaRadial;
13551 (angle: () => number): AreaRadial;
13552 (angle: (data: any) => number): AreaRadial;
13553 (angle: (data: any, index: number) => number): AreaRadial;
13554 };
13555 startAngle: {
13556 (): number;
13557 (angle: number): AreaRadial;
13558 (angle: () => number): AreaRadial;
13559 (angle: (data: any) => number): AreaRadial;
13560 (angle: (data: any, index: number) => number): AreaRadial;
13561 };
13562 endAngle: {
13563 (): number;
13564 (angle: number): AreaRadial;
13565 (angle: () => number): AreaRadial;
13566 (angle: (data: any) => number): AreaRadial;
13567 (angle: (data: any, index: number) => number): AreaRadial;
13568 };
13569 }
13570
13571 export interface Chord {
13572 (datum: any, index?: number): string;
13573 radius: {
13574 (): number;
13575 (radius: number): Chord;
13576 (radius: () => number): Chord;
13577 };
13578 startAngle: {
13579 (): number;
13580 (angle: number): Chord;
13581 (angle: () => number): Chord;
13582 };
13583 endAngle: {
13584 (): number;
13585 (angle: number): Chord;
13586 (angle: () => number): Chord;
13587 };
13588 source: {
13589 (): any;
13590 (angle: any): Chord;
13591 (angle: (d: any, i?: number) => any): Chord;
13592 };
13593 target: {
13594 (): any;
13595 (angle: any): Chord;
13596 (angle: (d: any, i?: number) => any): Chord;
13597 };
13598 }
13599
13600 export interface Diagonal {
13601 (datum: any, index?: number): string;
13602 projection: {
13603 (): (datum: any, index?: number) => number[];
13604 (proj: (datum: any) => number[]): Diagonal;
13605 (proj: (datum: any, index: number) => number[]): Diagonal;
13606 };
13607 source: {
13608 (): (datum: any, index?: number) => any;
13609 (src: (datum: any) => any): Diagonal;
13610 (src: (datum: any, index: number) => any): Diagonal;
13611 (src: any): Diagonal;
13612 };
13613 target: {
13614 (): (datum: any, index?: number) => any;
13615 (target: (d: any) => any): Diagonal;
13616 (target: (d: any, i: number) => any): Diagonal;
13617 (target: any): Diagonal;
13618 };
13619 }
13620 }
13621
13622 // Scales
13623 export module Scale {
13624 export interface ScaleBase {
13625 /**
13626 * Construct a linear quantitative scale.
13627 */
13628 linear(): LinearScale;
13629 /*
13630 * Construct an ordinal scale.
13631 */
13632 ordinal(): OrdinalScale;
13633 /**
13634 * Construct a linear quantitative scale with a discrete output range.
13635 */
13636 quantize(): QuantizeScale;
13637 /*
13638 * Construct an ordinal scale with ten categorical colors.
13639 */
13640 category10(): OrdinalScale;
13641 /*
13642 * Construct an ordinal scale with twenty categorical colors
13643 */
13644 category20(): OrdinalScale;
13645 /*
13646 * Construct an ordinal scale with twenty categorical colors
13647 */
13648 category20b(): OrdinalScale;
13649 /*
13650 * Construct an ordinal scale with twenty categorical colors
13651 */
13652 category20c(): OrdinalScale;
13653 /*
13654 * Construct a linear identity scale.
13655 */
13656 identity(): IdentityScale;
13657 /*
13658 * Construct a quantitative scale with an logarithmic transform.
13659 */
13660 log(): LogScale;
13661 /*
13662 * Construct a quantitative scale with an exponential transform.
13663 */
13664 pow(): PowScale;
13665 /*
13666 * Construct a quantitative scale mapping to quantiles.
13667 */
13668 quantile(): QuantileScale;
13669 /*
13670 * Construct a quantitative scale with a square root transform.
13671 */
13672 sqrt(): SqrtScale;
13673 /*
13674 * Construct a threshold scale with a discrete output range.
13675 */
13676 threshold(): ThresholdScale;
13677 }
13678
13679 export interface GenericScale<S> {
13680 (value: any): any;
13681 domain: {
13682 (values: any[]): S;
13683 (): any[];
13684 };
13685 range: {
13686 (values: any[]): S;
13687 (): any[];
13688 };
13689 invertExtent?(y: any): any[];
13690 copy(): S;
13691 }
13692
13693 export interface Scale extends GenericScale<Scale> { }
13694
13695 export interface GenericQuantitativeScale<S> extends GenericScale<S> {
13696 /**
13697 * Get the range value corresponding to a given domain value.
13698 *
13699 * @param value Domain Value
13700 */
13701 (value: number): number;
13702 /**
13703 * Get the domain value corresponding to a given range value.
13704 *
13705 * @param value Range Value
13706 */
13707 invert(value: number): number;
13708 /**
13709 * Set the scale's output range, and enable rounding.
13710 *
13711 * @param value The output range.
13712 */
13713 rangeRound: (values: any[]) => S;
13714 /**
13715 * get or set the scale's output interpolator.
13716 */
13717 interpolate: {
13718 (): D3.Transition.Interpolate;
13719 (factory: D3.Transition.Interpolate): S;
13720 };
13721 /**
13722 * enable or disable clamping of the output range.
13723 *
13724 * @param clamp Enable or disable
13725 */
13726 clamp: {
13727 (): boolean;
13728 (clamp: boolean): S;
13729 }
13730 /**
13731 * extend the scale domain to nice round numbers.
13732 *
13733 * @param count Optional number of ticks to exactly fit the domain
13734 */
13735 nice(count?: number): S;
13736 /**
13737 * get representative values from the input domain.
13738 *
13739 * @param count Aproximate representative values to return.
13740 */
13741 ticks(count: number): any[];
13742 /**
13743 * get a formatter for displaying tick values
13744 *
13745 * @param count Aproximate representative values to return
13746 */
13747 tickFormat(count: number, format?: string): (n: number) => string;
13748 }
13749
13750 export interface QuantitativeScale extends GenericQuantitativeScale<QuantitativeScale> { }
13751
13752 export interface LinearScale extends GenericQuantitativeScale<LinearScale> { }
13753
13754 export interface IdentityScale extends GenericScale<IdentityScale> {
13755 /**
13756 * Get the range value corresponding to a given domain value.
13757 *
13758 * @param value Domain Value
13759 */
13760 (value: number): number;
13761 /**
13762 * Get the domain value corresponding to a given range value.
13763 *
13764 * @param value Range Value
13765 */
13766 invert(value: number): number;
13767 /**
13768 * get representative values from the input domain.
13769 *
13770 * @param count Aproximate representative values to return.
13771 */
13772 ticks(count: number): any[];
13773 /**
13774 * get a formatter for displaying tick values
13775 *
13776 * @param count Aproximate representative values to return
13777 */
13778 tickFormat(count: number): (n: number) => string;
13779 }
13780
13781 export interface SqrtScale extends GenericQuantitativeScale<SqrtScale> { }
13782
13783 export interface PowScale extends GenericQuantitativeScale<PowScale> { }
13784
13785 export interface LogScale extends GenericQuantitativeScale<LogScale> { }
13786
13787 export interface OrdinalScale extends GenericScale<OrdinalScale> {
13788 rangePoints(interval: any[], padding?: number): OrdinalScale;
13789 rangeBands(interval: any[], padding?: number, outerPadding?: number): OrdinalScale;
13790 rangeRoundBands(interval: any[], padding?: number, outerPadding?: number): OrdinalScale;
13791 rangeBand(): number;
13792 rangeExtent(): any[];
13793 }
13794
13795 export interface QuantizeScale extends GenericScale<QuantizeScale> { }
13796
13797 export interface ThresholdScale extends GenericScale<ThresholdScale> { }
13798
13799 export interface QuantileScale extends GenericScale<QuantileScale> {
13800 quantiles(): any[];
13801 }
13802
13803 export interface TimeScale extends GenericScale<TimeScale> {
13804 (value: Date): number;
13805 invert(value: number): Date;
13806 rangeRound: (values: any[]) => TimeScale;
13807 interpolate: {
13808 (): D3.Transition.Interpolate;
13809 (factory: D3.Transition.InterpolateFactory): TimeScale;
13810 };
13811 clamp(clamp: boolean): TimeScale;
13812 ticks: {
13813 (count: number): any[];
13814 (range: D3.Time.Range, count: number): any[];
13815 };
13816 tickFormat(count: number): (n: number) => string;
13817 nice(count?: number): TimeScale;
13818 }
13819 }
13820
13821 // Behaviour
13822 export module Behavior {
13823 export interface Behavior{
13824 /**
13825 * Constructs a new drag behaviour
13826 */
13827 drag(): Drag;
13828 /**
13829 * Constructs a new zoom behaviour
13830 */
13831 zoom(): Zoom;
13832 }
13833
13834 export interface Zoom {
13835 /**
13836 * Applies the zoom behavior to the specified selection,
13837 * registering the necessary event listeners to support
13838 * panning and zooming.
13839 */
13840 (selection: Selection): void;
13841
13842 /**
13843 * Registers a listener to receive events
13844 *
13845 * @param type Enent name to attach the listener to
13846 * @param listener Function to attach to event
13847 */
13848 on: (type: string, listener: (data: any, index?: number) => any) => Zoom;
13849
13850 /**
13851 * Gets or set the current zoom scale
13852 */
13853 scale: {
13854 /**
13855 * Get the current current zoom scale
13856 */
13857 (): number;
13858 /**
13859 * Set the current current zoom scale
13860 *
13861 * @param origin Zoom scale
13862 */
13863 (scale: number): Zoom;
13864 };
13865
13866 /**
13867 * Gets or set the current zoom translation vector
13868 */
13869 translate: {
13870 /**
13871 * Get the current zoom translation vector
13872 */
13873 (): number[];
13874 /**
13875 * Set the current zoom translation vector
13876 *
13877 * @param translate Tranlation vector
13878 */
13879 (translate: number[]): Zoom;
13880 };
13881
13882 /**
13883 * Gets or set the allowed scale range
13884 */
13885 scaleExtent: {
13886 /**
13887 * Get the current allowed zoom range
13888 */
13889 (): number[];
13890 /**
13891 * Set the allowable zoom range
13892 *
13893 * @param extent Allowed zoom range
13894 */
13895 (extent: number[]): Zoom;
13896 };
13897
13898 /**
13899 * Gets or set the X-Scale that should be adjusted when zooming
13900 */
13901 x: {
13902 /**
13903 * Get the X-Scale
13904 */
13905 (): D3.Scale.Scale;
13906 /**
13907 * Set the X-Scale to be adjusted
13908 *
13909 * @param x The X Scale
13910 */
13911 (x: D3.Scale.Scale): Zoom;
13912
13913 };
13914
13915 /**
13916 * Gets or set the Y-Scale that should be adjusted when zooming
13917 */
13918 y: {
13919 /**
13920 * Get the Y-Scale
13921 */
13922 (): D3.Scale.Scale;
13923 /**
13924 * Set the Y-Scale to be adjusted
13925 *
13926 * @param y The Y Scale
13927 */
13928 (y: D3.Scale.Scale): Zoom;
13929 };
13930 }
13931
13932 export interface Drag {
13933 /**
13934 * Execute drag method
13935 */
13936 (): any;
13937
13938 /**
13939 * Registers a listener to receive events
13940 *
13941 * @param type Enent name to attach the listener to
13942 * @param listener Function to attach to event
13943 */
13944 on: (type: string, listener: (data: any, index?: number) => any) => Drag;
13945
13946 /**
13947 * Gets or set the current origin accessor function
13948 */
13949 origin: {
13950 /**
13951 * Get the current origin accessor function
13952 */
13953 (): any;
13954 /**
13955 * Set the origin accessor function
13956 *
13957 * @param origin Accessor function
13958 */
13959 (origin?: any): Drag;
13960 };
13961 }
13962 }
13963
13964 // Geography
13965 export module Geo {
13966 export interface Geo {
13967 /**
13968 * create a new geographic path generator
13969 */
13970 path(): Path;
13971 /**
13972 * create a circle generator.
13973 */
13974 circle(): Circle;
13975 /**
13976 * compute the spherical area of a given feature.
13977 */
13978 area(feature: any): number;
13979 /**
13980 * compute the latitude-longitude bounding box for a given feature.
13981 */
13982 bounds(feature: any): number[][];
13983 /**
13984 * compute the spherical centroid of a given feature.
13985 */
13986 centroid(feature: any): number[];
13987 /**
13988 * compute the great-arc distance between two points.
13989 */
13990 distance(a: number[], b: number[]): number;
13991 /**
13992 * interpolate between two points along a great arc.
13993 */
13994 interpolate(a: number[], b: number[]): (t: number) => number[];
13995 /**
13996 * compute the length of a line string or the circumference of a polygon.
13997 */
13998 length(feature: any): number;
13999 /**
14000 * create a standard projection from a raw projection.
14001 */
14002 projection(raw: RawProjection): Projection;
14003 /**
14004 * create a standard projection from a mutable raw projection.
14005 */
14006 projectionMutator(rawFactory: RawProjection): ProjectionMutator;
14007 /**
14008 * the Albers equal-area conic projection.
14009 */
14010 albers(): Projection;
14011 /**
14012 * a composite Albers projection for the United States.
14013 */
14014 albersUsa(): Projection;
14015 /**
14016 * the azimuthal equal-area projection.
14017 */
14018 azimuthalEqualArea: {
14019 (): Projection;
14020 raw: RawProjection;
14021 }
14022 /**
14023 * the azimuthal equidistant projection.
14024 */
14025 azimuthalEquidistant: {
14026 (): Projection;
14027 raw: RawProjection;
14028 }
14029 /**
14030 * the conic conformal projection.
14031 */
14032 conicConformal: {
14033 (): Projection;
14034 raw(phi1:number, phi2:number): RawProjection;
14035 }
14036 /**
14037 * the conic equidistant projection.
14038 */
14039 conicEquidistant: {
14040 (): Projection;
14041 raw(phi1:number, phi2:number): RawProjection;
14042 }
14043 /**
14044 * the conic equal-area (a.k.a. Albers) projection.
14045 */
14046 conicEqualArea: {
14047 (): Projection;
14048 raw(phi1:number, phi2:number): RawProjection;
14049 }
14050 /**
14051 * the equirectangular (plate carreé) projection.
14052 */
14053 equirectangular: {
14054 (): Projection;
14055 raw: RawProjection;
14056 }
14057 /**
14058 * the gnomonic projection.
14059 */
14060 gnomonic: {
14061 (): Projection;
14062 raw: RawProjection;
14063 }
14064 /**
14065 * the spherical Mercator projection.
14066 */
14067 mercator: {
14068 (): Projection;
14069 raw: RawProjection;
14070 }
14071 /**
14072 * the azimuthal orthographic projection.
14073 */
14074 orthographic: {
14075 (): Projection;
14076 raw: RawProjection;
14077 }
14078 /**
14079 * the azimuthal stereographic projection.
14080 */
14081 stereographic: {
14082 (): Projection;
14083 raw: RawProjection;
14084 }
14085 /**
14086 * the transverse Mercator projection.
14087 */
14088 transverseMercator: {
14089 (): Projection;
14090 raw: RawProjection;
14091 }
14092 /**
14093 * convert a GeoJSON object to a geometry stream.
14094 */
14095 stream(object: GeoJSON, listener: Stream): void;
14096 /**
14097 *
14098 */
14099 graticule(): Graticule;
14100 /**
14101 *
14102 */
14103 greatArc(): GreatArc;
14104 /**
14105 *
14106 */
14107 rotation(rotation: number[]): Rotation;
14108 }
14109
14110 export interface Path {
14111 /**
14112 * Returns the path data string for the given feature
14113 */
14114 (feature: any, index?: any): string;
14115 /**
14116 * get or set the geographic projection.
14117 */
14118 projection: {
14119 /**
14120 * get the geographic projection.
14121 */
14122 (): Projection;
14123 /**
14124 * set the geographic projection.
14125 */
14126 (projection: Projection): Path;
14127 }
14128 /**
14129 * get or set the render context.
14130 */
14131 context: {
14132 /**
14133 * return an SVG path string invoked on the given feature.
14134 */
14135 (): string;
14136 /**
14137 * sets the render context and returns the path generator
14138 */
14139 (context: Context): Path;
14140 }
14141 /**
14142 * Computes the projected area
14143 */
14144 area(feature: any): any;
14145 /**
14146 * Computes the projected centroid
14147 */
14148 centroid(feature: any): any;
14149 /**
14150 * Computes the projected bounding box
14151 */
14152 bounds(feature: any): any;
14153 /**
14154 * get or set the radius to display point features.
14155 */
14156 pointRadius: {
14157 /**
14158 * returns the current radius
14159 */
14160 (): number;
14161 /**
14162 * sets the radius used to display Point and MultiPoint features to the specified number
14163 */
14164 (radius: number): Path;
14165 /**
14166 * sets the radius used to display Point and MultiPoint features to the specified number
14167 */
14168 (radius: (feature: any, index: number) => number): Path;
14169 }
14170 }
14171
14172 export interface Context {
14173 beginPath(): any;
14174 moveTo(x: number, y: number): any;
14175 lineTo(x: number, y: number): any;
14176 arc(x: number, y: number, radius: number, startAngle: number, endAngle: number): any;
14177 closePath(): any;
14178 }
14179
14180 export interface Circle {
14181 (...args: any[]): GeoJSON;
14182 origin: {
14183 (): number[];
14184 (origin: number[]): Circle;
14185 (origin: (...args: any[]) => number[]): Circle;
14186 }
14187 angle: {
14188 (): number;
14189 (angle: number): Circle;
14190 }
14191 precision: {
14192 (): number;
14193 (precision: number): Circle;
14194 }
14195 }
14196
14197 export interface Graticule{
14198 (): GeoJSON;
14199 lines(): GeoJSON[];
14200 outline(): GeoJSON;
14201 extent: {
14202 (): number[][];
14203 (extent: number[][]): Graticule;
14204 }
14205 minorExtent: {
14206 (): number[][];
14207 (extent: number[][]): Graticule;
14208 }
14209 majorExtent: {
14210 (): number[][];
14211 (extent: number[][]): Graticule;
14212 }
14213 step: {
14214 (): number[][];
14215 (extent: number[][]): Graticule;
14216 }
14217 minorStep: {
14218 (): number[][];
14219 (extent: number[][]): Graticule;
14220 }
14221 majorStep: {
14222 (): number[][];
14223 (extent: number[][]): Graticule;
14224 }
14225 precision: {
14226 (): number;
14227 (precision: number): Graticule;
14228 }
14229 }
14230
14231 export interface GreatArc {
14232 (): GeoJSON;
14233 distance(): number;
14234 source: {
14235 (): any;
14236 (source: any): GreatArc;
14237 }
14238 target: {
14239 (): any;
14240 (target: any): GreatArc;
14241 }
14242 precision: {
14243 (): number;
14244 (precision: number): GreatArc;
14245 }
14246 }
14247
14248 export interface GeoJSON {
14249 coordinates: number[][];
14250 type: string;
14251 }
14252
14253 export interface RawProjection {
14254 (lambda: number, phi: number): number[];
14255 invert?(x: number, y: number): number[];
14256 }
14257
14258 export interface Projection {
14259 (coordinates: number[]): number[];
14260 invert?(point: number[]): number[];
14261 rotate: {
14262 (): number[];
14263 (rotation: number[]): Projection;
14264 };
14265 center: {
14266 (): number[];
14267 (location: number[]): Projection;
14268 };
14269 parallels: {
14270 (): number[];
14271 (location: number[]): Projection;
14272 };
14273 translate: {
14274 (): number[];
14275 (point: number[]): Projection;
14276 };
14277 scale: {
14278 (): number;
14279 (scale: number): Projection;
14280 };
14281 clipAngle: {
14282 (): number;
14283 (angle: number): Projection;
14284 };
14285 clipExtent: {
14286 (): number[][];
14287 (extent: number[][]): Projection;
14288 };
14289 precision: {
14290 (): number;
14291 (precision: number): Projection;
14292 };
14293 stream(listener?: Stream): Stream;
14294 }
14295
14296 export interface Stream {
14297 point(x: number, y: number, z?: number): void;
14298 lineStart(): void;
14299 lineEnd(): void;
14300 polygonStart(): void;
14301 polygonEnd(): void;
14302 sphere(): void;
14303 }
14304
14305 export interface Rotation extends Array<any> {
14306 (location: number[]): Rotation;
14307 invert(location: number[]): Rotation;
14308 }
14309
14310 export interface ProjectionMutator {
14311 (lambda: number, phi: number): Projection;
14312 }
14313 }
14314
14315 // Geometry
14316 export module Geom {
14317 export interface Geom {
14318 voronoi<T>(): Voronoi<T>;
14319 /**
14320 * compute the Voronoi diagram for the specified points.
14321 */
14322 voronoi(vertices: Vertice[]): Polygon[];
14323 /**
14324 * compute the Delaunay triangulation for the specified points.
14325 */
14326 delaunay(vertices?: Vertice[]): Polygon[];
14327 /**
14328 * constructs a quadtree for an array of points.
14329 */
14330 quadtree(): QuadtreeFactory;
14331 /**
14332 * Constructs a new quadtree for the specified array of points.
14333 */
14334 quadtree(points: Point[], x1: number, y1: number, x2: number, y2: number): Quadtree;
14335 /**
14336 * Constructs a new quadtree for the specified array of points.
14337 */
14338 quadtree(points: Point[], width: number, height: number): Quadtree;
14339 /**
14340 * Returns the input array of vertices with additional methods attached
14341 */
14342 polygon(vertices:Vertice[]): Polygon;
14343 /**
14344 * creates a new hull layout with the default settings.
14345 */
14346 hull(): Hull;
14347
14348 hull(vertices:Vertice[]): Vertice[];
14349 }
14350
14351 export interface Vertice extends Array<number> {
14352 /**
14353 * Returns the angle of the vertice
14354 */
14355 angle?: number;
14356 }
14357
14358 export interface Polygon extends Array<Vertice> {
14359 /**
14360 * Returns the signed area of this polygon
14361 */
14362 area(): number;
14363 /**
14364 * Returns a two-element array representing the centroid of this polygon.
14365 */
14366 centroid(): number[];
14367 /**
14368 * Clips the subject polygon against this polygon
14369 */
14370 clip(subject: Polygon): Polygon;
14371 }
14372
14373 export interface QuadtreeFactory {
14374 /**
14375 * Constructs a new quadtree for the specified array of points.
14376 */
14377 (): Quadtree;
14378 /**
14379 * Constructs a new quadtree for the specified array of points.
14380 */
14381 (points: Point[], x1: number, y1: number, x2: number, y2: number): Quadtree;
14382 /**
14383 * Constructs a new quadtree for the specified array of points.
14384 */
14385 (points: Point[], width: number, height: number): Quadtree;
14386
14387 x: {
14388 (): (d: any) => any;
14389 (accesor: (d: any) => any): QuadtreeFactory;
14390
14391 }
14392 y: {
14393 (): (d: any) => any;
14394 (accesor: (d: any) => any): QuadtreeFactory;
14395
14396 }
14397 size(): number[];
14398 size(size: number[]): QuadtreeFactory;
14399 extent(): number[][];
14400 extent(points: number[][]): QuadtreeFactory;
14401 }
14402
14403 export interface Quadtree {
14404 /**
14405 * Adds a new point to the quadtree.
14406 */
14407 add(point: Point): void;
14408 visit(callback: any): void;
14409 }
14410
14411 export interface Point {
14412 x: number;
14413 y: number;
14414 }
14415
14416 export interface Voronoi<T> {
14417 /**
14418 * Compute the Voronoi diagram for the specified data.
14419 */
14420 (data: T[]): Polygon[];
14421 /**
14422 * Compute the graph links for the Voronoi diagram for the specified data.
14423 */
14424 links(data: T[]): Layout.GraphLink[];
14425 /**
14426 * Compute the triangles for the Voronoi diagram for the specified data.
14427 */
14428 triangles(data: T[]): number[][];
14429 x: {
14430 /**
14431 * Get the x-coordinate accessor.
14432 */
14433 (): (data: T, index ?: number) => number;
14434
14435 /**
14436 * Set the x-coordinate accessor.
14437 *
14438 * @param accessor The new accessor function
14439 */
14440 (accessor: (data: T, index: number) => number): Voronoi<T>;
14441
14442 /**
14443 * Set the x-coordinate to a constant.
14444 *
14445 * @param constant The new constant value.
14446 */
14447 (constant: number): Voronoi<T>;
14448 }
14449 y: {
14450 /**
14451 * Get the y-coordinate accessor.
14452 */
14453 (): (data: T, index ?: number) => number;
14454
14455 /**
14456 * Set the y-coordinate accessor.
14457 *
14458 * @param accessor The new accessor function
14459 */
14460 (accessor: (data: T, index: number) => number): Voronoi<T>;
14461
14462 /**
14463 * Set the y-coordinate to a constant.
14464 *
14465 * @param constant The new constant value.
14466 */
14467 (constant: number): Voronoi<T>;
14468 }
14469 clipExtent: {
14470 /**
14471 * Get the clip extent.
14472 */
14473 (): number[][];
14474 /**
14475 * Set the clip extent.
14476 *
14477 * @param extent The new clip extent.
14478 */
14479 (extent: number[][]): Voronoi<T>;
14480 }
14481 size: {
14482 /**
14483 * Get the size.
14484 */
14485 (): number[];
14486 /**
14487 * Set the size, equivalent to a clip extent starting from (0,0).
14488 *
14489 * @param size The new size.
14490 */
14491 (size: number[]): Voronoi<T>;
14492 }
14493 }
14494
14495 export interface Hull {
14496 (vertices: Vertice[]): Vertice[];
14497 x: {
14498 (): (d: any) => any;
14499 (accesor: (d: any) => any): any;
14500 }
14501 y: {
14502 (): (d: any) => any;
14503 (accesor: (d: any) => any): any;
14504 }
14505 }
14506 }
14507
14508 export interface D3Element extends Element {
14509 getComputedTextLength: () => number;
14510 getTotalLength: () => number;
14511 getPointAtLength: (l: number) => SVGPoint;
14512 }
14513}
14514
14515declare var d3: D3.Base;
14516
14517declare module "d3" {
14518 export = d3;
14519}