1 |
|
2 |
|
3 |
|
4 | declare namespace Chai {
|
5 | interface Assertion {
|
6 | attr(name: string, value?: string): Assertion;
|
7 | prop(name: string, value?: any): Assertion;
|
8 | css(name: string, value?: string): Assertion;
|
9 | data(name: string, value?: string): Assertion;
|
10 | class(className: string): Assertion;
|
11 | id(id: string): Assertion;
|
12 | html(html: string): Assertion;
|
13 | text(text: string): Assertion;
|
14 | value(text: string): Assertion;
|
15 | descendants(selector: string): Assertion;
|
16 | visible(): Assertion;
|
17 | hidden(): Assertion;
|
18 | selected(): Assertion;
|
19 | checked(): Assertion;
|
20 | disabled(): Assertion;
|
21 | enabled(): Assertion;
|
22 | (selector: string): Assertion;
|
23 | }
|
24 |
|
25 | interface Match {
|
26 | (selector: string): Assertion;
|
27 | }
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | interface ChaiJQueryStatic {
|
34 | |
35 |
|
36 |
|
37 |
|
38 |
|
39 | ajax(settings: JQueryAjaxSettings): JQueryXHR;
|
40 | |
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
|
47 |
|
48 | |
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | ajaxPrefilter(
|
55 | dataTypes: string,
|
56 | handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any,
|
57 | ): void;
|
58 | |
59 |
|
60 |
|
61 |
|
62 |
|
63 | ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
|
64 |
|
65 | ajaxSettings: JQueryAjaxSettings;
|
66 |
|
67 | |
68 |
|
69 |
|
70 |
|
71 |
|
72 | ajaxSetup(options: JQueryAjaxSettings): void;
|
73 |
|
74 | |
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 | get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
|
82 | |
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 | get(
|
91 | url: string,
|
92 | data?: Object | string,
|
93 | success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any,
|
94 | dataType?: string,
|
95 | ): JQueryXHR;
|
96 | |
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
|
103 | |
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 | getJSON(
|
111 | url: string,
|
112 | data?: Object | string,
|
113 | success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any,
|
114 | ): JQueryXHR;
|
115 | |
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 | getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
|
122 |
|
123 | |
124 |
|
125 |
|
126 | param: JQueryParam;
|
127 |
|
128 | |
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 | post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
|
136 | |
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | post(
|
145 | url: string,
|
146 | data?: Object | string,
|
147 | success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any,
|
148 | dataType?: string,
|
149 | ): JQueryXHR;
|
150 |
|
151 | |
152 |
|
153 |
|
154 |
|
155 |
|
156 | Callbacks(flags?: string): JQueryCallback;
|
157 |
|
158 | |
159 |
|
160 |
|
161 |
|
162 |
|
163 | holdReady(hold: boolean): void;
|
164 |
|
165 | |
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 | (selector: string, context?: Element | JQuery): ChaiJQuery;
|
172 | |
173 |
|
174 |
|
175 |
|
176 |
|
177 | (element: Element): ChaiJQuery;
|
178 | |
179 |
|
180 |
|
181 |
|
182 |
|
183 | (elementArray: Element[]): ChaiJQuery;
|
184 | |
185 |
|
186 |
|
187 |
|
188 |
|
189 | (object: {}): ChaiJQuery;
|
190 | |
191 |
|
192 |
|
193 |
|
194 |
|
195 | (object: JQuery): ChaiJQuery;
|
196 | |
197 |
|
198 |
|
199 | (): ChaiJQuery;
|
200 |
|
201 | |
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 | (html: string, ownerDocument?: Document): ChaiJQuery;
|
208 | |
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 | (html: string, attributes: Object): ChaiJQuery;
|
215 |
|
216 | |
217 |
|
218 |
|
219 |
|
220 |
|
221 | (callback: Function): ChaiJQuery;
|
222 |
|
223 | |
224 |
|
225 |
|
226 |
|
227 |
|
228 | noConflict(removeAll?: boolean): Object;
|
229 |
|
230 | |
231 |
|
232 |
|
233 |
|
234 |
|
235 | when<T>(...deferreds: Array<T | JQueryPromise<T> >): JQueryPromise<T>;
|
236 |
|
237 | |
238 |
|
239 |
|
240 | cssHooks: { [key: string]: any };
|
241 | cssNumber: any;
|
242 |
|
243 | |
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 | data<T>(element: Element, key: string, value: T): T;
|
251 | |
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 | data(element: Element, key: string): any;
|
258 | |
259 |
|
260 |
|
261 |
|
262 |
|
263 | data(element: Element): any;
|
264 |
|
265 | |
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 | dequeue(element: Element, queueName?: string): void;
|
272 |
|
273 | |
274 |
|
275 |
|
276 |
|
277 |
|
278 | hasData(element: Element): boolean;
|
279 |
|
280 | |
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 | queue(element: Element, queueName?: string): any[];
|
287 | |
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 | queue(element: Element, queueName: string, newQueue: Function[]): ChaiJQuery;
|
295 | |
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 | queue(element: Element, queueName: string, callback: Function): ChaiJQuery;
|
303 |
|
304 | |
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 | removeData(element: Element, name?: string): ChaiJQuery;
|
311 |
|
312 | |
313 |
|
314 |
|
315 |
|
316 |
|
317 | Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>;
|
318 |
|
319 | /**
|
320 | * Effects
|
321 | */
|
322 | fx: {
|
323 | tick: () => void;
|
324 | |
325 |
|
326 |
|
327 | interval: number;
|
328 | stop: () => void;
|
329 | speeds: { slow: number; fast: number };
|
330 | |
331 |
|
332 |
|
333 | off: boolean;
|
334 | step: any;
|
335 | };
|
336 |
|
337 | |
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 | proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
|
345 | |
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 | proxy(context: Object, name: string, ...additionalArguments: any[]): any;
|
353 |
|
354 | Event: JQueryEventConstructor;
|
355 |
|
356 | |
357 |
|
358 |
|
359 |
|
360 |
|
361 | error(message: any): ChaiJQuery;
|
362 |
|
363 | expr: any;
|
364 | fn: any;
|
365 |
|
366 | isReady: boolean;
|
367 |
|
368 |
|
369 | support: JQuerySupport;
|
370 |
|
371 | |
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 | contains(container: Element, contained: Element): boolean;
|
378 |
|
379 | |
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 | each<T>(
|
386 | collection: T[],
|
387 | callback: (indexInArray: number, valueOfElement: T) => any,
|
388 | ): any;
|
389 |
|
390 | |
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 | each(
|
397 | collection: any,
|
398 | callback: (indexInArray: any, valueOfElement: any) => any,
|
399 | ): any;
|
400 |
|
401 | |
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 | extend(target: any, object1?: any, ...objectN: any[]): any;
|
409 | |
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 | extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
|
418 |
|
419 | |
420 |
|
421 |
|
422 |
|
423 |
|
424 | globalEval(code: string): any;
|
425 |
|
426 | |
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 | grep<T>(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[];
|
434 |
|
435 | /**
|
436 | * Search for a specified value within an array and return its index (or -1 if not found).
|
437 | *
|
438 | * @param value The value to search for.
|
439 | * @param array An array through which to search.
|
440 | * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array.
|
441 | */
|
442 | inArray<T>(value: T, array: T[], fromIndex?: number): number;
|
443 |
|
444 | /**
|
445 | * Determine whether the argument is an array.
|
446 | *
|
447 | * @param obj Object to test whether or not it is an array.
|
448 | */
|
449 | isArray(obj: any): boolean;
|
450 | /**
|
451 | * Check to see if an object is empty (contains no enumerable properties).
|
452 | *
|
453 | * @param obj The object that will be checked to see if it's empty.
|
454 | */
|
455 | isEmptyObject(obj: any): boolean;
|
456 | /**
|
457 | * Determine if the argument passed is a Javascript function object.
|
458 | *
|
459 | * @param obj Object to test whether or not it is a function.
|
460 | */
|
461 | isFunction(obj: any): boolean;
|
462 | /**
|
463 | * Determines whether its argument is a number.
|
464 | *
|
465 | * @param obj The value to be tested.
|
466 | */
|
467 | isNumeric(value: any): boolean;
|
468 | /**
|
469 | * Check to see if an object is a plain object (created using "{}" or "new Object").
|
470 | *
|
471 | * @param obj The object that will be checked to see if it's a plain object.
|
472 | */
|
473 | isPlainObject(obj: any): boolean;
|
474 | /**
|
475 | * Determine whether the argument is a window.
|
476 | *
|
477 | * @param obj Object to test whether or not it is a window.
|
478 | */
|
479 | isWindow(obj: any): boolean;
|
480 | /**
|
481 | * Check to see if a DOM node is within an XML document (or is an XML document).
|
482 | *
|
483 | * @param node The DOM node that will be checked to see if it's in an XML document.
|
484 | */
|
485 | isXMLDoc(node: Node): boolean;
|
486 |
|
487 | /**
|
488 | * Convert an array-like object into a true JavaScript array.
|
489 | *
|
490 | * @param obj Any object to turn into a native Array.
|
491 | */
|
492 | makeArray(obj: any): any[];
|
493 |
|
494 | /**
|
495 | * Translate all items in an array or object to new array of items.
|
496 | *
|
497 | * @param array The Array to translate.
|
498 | * @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.
|
499 | */
|
500 | map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
|
501 | /**
|
502 | * Translate all items in an array or object to new array of items.
|
503 | *
|
504 | * @param arrayOrObject The Array or Object to translate.
|
505 | * @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.
|
506 | */
|
507 | map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any;
|
508 |
|
509 | /**
|
510 | * Merge the contents of two arrays together into the first array.
|
511 | *
|
512 | * @param first The first array to merge, the elements of second added.
|
513 | * @param second The second array to merge into the first, unaltered.
|
514 | */
|
515 | merge<T>(first: T[], second: T[]): T[];
|
516 |
|
517 | /**
|
518 | * An empty function.
|
519 | */
|
520 | noop(): any;
|
521 |
|
522 | /**
|
523 | * Return a number representing the current time.
|
524 | */
|
525 | now(): number;
|
526 |
|
527 | /**
|
528 | * Takes a well-formed JSON string and returns the resulting JavaScript object.
|
529 | *
|
530 | * @param json The JSON string to parse.
|
531 | */
|
532 | parseJSON(json: string): any;
|
533 |
|
534 | /**
|
535 | * Parses a string into an XML document.
|
536 | *
|
537 | * @param data a well-formed XML string to be parsed
|
538 | */
|
539 | parseXML(data: string): XMLDocument;
|
540 |
|
541 | /**
|
542 | * Remove the whitespace from the beginning and end of a string.
|
543 | *
|
544 | * @param str Remove the whitespace from the beginning and end of a string.
|
545 | */
|
546 | trim(str: string): string;
|
547 |
|
548 | /**
|
549 | * Determine the internal JavaScript [[Class]] of an object.
|
550 | *
|
551 | * @param obj Object to get the internal JavaScript [[Class]] of.
|
552 | */
|
553 | type(obj: any): string;
|
554 |
|
555 | /**
|
556 | * 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.
|
557 | *
|
558 | * @param array The Array of DOM elements.
|
559 | */
|
560 | unique(array: Element[]): Element[];
|
561 |
|
562 | /**
|
563 | * Parses a string into an array of DOM nodes.
|
564 | *
|
565 | * @param data HTML string to be parsed
|
566 | * @param context DOM element to serve as the context in which the HTML fragment will be created
|
567 | * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
|
568 | */
|
569 | parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
|
570 |
|
571 | /**
|
572 | * Parses a string into an array of DOM nodes.
|
573 | *
|
574 | * @param data HTML string to be parsed
|
575 | * @param context DOM element to serve as the context in which the HTML fragment will be created
|
576 | * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
|
577 | */
|
578 | parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
|
579 | }
|
580 |
|
581 | /**
|
582 | * The chai-jquery instance members
|
583 | */
|
584 | interface ChaiJQuery {
|
585 | /**
|
586 | * Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
|
587 | *
|
588 | * @param handler The function to be invoked.
|
589 | */
|
590 | ajaxComplete(
|
591 | handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any,
|
592 | ): ChaiJQuery;
|
593 | /**
|
594 | * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
|
595 | *
|
596 | * @param handler The function to be invoked.
|
597 | */
|
598 | ajaxError(
|
599 | handler: (
|
600 | event: JQueryEventObject,
|
601 | jqXHR: JQueryXHR,
|
602 | ajaxSettings: JQueryAjaxSettings,
|
603 | thrownError: any,
|
604 | ) => any,
|
605 | ): ChaiJQuery;
|
606 | /**
|
607 | * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
|
608 | *
|
609 | * @param handler The function to be invoked.
|
610 | */
|
611 | ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): ChaiJQuery;
|
612 | /**
|
613 | * Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
|
614 | *
|
615 | * @param handler The function to be invoked.
|
616 | */
|
617 | ajaxStart(handler: () => any): ChaiJQuery;
|
618 | /**
|
619 | * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
|
620 | *
|
621 | * @param handler The function to be invoked.
|
622 | */
|
623 | ajaxStop(handler: () => any): ChaiJQuery;
|
624 | /**
|
625 | * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
|
626 | *
|
627 | * @param handler The function to be invoked.
|
628 | */
|
629 | ajaxSuccess(
|
630 | handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any,
|
631 | ): ChaiJQuery;
|
632 |
|
633 | /**
|
634 | * Load data from the server and place the returned HTML into the matched element.
|
635 | *
|
636 | * @param url A string containing the URL to which the request is sent.
|
637 | * @param data A plain object or string that is sent to the server with the request.
|
638 | * @param complete A callback function that is executed when the request completes.
|
639 | */
|
640 | load(
|
641 | url: string,
|
642 | data?: string | Object,
|
643 | complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any,
|
644 | ): ChaiJQuery;
|
645 |
|
646 | /**
|
647 | * Encode a set of form elements as a string for submission.
|
648 | */
|
649 | serialize(): string;
|
650 | /**
|
651 | * Encode a set of form elements as an array of names and values.
|
652 | */
|
653 | serializeArray(): JQuerySerializeArrayElement[];
|
654 |
|
655 | /**
|
656 | * Adds the specified class(es) to each of the set of matched elements.
|
657 | *
|
658 | * @param className One or more space-separated classes to be added to the class attribute of each matched element.
|
659 | */
|
660 | addClass(className: string): ChaiJQuery;
|
661 | /**
|
662 | * Adds the specified class(es) to each of the set of matched elements.
|
663 | *
|
664 | * @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.
|
665 | */
|
666 | addClass(func: (index: number, className: string) => string): ChaiJQuery;
|
667 |
|
668 | /**
|
669 | * Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
|
670 | */
|
671 | addBack(selector?: string): ChaiJQuery;
|
672 |
|
673 | /**
|
674 | * Get the value of an attribute for the first element in the set of matched elements.
|
675 | *
|
676 | * @param attributeName The name of the attribute to get.
|
677 | */
|
678 | attr(attributeName: string): string;
|
679 | /**
|
680 | * Set one or more attributes for the set of matched elements.
|
681 | *
|
682 | * @param attributeName The name of the attribute to set.
|
683 | * @param value A value to set for the attribute.
|
684 | */
|
685 | attr(attributeName: string, value: string | number): ChaiJQuery;
|
686 | /**
|
687 | * Set one or more attributes for the set of matched elements.
|
688 | *
|
689 | * @param attributeName The name of the attribute to set.
|
690 | * @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.
|
691 | */
|
692 | attr(attributeName: string, func: (index: number, attr: string) => string | number): ChaiJQuery;
|
693 | /**
|
694 | * Set one or more attributes for the set of matched elements.
|
695 | *
|
696 | * @param attributes An object of attribute-value pairs to set.
|
697 | */
|
698 | attr(attributes: Object): ChaiJQuery;
|
699 |
|
700 | /**
|
701 | * Determine whether any of the matched elements are assigned the given class.
|
702 | *
|
703 | * @param className The class name to search for.
|
704 | */
|
705 | hasClass(className: string): boolean;
|
706 |
|
707 | /**
|
708 | * Get the HTML contents of the first element in the set of matched elements.
|
709 | */
|
710 | html(): string;
|
711 | /**
|
712 | * Set the HTML contents of each element in the set of matched elements.
|
713 | *
|
714 | * @param htmlString A string of HTML to set as the content of each matched element.
|
715 | */
|
716 | html(htmlString: string): ChaiJQuery;
|
717 | /**
|
718 | * Set the HTML contents of each element in the set of matched elements.
|
719 | *
|
720 | * @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.
|
721 | */
|
722 | html(func: (index: number, oldhtml: string) => string): ChaiJQuery;
|
723 | /**
|
724 | * Set the HTML contents of each element in the set of matched elements.
|
725 | *
|
726 | * @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.
|
727 | */
|
728 |
|
729 | /**
|
730 | * Get the value of a property for the first element in the set of matched elements.
|
731 | *
|
732 | * @param propertyName The name of the property to get.
|
733 | */
|
734 | prop(propertyName: string): any;
|
735 | /**
|
736 | * Set one or more properties for the set of matched elements.
|
737 | *
|
738 | * @param propertyName The name of the property to set.
|
739 | * @param value A value to set for the property.
|
740 | */
|
741 | prop(propertyName: string, value: string | number | boolean): ChaiJQuery;
|
742 | /**
|
743 | * Set one or more properties for the set of matched elements.
|
744 | *
|
745 | * @param properties An object of property-value pairs to set.
|
746 | */
|
747 | prop(properties: Object): ChaiJQuery;
|
748 | /**
|
749 | * Set one or more properties for the set of matched elements.
|
750 | *
|
751 | * @param propertyName The name of the property to set.
|
752 | * @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.
|
753 | */
|
754 | prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): ChaiJQuery;
|
755 |
|
756 | /**
|
757 | * Remove an attribute from each element in the set of matched elements.
|
758 | *
|
759 | * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
|
760 | */
|
761 | removeAttr(attributeName: string): ChaiJQuery;
|
762 |
|
763 | /**
|
764 | * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
|
765 | *
|
766 | * @param className One or more space-separated classes to be removed from the class attribute of each matched element.
|
767 | */
|
768 | removeClass(className?: string): ChaiJQuery;
|
769 | /**
|
770 | * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
|
771 | *
|
772 | * @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.
|
773 | */
|
774 | removeClass(func: (index: number, className: string) => string): ChaiJQuery;
|
775 |
|
776 | /**
|
777 | * Remove a property for the set of matched elements.
|
778 | *
|
779 | * @param propertyName The name of the property to remove.
|
780 | */
|
781 | removeProp(propertyName: string): ChaiJQuery;
|
782 |
|
783 | /**
|
784 | * 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.
|
785 | *
|
786 | * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
|
787 | * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
|
788 | */
|
789 | toggleClass(className: string, swtch?: boolean): ChaiJQuery;
|
790 | /**
|
791 | * 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.
|
792 | *
|
793 | * @param swtch A boolean value to determine whether the class should be added or removed.
|
794 | */
|
795 | toggleClass(swtch?: boolean): ChaiJQuery;
|
796 | /**
|
797 | * 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.
|
798 | *
|
799 | * @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.
|
800 | * @param swtch A boolean value to determine whether the class should be added or removed.
|
801 | */
|
802 | toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): ChaiJQuery;
|
803 |
|
804 | /**
|
805 | * Get the current value of the first element in the set of matched elements.
|
806 | */
|
807 | val(): any;
|
808 | /**
|
809 | * Set the value of each element in the set of matched elements.
|
810 | *
|
811 | * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
|
812 | */
|
813 | val(value: string | string[]): ChaiJQuery;
|
814 | /**
|
815 | * Set the value of each element in the set of matched elements.
|
816 | *
|
817 | * @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.
|
818 | */
|
819 | val(func: (index: number, value: string) => string): ChaiJQuery;
|
820 |
|
821 | /**
|
822 | * Get the value of style properties for the first element in the set of matched elements.
|
823 | *
|
824 | * @param propertyName A CSS property.
|
825 | */
|
826 | css(propertyName: string): string;
|
827 | /**
|
828 | * Set one or more CSS properties for the set of matched elements.
|
829 | *
|
830 | * @param propertyName A CSS property name.
|
831 | * @param value A value to set for the property.
|
832 | */
|
833 | css(propertyName: string, value: string | number): ChaiJQuery;
|
834 | /**
|
835 | * Set one or more CSS properties for the set of matched elements.
|
836 | *
|
837 | * @param propertyName A CSS property name.
|
838 | * @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.
|
839 | */
|
840 | css(propertyName: string, value: (index: number, value: string) => string | number): ChaiJQuery;
|
841 | /**
|
842 | * Set one or more CSS properties for the set of matched elements.
|
843 | *
|
844 | * @param properties An object of property-value pairs to set.
|
845 | */
|
846 | css(properties: Object): ChaiJQuery;
|
847 |
|
848 | /**
|
849 | * Get the current computed height for the first element in the set of matched elements.
|
850 | */
|
851 | height(): number;
|
852 | /**
|
853 | * Set the CSS height of every matched element.
|
854 | *
|
855 | * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
|
856 | */
|
857 | height(value: number | string): ChaiJQuery;
|
858 | /**
|
859 | * Set the CSS height of every matched element.
|
860 | *
|
861 | * @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.
|
862 | */
|
863 | height(func: (index: number, height: number) => number | string): ChaiJQuery;
|
864 |
|
865 | /**
|
866 | * Get the current computed height for the first element in the set of matched elements, including padding but not border.
|
867 | */
|
868 | innerHeight(): number;
|
869 |
|
870 | /**
|
871 | * Sets the inner height on elements in the set of matched elements, including padding but not border.
|
872 | *
|
873 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
874 | */
|
875 | innerHeight(height: number | string): ChaiJQuery;
|
876 |
|
877 | /**
|
878 | * Get the current computed width for the first element in the set of matched elements, including padding but not border.
|
879 | */
|
880 | innerWidth(): number;
|
881 |
|
882 | /**
|
883 | * Sets the inner width on elements in the set of matched elements, including padding but not border.
|
884 | *
|
885 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
886 | */
|
887 | innerWidth(width: number | string): ChaiJQuery;
|
888 |
|
889 | /**
|
890 | * Get the current coordinates of the first element in the set of matched elements, relative to the document.
|
891 | */
|
892 | offset(): JQueryCoordinates;
|
893 | /**
|
894 | * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
|
895 | *
|
896 | * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
|
897 | */
|
898 | offset(coordinates: JQueryCoordinates): ChaiJQuery;
|
899 | /**
|
900 | * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
|
901 | *
|
902 | * @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.
|
903 | */
|
904 | offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): ChaiJQuery;
|
905 |
|
906 | /**
|
907 | * 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.
|
908 | *
|
909 | * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
|
910 | */
|
911 | outerHeight(includeMargin?: boolean): number;
|
912 |
|
913 | /**
|
914 | * Sets the outer height on elements in the set of matched elements, including padding and border.
|
915 | *
|
916 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
917 | */
|
918 | outerHeight(height: number | string): ChaiJQuery;
|
919 |
|
920 | /**
|
921 | * Get the current computed width for the first element in the set of matched elements, including padding and border.
|
922 | *
|
923 | * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
|
924 | */
|
925 | outerWidth(includeMargin?: boolean): number;
|
926 |
|
927 | /**
|
928 | * Sets the outer width on elements in the set of matched elements, including padding and border.
|
929 | *
|
930 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
931 | */
|
932 | outerWidth(width: number | string): ChaiJQuery;
|
933 |
|
934 | /**
|
935 | * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
|
936 | */
|
937 | position(): JQueryCoordinates;
|
938 |
|
939 | /**
|
940 | * 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.
|
941 | */
|
942 | scrollLeft(): number;
|
943 | /**
|
944 | * Set the current horizontal position of the scroll bar for each of the set of matched elements.
|
945 | *
|
946 | * @param value An integer indicating the new position to set the scroll bar to.
|
947 | */
|
948 | scrollLeft(value: number): ChaiJQuery;
|
949 |
|
950 | /**
|
951 | * 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.
|
952 | */
|
953 | scrollTop(): number;
|
954 | /**
|
955 | * Set the current vertical position of the scroll bar for each of the set of matched elements.
|
956 | *
|
957 | * @param value An integer indicating the new position to set the scroll bar to.
|
958 | */
|
959 | scrollTop(value: number): ChaiJQuery;
|
960 |
|
961 | /**
|
962 | * Get the current computed width for the first element in the set of matched elements.
|
963 | */
|
964 | width(): number;
|
965 | /**
|
966 | * Set the CSS width of each element in the set of matched elements.
|
967 | *
|
968 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
969 | */
|
970 | width(value: number | string): ChaiJQuery;
|
971 | /**
|
972 | * Set the CSS width of each element in the set of matched elements.
|
973 | *
|
974 | * @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.
|
975 | */
|
976 | width(func: (index: number, width: number) => number | string): ChaiJQuery;
|
977 |
|
978 | /**
|
979 | * Remove from the queue all items that have not yet been run.
|
980 | *
|
981 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
982 | */
|
983 | clearQueue(queueName?: string): ChaiJQuery;
|
984 |
|
985 | /**
|
986 | * Store arbitrary data associated with the matched elements.
|
987 | *
|
988 | * @param key A string naming the piece of data to set.
|
989 | * @param value The new data value; it can be any Javascript type including Array or Object.
|
990 | */
|
991 | data(key: string, value: any): ChaiJQuery;
|
992 | /**
|
993 | * Store arbitrary data associated with the matched elements.
|
994 | *
|
995 | * @param obj An object of key-value pairs of data to update.
|
996 | */
|
997 | data(obj: { [key: string]: any }): ChaiJQuery;
|
998 | /**
|
999 | * 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.
|
1000 | *
|
1001 | * @param key Name of the data stored.
|
1002 | */
|
1003 | data(key: string): any;
|
1004 | /**
|
1005 | * 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.
|
1006 | */
|
1007 | data(): any;
|
1008 |
|
1009 | /**
|
1010 | * Execute the next function on the queue for the matched elements.
|
1011 | *
|
1012 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
1013 | */
|
1014 | dequeue(queueName?: string): ChaiJQuery;
|
1015 |
|
1016 | /**
|
1017 | * Remove a previously-stored piece of data.
|
1018 | *
|
1019 | * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
|
1020 | */
|
1021 | removeData(name: string): ChaiJQuery;
|
1022 | /**
|
1023 | * Remove a previously-stored piece of data.
|
1024 | *
|
1025 | * @param list An array of strings naming the pieces of data to delete.
|
1026 | */
|
1027 | removeData(list: string[]): ChaiJQuery;
|
1028 |
|
1029 | /**
|
1030 | * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
|
1031 | *
|
1032 | * @param type The type of queue that needs to be observed. (default: fx)
|
1033 | * @param target Object onto which the promise methods have to be attached
|
1034 | */
|
1035 | promise(type?: string, target?: Object): JQueryPromise<any>;
|
1036 |
|
1037 | /**
|
1038 | * Perform a custom animation of a set of CSS properties.
|
1039 | *
|
1040 | * @param properties An object of CSS properties and values that the animation will move toward.
|
1041 | * @param duration A string or number determining how long the animation will run.
|
1042 | * @param complete A function to call once the animation is complete.
|
1043 | */
|
1044 | animate(properties: Object, duration?: string | number, complete?: Function): ChaiJQuery;
|
1045 | /**
|
1046 | * Perform a custom animation of a set of CSS properties.
|
1047 | *
|
1048 | * @param properties An object of CSS properties and values that the animation will move toward.
|
1049 | * @param duration A string or number determining how long the animation will run.
|
1050 | * @param easing A string indicating which easing function to use for the transition. (default: swing)
|
1051 | * @param complete A function to call once the animation is complete.
|
1052 | */
|
1053 | animate(properties: Object, duration?: string | number, easing?: string, complete?: Function): ChaiJQuery;
|
1054 | /**
|
1055 | * Perform a custom animation of a set of CSS properties.
|
1056 | *
|
1057 | * @param properties An object of CSS properties and values that the animation will move toward.
|
1058 | * @param options A map of additional options to pass to the method.
|
1059 | */
|
1060 | animate(properties: Object, options: JQueryAnimationOptions): ChaiJQuery;
|
1061 |
|
1062 | /**
|
1063 | * Set a timer to delay execution of subsequent items in the queue.
|
1064 | *
|
1065 | * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
|
1066 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
1067 | */
|
1068 | delay(duration: number, queueName?: string): ChaiJQuery;
|
1069 |
|
1070 | /**
|
1071 | * Display the matched elements by fading them to opaque.
|
1072 | *
|
1073 | * @param duration A string or number determining how long the animation will run.
|
1074 | * @param complete A function to call once the animation is complete.
|
1075 | */
|
1076 | fadeIn(duration?: number | string, complete?: Function): ChaiJQuery;
|
1077 | /**
|
1078 | * Display the matched elements by fading them to opaque.
|
1079 | *
|
1080 | * @param duration A string or number determining how long the animation will run.
|
1081 | * @param easing A string indicating which easing function to use for the transition.
|
1082 | * @param complete A function to call once the animation is complete.
|
1083 | */
|
1084 | fadeIn(duration?: number | string, easing?: string, complete?: Function): ChaiJQuery;
|
1085 | /**
|
1086 | * Display the matched elements by fading them to opaque.
|
1087 | *
|
1088 | * @param options A map of additional options to pass to the method.
|
1089 | */
|
1090 | fadeIn(options: JQueryAnimationOptions): ChaiJQuery;
|
1091 |
|
1092 | /**
|
1093 | * Hide the matched elements by fading them to transparent.
|
1094 | *
|
1095 | * @param duration A string or number determining how long the animation will run.
|
1096 | * @param complete A function to call once the animation is complete.
|
1097 | */
|
1098 | fadeOut(duration?: number | string, complete?: Function): ChaiJQuery;
|
1099 | /**
|
1100 | * Hide the matched elements by fading them to transparent.
|
1101 | *
|
1102 | * @param duration A string or number determining how long the animation will run.
|
1103 | * @param easing A string indicating which easing function to use for the transition.
|
1104 | * @param complete A function to call once the animation is complete.
|
1105 | */
|
1106 | fadeOut(duration?: number | string, easing?: string, complete?: Function): ChaiJQuery;
|
1107 | /**
|
1108 | * Hide the matched elements by fading them to transparent.
|
1109 | *
|
1110 | * @param options A map of additional options to pass to the method.
|
1111 | */
|
1112 | fadeOut(options: JQueryAnimationOptions): ChaiJQuery;
|
1113 |
|
1114 | /**
|
1115 | * Adjust the opacity of the matched elements.
|
1116 | *
|
1117 | * @param duration A string or number determining how long the animation will run.
|
1118 | * @param opacity A number between 0 and 1 denoting the target opacity.
|
1119 | * @param complete A function to call once the animation is complete.
|
1120 | */
|
1121 | fadeTo(duration: string | number, opacity: number, complete?: Function): ChaiJQuery;
|
1122 | /**
|
1123 | * Adjust the opacity of the matched elements.
|
1124 | *
|
1125 | * @param duration A string or number determining how long the animation will run.
|
1126 | * @param opacity A number between 0 and 1 denoting the target opacity.
|
1127 | * @param easing A string indicating which easing function to use for the transition.
|
1128 | * @param complete A function to call once the animation is complete.
|
1129 | */
|
1130 | fadeTo(duration: string | number, opacity: number, easing?: string, complete?: Function): ChaiJQuery;
|
1131 |
|
1132 | /**
|
1133 | * Display or hide the matched elements by animating their opacity.
|
1134 | *
|
1135 | * @param duration A string or number determining how long the animation will run.
|
1136 | * @param complete A function to call once the animation is |