Merge pull request #17513 from leonard-thieu/jquery

[jquery] Update type definitions
This commit is contained in:
John Reilly 2017-07-02 17:59:39 +01:00 committed by GitHub
commit ae6459f44a
4 changed files with 2607 additions and 423 deletions

1510
types/jquery/index.d.ts vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1202,14 +1202,13 @@ function examples() {
// Attach a done, fail, and progress handler for the asyncEvent
$.when(asyncEvent()).then(
function(status) {
status === 3;
alert(status + ', things are going well');
},
function(status) {
alert(status + ', you fail this time');
},
function(status) {
// $('body').append(status);
$('body').append(status);
},
);
}
@ -1233,9 +1232,7 @@ function examples() {
// Use the object as a Promise
_obj.done(function(name) {
_obj.hello(name); // Will alert "Hello John"
});
/// TODO: This doesn't work even though .done() returns this
// .hello('Karl'); // Will alert "Hello Karl"
}).hello('Karl'); // Will alert "Hello Karl"
}
function deferred_then_0() {
@ -1392,7 +1389,7 @@ function examples() {
function each_2() {
$('button').click(function() {
$('div').each(function(index, element) {
// element == this
// element == this;
$(element).css('backgroundColor', 'yellow');
if ($(this).is('#stop')) {
$('span').text('Stopped at div index #' + index);
@ -3757,13 +3754,13 @@ function examples() {
function offset_0() {
var p = $('p:last');
var offset = p.offset();
var offset = p.offset()!;
p.html('left: ' + offset.left + ', top: ' + offset.top);
}
function offset_1() {
$('*', document.body).click(function(event) {
var offset = $(this).offset();
var offset = $(this).offset()!;
event.stopPropagation();
$('#result').text(this.tagName +
' coords ( ' + offset.left + ', ' + offset.top + ' )');

View File

@ -2,8 +2,9 @@
"extends": "dtslint/dt.json",
"rules": {
"ban-types": false,
"no-misused-new": false,
"callable-types": false,
"no-empty-interface": false,
"callable-types": false
"no-misused-new": false,
"space-before-function-paren": false
}
}