@@ -14,7 +14,7 @@ export declare function m$(selector?: mQuery | NodeList | Node | Node[] | string
14
14
export declare const mQuery : typeof m$ ;
15
15
export declare namespace m$ {
16
16
type Class = mQuery ;
17
- type Deferred = m$ . Promise . Deferred ;
17
+ type Deferred = Promise . Deferred ;
18
18
type ForEachIterator < T > = ( keyOrIndex : any , value : T ) => boolean | void ;
19
19
type EachIterator = ForEachIterator < HTMLElement > ;
20
20
type ArrayLikeObject = PlainObject | ArrayLike < any > ;
@@ -23,8 +23,8 @@ export declare namespace m$ {
23
23
length ?: number ;
24
24
} ;
25
25
type AJAXSuccess = ( data ?: any , textStatus ?: string , XHR ?: XMLHttpRequest ) => void ;
26
- type AJAXDetails = ( XHR ?: XMLHttpRequest , settingsOrStatus ?: PlainObject | string , errorThrown ?: string ) => void ;
27
- type AJAXSettings = {
26
+ type AJAXDetails = ( XHR ?: XMLHttpRequest , optionsOrStatus ?: PlainObject | string , errorThrown ?: string ) => void ;
27
+ type AJAXOptions = {
28
28
method ?: string ;
29
29
beforeSend ?: AJAXDetails ;
30
30
complete ?: AJAXDetails ;
@@ -63,6 +63,7 @@ export declare namespace m$ {
63
63
*/
64
64
class mQuery implements ArrayLike < HTMLElement > {
65
65
[ index : number ] : HTMLElement ;
66
+ [ key : string ] : any ;
66
67
prevObject ?: mQuery ;
67
68
length : number ;
68
69
/**
@@ -86,7 +87,7 @@ export declare namespace m$ {
86
87
* Specify a function to execute when the DOM is fully loaded.
87
88
* @param handler A function to execute after the DOM is ready.
88
89
*/
89
- ready ( handler : EventListener ) : this;
90
+ ready ( handler : Function ) : this;
90
91
/**
91
92
* Iterate over a mQuery object, executing a function for each matched element.
92
93
* @param handler A function to execute for each matched element.
@@ -382,8 +383,41 @@ export declare namespace m$ {
382
383
* @param index A zero-based integer indicating which element to retrieve.
383
384
*/
384
385
get ( index ?: number ) : HTMLElement [ ] | HTMLElement ;
385
- width ( value ?: any ) : mQuery | number ;
386
- height ( value ?: any ) : mQuery | number ;
386
+ /**
387
+ * Get the current computed width for the first element in the set of matched elements.
388
+ */
389
+ width ( ) : number ;
390
+ /**
391
+ * Set the CSS width of each element in the set of matched elements.
392
+ * @param valueFn A function returning the width to set. Receives the index and the old width. "this" refers to the current element in the set.
393
+ */
394
+ width ( valueFn : ( index ?: number , width ?: number ) => string | number ) : mQuery ;
395
+ /**
396
+ * Set the CSS width of each element in the set of matched elements.
397
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
398
+ */
399
+ width ( value : string | number ) : mQuery ;
400
+ /**
401
+ * Get the current computed height for the first element in the set of matched elements.
402
+ */
403
+ height ( ) : number ;
404
+ /**
405
+ * Set the CSS height of every matched element.
406
+ * @param valueFn A function returning the height to set. Receives the index and the old height. "this" refers to the current element in the set.
407
+ */
408
+ height ( valueFn : ( index ?: number , width ?: number ) => string | number ) : mQuery ;
409
+ /**
410
+ * Set the CSS height of every matched element.
411
+ * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
412
+ */
413
+ height ( value : string | number ) : mQuery ;
414
+ /**
415
+ * Load data from the server and place the returned HTML into the matched element.
416
+ * @param url A string containing the URL to which the request is sent.
417
+ * @param data A plain object or string that is sent to the server with the request.
418
+ * @param complete A callback function that is executed when the request completes.
419
+ */
420
+ load ( url : any , data ?: AJAXSuccess | any , complete ?: AJAXSuccess ) : this;
387
421
/**
388
422
* Merge the contents of an object onto the mQuery prototype to provide new mQuery instance methods.
389
423
* @param obj An object to merge onto the jQuery prototype.
@@ -494,20 +528,25 @@ export declare namespace m$ {
494
528
timeout ?: number ;
495
529
path ?: string ;
496
530
} ) : void ;
531
+ /**
532
+ * Set default values for future Ajax requests. Its use is not recommended.
533
+ * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
534
+ */
535
+ function ajaxSetup ( options : AJAXOptions ) : PlainObject ;
497
536
/**
498
537
* Perform an asynchronous HTTP (Ajax) request.
499
538
* @param url A string containing the URL to which the request is sent.
500
539
*/
501
540
function ajax ( url : string ) : Deferred ;
502
541
/**
503
- * @param settings AJAX options.
542
+ * @param options AJAX options.
504
543
*/
505
- function ajax ( settings : AJAXSettings ) : Deferred ;
544
+ function ajax ( options : AJAXOptions ) : Deferred ;
506
545
/**
507
546
* @param url A string containing the URL to which the request is sent.
508
- * @param settings AJAX options.
547
+ * @param options AJAX options.
509
548
*/
510
- function ajax ( url : string , settings : AJAXSettings ) : Deferred ;
549
+ function ajax ( url : string , options : AJAXOptions ) : Deferred ;
511
550
/**
512
551
* Load data from the server using a HTTP GET request.
513
552
* @param url A string containing the URL to which the request is sent.
@@ -523,9 +562,9 @@ export declare namespace m$ {
523
562
function get ( url : string , data : any , success : AJAXSuccess ) : Deferred ;
524
563
/**
525
564
* Load data from the server using a HTTP GET request.
526
- * @param settings A set of key/value pairs that configure the Ajax request.
565
+ * @param options A set of key/value pairs that configure the Ajax request.
527
566
*/
528
- function get ( settings : AJAXSettings ) : Deferred ;
567
+ function get ( options : AJAXOptions ) : Deferred ;
529
568
/**
530
569
* Load data from the server using a HTTP POST request.
531
570
* @param url A string containing the URL to which the request is sent.
@@ -541,9 +580,9 @@ export declare namespace m$ {
541
580
function post ( url : string , data : any , success : AJAXSuccess ) : Deferred ;
542
581
/**
543
582
* Load data from the server using a HTTP POST request.
544
- * @param settings A set of key/value pairs that configure the Ajax request.
583
+ * @param options A set of key/value pairs that configure the Ajax request.
545
584
*/
546
- function post ( settings : AJAXSettings ) : Deferred ;
585
+ function post ( options : AJAXOptions ) : Deferred ;
547
586
function param ( obj : ArrayLikeObject , tradicional ?: boolean ) : string ;
548
587
/**
549
588
* Set event shorthand methods.
@@ -555,7 +594,7 @@ export declare namespace m$ {
555
594
* @param beforeStart A function that is called just before the constructor returns.
556
595
*/
557
596
function Deferred ( beforeStart ?: Function ) : Deferred ;
558
- const ready : ( handler : EventListener ) => mQuery ;
597
+ const ready : ( handler : Function ) => mQuery ;
559
598
}
560
599
export declare namespace m$ . Promise {
561
600
enum State {
@@ -580,6 +619,6 @@ export declare namespace m$.Promise {
580
619
done ( callback : ( ...args : any [ ] ) => void ) : Deferred ;
581
620
fail ( callback : ( ...args : any [ ] ) => void ) : Deferred ;
582
621
then ( successFilter : ( ...args : any [ ] ) => any , errorFilter ?: ( ...args : any [ ] ) => any ) : Deferred ;
583
- allways ( callback : ( ...args : any [ ] ) => void ) : Deferred ;
622
+ always ( callback : ( ...args : any [ ] ) => void ) : Deferred ;
584
623
}
585
624
}
0 commit comments