diff --git a/types/jquery/JQuery.d.ts b/types/jquery/JQuery.d.ts index 83e27c6754..123fad3b34 100644 --- a/types/jquery/JQuery.d.ts +++ b/types/jquery/JQuery.d.ts @@ -1347,7 +1347,7 @@ $( "p" ).before( $( "b" ) ); TData>( eventType: TType, eventData: TData, - handler: JQuery.TypeEventHandler + handler: JQuery.TypeEventHandler ): this; /** * Attach a handler to an event for the elements. @@ -1477,7 +1477,7 @@ $( "button" ).click(function() { */ bind( eventType: TType, - handler_preventBubble: JQuery.TypeEventHandler | + handler_preventBubble: JQuery.TypeEventHandler | false | null | undefined @@ -1507,7 +1507,7 @@ $( "div.test" ).bind({ }); ``` */ - bind(events: JQuery.TypeEventHandlers): this; + bind(events: JQuery.TypeEventHandlers): this; /** * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. * @param eventData An object containing data that will be passed to the event handler. @@ -1521,7 +1521,7 @@ $( "div.test" ).bind({ * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ blur(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -1537,7 +1537,7 @@ $( "div.test" ).bind({ $( "p" ).blur(); ``` */ - blur(handler?: JQuery.TypeEventHandler | + blur(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. @@ -1552,7 +1552,7 @@ $( "p" ).blur(); * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ change(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -1611,7 +1611,7 @@ $( "input[type='text']" ).change(function() { }); ``` */ - change(handler?: JQuery.TypeEventHandler | + change(handler?: JQuery.TypeEventHandler | false): this; /** * Get the children of each element in the set of matched elements, optionally filtered by a selector. @@ -1865,7 +1865,7 @@ $( "#stop" ).click(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ click(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -1915,7 +1915,7 @@ $( "p" ).click(function() { $( "p" ).click(); ``` */ - click(handler?: JQuery.TypeEventHandler | + click(handler?: JQuery.TypeEventHandler | false): this; /** * Create a deep copy of the set of matched elements. @@ -2104,7 +2104,7 @@ $( "#frameDemo" ).contents().find( "a" ).css( "background-color", "#BADA55" ); * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ contextmenu(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -2158,7 +2158,7 @@ div.contextmenu(function() { ``` */ - contextmenu(handler?: JQuery.TypeEventHandler | + contextmenu(handler?: JQuery.TypeEventHandler | false): this; /** * Set one or more CSS properties for the set of matched elements. @@ -2620,7 +2620,7 @@ $( "button" ).click(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ dblclick(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -2674,7 +2674,7 @@ divdbl.dblclick(function() { ``` */ - dblclick(handler?: JQuery.TypeEventHandler | + dblclick(handler?: JQuery.TypeEventHandler | false): this; /** * Set a timer to delay execution of subsequent items in the queue. @@ -2745,7 +2745,7 @@ $( "button" ).click(function() { selector: JQuery.Selector, eventType: TType, eventData: TData, - handler: JQuery.TypeEventHandler + handler: JQuery.TypeEventHandler ): this; /** * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. @@ -2861,7 +2861,7 @@ $( "button" ).click(function() { delegate( selector: JQuery.Selector, eventType: TType, - handler: JQuery.TypeEventHandler | + handler: JQuery.TypeEventHandler | false ): this; /** @@ -2877,7 +2877,7 @@ $( "button" ).click(function() { * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. */ delegate(selector: JQuery.Selector, - events: JQuery.TypeEventHandlers + events: JQuery.TypeEventHandlers ): this; /** * Execute the next function on the queue for the matched elements. @@ -4298,7 +4298,7 @@ $( "p span" ).first().addClass( "highlight" ); * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ focus(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -4350,7 +4350,7 @@ $( document ).ready(function() { }); ``` */ - focus(handler?: JQuery.TypeEventHandler | + focus(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "focusin" event. @@ -4365,7 +4365,7 @@ $( document ).ready(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ focusin(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "focusin" event. * @param handler A function to execute each time the event is triggered. @@ -4405,7 +4405,7 @@ $( "p" ).focusin(function() { ``` */ - focusin(handler?: JQuery.TypeEventHandler | + focusin(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "focusout" JavaScript event. @@ -4420,7 +4420,7 @@ $( "p" ).focusin(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ focusout(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "focusout" JavaScript event. * @param handler A function to execute each time the event is triggered. @@ -4481,7 +4481,7 @@ $( "p" ) ``` */ - focusout(handler?: JQuery.TypeEventHandler | + focusout(handler?: JQuery.TypeEventHandler | false): this; /** * Retrieve one of the elements matched by the jQuery object. @@ -4998,9 +4998,9 @@ $( "td" ).hover( $( "td" ).off( "mouseenter mouseleave" ); ``` */ - hover(handlerIn: JQuery.TypeEventHandler | + hover(handlerIn: JQuery.TypeEventHandler | false, - handlerOut: JQuery.TypeEventHandler | + handlerOut: JQuery.TypeEventHandler | false): this; /** * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. @@ -5067,7 +5067,7 @@ $( "li" ) ``` */ - hover(handlerInOut: JQuery.TypeEventHandler | + hover(handlerInOut: JQuery.TypeEventHandler | false): this; /** * Set the HTML contents of each element in the set of matched elements. @@ -5882,7 +5882,7 @@ $( "li" ).click(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ keydown(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -5954,7 +5954,7 @@ $( "#other" ).click(function() { ``` */ - keydown(handler?: JQuery.TypeEventHandler | + keydown(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. @@ -5969,7 +5969,7 @@ $( "#other" ).click(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ keypress(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -6041,7 +6041,7 @@ $( "#other" ).click(function() { ``` */ - keypress(handler?: JQuery.TypeEventHandler | + keypress(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. @@ -6056,7 +6056,7 @@ $( "#other" ).click(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ keyup(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -6129,7 +6129,7 @@ $( "#other").click(function() { ``` */ - keyup(handler?: JQuery.TypeEventHandler | + keyup(handler?: JQuery.TypeEventHandler | false): this; /** * Reduce the set of matched elements to the final one in the set. @@ -6419,7 +6419,7 @@ $( "input" ).click(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ mousedown(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -6457,7 +6457,7 @@ $( "p" ) ``` */ - mousedown(handler?: JQuery.TypeEventHandler | + mousedown(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. @@ -6472,7 +6472,7 @@ $( "p" ) * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ mouseenter(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. * @param handler A function to execute each time the event is triggered. @@ -6553,7 +6553,7 @@ $( "div.enterleave" ) ``` */ - mouseenter(handler?: JQuery.TypeEventHandler | + mouseenter(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. @@ -6568,7 +6568,7 @@ $( "div.enterleave" ) * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ mouseleave(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. * @param handler A function to execute each time the event is triggered. @@ -6647,7 +6647,7 @@ $( "div.enterleave" ) ``` */ - mouseleave(handler?: JQuery.TypeEventHandler | + mouseleave(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. @@ -6662,7 +6662,7 @@ $( "div.enterleave" ) * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ mousemove(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -6726,7 +6726,7 @@ $( "div" ).mousemove(function( event ) { ``` */ - mousemove(handler?: JQuery.TypeEventHandler | + mousemove(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. @@ -6741,7 +6741,7 @@ $( "div" ).mousemove(function( event ) { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ mouseout(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -6822,7 +6822,7 @@ $( "div.enterleave" ) ``` */ - mouseout(handler?: JQuery.TypeEventHandler | + mouseout(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. @@ -6837,7 +6837,7 @@ $( "div.enterleave" ) * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ mouseover(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -6918,7 +6918,7 @@ $( "div.enterleave" ) ``` */ - mouseover(handler?: JQuery.TypeEventHandler | + mouseover(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. @@ -6933,7 +6933,7 @@ $( "div.enterleave" ) * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ mouseup(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -6971,7 +6971,7 @@ $( "p" ) ``` */ - mouseup(handler?: JQuery.TypeEventHandler | + mouseup(handler?: JQuery.TypeEventHandler | false): this; /** * 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. @@ -7306,7 +7306,7 @@ $( "body" ).off( "click", "p", foo ); */ off(events: string, selector: JQuery.Selector, - handler: JQuery.TypeEventHandler | + handler: JQuery.TypeEventHandler | false): this; /** * Remove an event handler. @@ -7339,7 +7339,7 @@ $( "form" ).off( ".validator" ); */ off(events: string, selector_handler?: JQuery.Selector | - JQuery.TypeEventHandler | + JQuery.TypeEventHandler | false): this; /** * Remove an event handler. @@ -7349,7 +7349,7 @@ $( "form" ).off( ".validator" ); * @see \`{@link https://api.jquery.com/off/ }\` * @since 1.7 */ - off(events: JQuery.TypeEventHandlers, + off(events: JQuery.TypeEventHandlers, selector?: JQuery.Selector): this; /** * Remove an event handler. @@ -7539,7 +7539,7 @@ $( "*", document.body ).click(function( event ) { events: TType, selector: JQuery.Selector, data: TData, - handler: JQuery.TypeEventHandler + handler: JQuery.TypeEventHandler ): this; /** * Attach an event handler function for one or more events to the selected elements. @@ -7556,7 +7556,7 @@ $( "*", document.body ).click(function( event ) { events: TType, selector: null | undefined, data: TData, - handler: JQuery.TypeEventHandler + handler: JQuery.TypeEventHandler ): this; /** * Attach an event handler function for one or more events to the selected elements. @@ -7636,7 +7636,7 @@ $( "body" ).on( "click", "a", function( event ) { on( events: TType, selector: JQuery.Selector, - handler: JQuery.TypeEventHandler | + handler: JQuery.TypeEventHandler | false ): this; /** @@ -7658,7 +7658,7 @@ $( "p" ).on( "click", { foo: "bar" }, myHandler ); TData>( events: TType, data: TData, - handler: JQuery.TypeEventHandler + handler: JQuery.TypeEventHandler ): this; /** * Attach an event handler function for one or more events to the selected elements. @@ -7826,7 +7826,7 @@ $( "#cart" ).on( "mouseenter mouseleave", function( event ) { */ on( events: TType, - handler: JQuery.TypeEventHandler | + handler: JQuery.TypeEventHandler | false ): this; /** @@ -7933,7 +7933,7 @@ $( "#cart" ).on( "mouseenter mouseleave", function( event ) { * @since 1.7 */ on( - events: JQuery.TypeEventHandlers, + events: JQuery.TypeEventHandlers, selector: JQuery.Selector, data: TData ): this; @@ -7948,7 +7948,7 @@ $( "#cart" ).on( "mouseenter mouseleave", function( event ) { * @since 1.7 */ on( - events: JQuery.TypeEventHandlers, + events: JQuery.TypeEventHandlers, selector: null | undefined, data: TData ): this; @@ -7961,7 +7961,7 @@ $( "#cart" ).on( "mouseenter mouseleave", function( event ) { * @see \`{@link https://api.jquery.com/on/ }\` * @since 1.7 */ - on(events: JQuery.TypeEventHandlers, + on(events: JQuery.TypeEventHandlers, selector: JQuery.Selector ): this; /** @@ -7973,7 +7973,7 @@ $( "#cart" ).on( "mouseenter mouseleave", function( event ) { * @since 1.7 */ on( - events: JQuery.TypeEventHandlers, + events: JQuery.TypeEventHandlers, data: TData ): this; /** @@ -8024,7 +8024,7 @@ $( "div.test" ).on({ ``` */ - on(events: JQuery.TypeEventHandlers): this; + on(events: JQuery.TypeEventHandlers): this; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". @@ -8040,7 +8040,7 @@ $( "div.test" ).on({ events: TType, selector: JQuery.Selector, data: TData, - handler: JQuery.TypeEventHandler + handler: JQuery.TypeEventHandler ): this; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. @@ -8057,7 +8057,7 @@ $( "div.test" ).on({ events: TType, selector: null | undefined, data: TData, - handler: JQuery.TypeEventHandler + handler: JQuery.TypeEventHandler ): this; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. @@ -8072,7 +8072,7 @@ $( "div.test" ).on({ one( events: TType, selector: JQuery.Selector, - handler: JQuery.TypeEventHandler | + handler: JQuery.TypeEventHandler | false ): this; /** @@ -8087,7 +8087,7 @@ $( "div.test" ).on({ TData>( events: TType, data: TData, - handler: JQuery.TypeEventHandler + handler: JQuery.TypeEventHandler ): this; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. @@ -8179,7 +8179,7 @@ $(".target").one("click mouseenter", function() { */ one( events: TType, - handler: JQuery.TypeEventHandler| + handler: JQuery.TypeEventHandler| false ): this; /** @@ -8193,7 +8193,7 @@ $(".target").one("click mouseenter", function() { * @since 1.7 */ one( - events: JQuery.TypeEventHandlers, + events: JQuery.TypeEventHandlers, selector: JQuery.Selector, data: TData ): this; @@ -8208,7 +8208,7 @@ $(".target").one("click mouseenter", function() { * @since 1.7 */ one( - events: JQuery.TypeEventHandlers, + events: JQuery.TypeEventHandlers, selector: null | undefined, data: TData ): this; @@ -8221,7 +8221,7 @@ $(".target").one("click mouseenter", function() { * @see \`{@link https://api.jquery.com/one/ }\` * @since 1.7 */ - one(events: JQuery.TypeEventHandlers, + one(events: JQuery.TypeEventHandlers, selector: JQuery.Selector): this; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. @@ -8232,7 +8232,7 @@ $(".target").one("click mouseenter", function() { * @since 1.7 */ one( - events: JQuery.TypeEventHandlers, + events: JQuery.TypeEventHandlers, data: TData ): this; /** @@ -8242,7 +8242,7 @@ $(".target").one("click mouseenter", function() { * @see \`{@link https://api.jquery.com/one/ }\` * @since 1.7 */ - one(events: JQuery.TypeEventHandlers): this; + one(events: JQuery.TypeEventHandlers): this; /** * Set the CSS outer height of each element in the set of matched elements. * @param value_function _@param_ `value_function` @@ -10000,7 +10000,7 @@ $( "button" ).on( "click", function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ resize(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -10018,7 +10018,7 @@ $( window ).resize(function() { }); ``` */ - resize(handler?: JQuery.TypeEventHandler | + resize(handler?: JQuery.TypeEventHandler | false): this; /** * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. @@ -10033,7 +10033,7 @@ $( window ).resize(function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ scroll(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -10083,7 +10083,7 @@ $( window ).scroll(function() { ``` */ - scroll(handler?: JQuery.TypeEventHandler | + scroll(handler?: JQuery.TypeEventHandler | false): this; /** * Set the current horizontal position of the scroll bar for each of the set of matched elements. @@ -10258,7 +10258,7 @@ $( "p:last" ).text( "scrollTop:" + p.scrollTop() ); * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ select(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -10307,7 +10307,7 @@ $( ":input" ).select(function() { $( "input" ).select(); ``` */ - select(handler?: JQuery.TypeEventHandler | + select(handler?: JQuery.TypeEventHandler | false): this; /** * Encode a set of form elements as a string for submission. @@ -11279,7 +11279,7 @@ $( "#toggle" ).on( "click", function() { * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. */ submit(eventData: TData, - handler: JQuery.TypeEventHandler): this; + handler: JQuery.TypeEventHandler): this; /** * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. * @param handler A function to execute each time the event is triggered. @@ -11348,7 +11348,7 @@ $( "form" ).submit(function() { $( "form:first" ).submit(); ``` */ - submit(handler?: JQuery.TypeEventHandler | + submit(handler?: JQuery.TypeEventHandler | false): this; /** * Set the content of each element in the set of matched elements to the specified text. @@ -11969,7 +11969,7 @@ $( "p" ).unbind( "click", foo ); // ... foo will no longer be called. ``` */ unbind(event: string, - handler: JQuery.TypeEventHandler | + handler: JQuery.TypeEventHandler | false ): this; /** @@ -12064,7 +12064,7 @@ $( "body" ).undelegate( "p", "click", foo ); */ undelegate(selector: JQuery.Selector, eventType: string, - handler: JQuery.TypeEventHandler | + handler: JQuery.TypeEventHandler | false ): this; /** @@ -12085,7 +12085,7 @@ $( "body" ).undelegate( "p", "click", foo ); */ undelegate(selector: JQuery.Selector, eventType_events: string | - JQuery.TypeEventHandlers): this; + JQuery.TypeEventHandlers): this; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. * @param namespace A selector which will be used to filter the event results. diff --git a/types/jquery/misc.d.ts b/types/jquery/misc.d.ts index dd05435043..553f3a58ed 100644 --- a/types/jquery/misc.d.ts +++ b/types/jquery/misc.d.ts @@ -6314,20 +6314,18 @@ $( "#checkMetaKey" ).click(function( event ) { TData, TCurrentTarget, TTarget, - TContext, TType extends keyof TypeToTriggeredEventMap - > = EventHandlerBase[TType]>; + > = EventHandlerBase[TType]>; interface TypeEventHandlers< TDelegateTarget, TData, TCurrentTarget, - TTarget, - TContext - > extends _TypeEventHandlers { + TTarget + > extends _TypeEventHandlers { // No idea why it's necessary to include `object` in the union but otherwise TypeScript complains that // derived types of Event are not assignable to Event. - [type: string]: TypeEventHandler | + [type: string]: TypeEventHandler | false | undefined | object; @@ -6337,11 +6335,10 @@ $( "#checkMetaKey" ).click(function( event ) { TDelegateTarget, TData, TCurrentTarget, - TTarget, - TContext + TTarget > = { [TType in keyof TypeToTriggeredEventMap]?: - TypeEventHandler | + TypeEventHandler | false | object; }; diff --git a/types/jquery/test/longdesc-tests.ts b/types/jquery/test/longdesc-tests.ts index f3cf559638..8c5382f904 100644 --- a/types/jquery/test/longdesc-tests.ts +++ b/types/jquery/test/longdesc-tests.ts @@ -538,7 +538,7 @@ function longdesc() { $('#foo').slideUp(300).delay(800).fadeIn(400); } - function delegate_0(elements: HTMLElement[], selector: string, events: string, data: any, handler: JQuery.TypeEventHandler) { + function delegate_0(elements: HTMLElement[], selector: string, events: string, data: any, handler: JQuery.TypeEventHandler) { // jQuery 1.4.3+ $(elements).delegate(selector, events, data, handler); // jQuery 1.7+