Skip to content

Commit e01f258

Browse files
author
Stan Thomas
committed
TS 0.9.5 support: add definition for rest arguments in jQuery.on() to support optional parameters passed via jQuery.trigger().
1 parent 4cc9beb commit e01f258

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jquery/jquery.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,9 +1204,9 @@ interface JQuery {
12041204
* Attach an event handler function for one or more events to the selected elements.
12051205
*
12061206
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
1207-
* @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.
1207+
* @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).
12081208
*/
1209-
on(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
1209+
on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
12101210
/**
12111211
* Attach an event handler function for one or more events to the selected elements.
12121212
*

0 commit comments

Comments
 (0)