From e01f25822c7af49e54533640be3ce62d5b41f8c3 Mon Sep 17 00:00:00 2001 From: Stan Thomas Date: Tue, 10 Dec 2013 17:17:15 +0000 Subject: [PATCH] TS 0.9.5 support: add definition for rest arguments in jQuery.on() to support optional parameters passed via jQuery.trigger(). --- jquery/jquery.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 4b8e9f49c..2bd9beecc 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1204,9 +1204,9 @@ interface JQuery { * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @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. + * @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). */ - on(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. *