From fab0b336b0414fac23963bde83f7d7077f6cf14c Mon Sep 17 00:00:00 2001 From: mykohsu Date: Thu, 14 Jan 2016 15:30:05 -0800 Subject: [PATCH] Add additional off method that can accept a handler with extra arguments While this is not part of jQuery API for off() it is possible to attach such a handler using on(). See http://api.jquery.com/on/ and http://api.jquery.com/off/. --- jquery/jquery.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index ff259e7fb..ee6c0e19d 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -2271,6 +2271,13 @@ interface JQuery { * @param handler A handler function previously attached for the event(s), or the special value false. */ off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on(). + */ + off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Remove an event handler. *