mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add event shortcut methods
This commit is contained in:
@@ -306,3 +306,9 @@ $.browser.playbook;
|
||||
!!$.os.ios; // => true
|
||||
!!$.os.version; // => "6.1"
|
||||
!!$.browser.version; // => "536.26"
|
||||
|
||||
// shortcut methods for `.bind(event, fn)` for each event type
|
||||
$('#example').click();
|
||||
$('#example').click(() => {
|
||||
alert('clicked');
|
||||
});
|
||||
Vendored
+69
@@ -1407,6 +1407,75 @@ interface ZeptoCollection {
|
||||
**/
|
||||
undelegate(selector: string, type: string, fn: (e: Event) => boolean): ZeptoCollection;
|
||||
|
||||
focusin(): ZeptoCollection;
|
||||
focusin(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
focusout(): ZeptoCollection;
|
||||
focusout(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
load(): ZeptoCollection;
|
||||
load(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
resize(): ZeptoCollection;
|
||||
resize(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
scroll(): ZeptoCollection;
|
||||
scroll(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
unload(): ZeptoCollection;
|
||||
unload(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
click(): ZeptoCollection;
|
||||
click(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
dblclick(): ZeptoCollection;
|
||||
dblclick(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
mousedown(): ZeptoCollection;
|
||||
mousedown(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
mouseup(): ZeptoCollection;
|
||||
mouseup(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
mousemove(): ZeptoCollection;
|
||||
mousemove(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
mouseover(): ZeptoCollection;
|
||||
mouseover(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
mouseout(): ZeptoCollection;
|
||||
mouseout(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
mouseenter(): ZeptoCollection;
|
||||
mouseenter(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
mouseleave(): ZeptoCollection;
|
||||
mouseleave(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
change(): ZeptoCollection;
|
||||
change(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
select(): ZeptoCollection;
|
||||
select(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
keydown(): ZeptoCollection;
|
||||
keydown(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
keypress(): ZeptoCollection;
|
||||
keypress(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
keyup(): ZeptoCollection;
|
||||
keyup(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
error(): ZeptoCollection;
|
||||
error(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
focus(): ZeptoCollection;
|
||||
focus(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
blur(): ZeptoCollection;
|
||||
blur(fn: (e: Event) => any): ZeptoCollection;
|
||||
|
||||
/**
|
||||
* Ajax
|
||||
**/
|
||||
|
||||
Reference in New Issue
Block a user