mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-07 09:49:07 +00:00
Merge pull request #26243 from AndersonFriaca/jquery-mouse-exit
Types for JQuery Mouse Exit
This commit is contained in:
23
types/jquery-mouse-exit/index.d.ts
vendored
Normal file
23
types/jquery-mouse-exit/index.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// Type definitions for jquery-mouse-exit 1.0
|
||||
// Project: https://github.com/makeup-jquery/jquery-mouse-exit
|
||||
// Definitions by: Anderson Friaça <https://github.com/AndersonFriaca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
export type Options = Partial<{
|
||||
delay: number;
|
||||
}>;
|
||||
|
||||
export type FocusElements = Partial<{
|
||||
lostFocus: HTMLElement;
|
||||
gainedFocus: HTMLElement;
|
||||
}>;
|
||||
|
||||
declare global {
|
||||
interface JQuery {
|
||||
mouseExit(options?: Options): JQuery;
|
||||
on(event: 'mouseExit', handler: ((event: JQuery.Event<HTMLElement>, data: FocusElements) => void)): JQuery;
|
||||
}
|
||||
}
|
||||
9
types/jquery-mouse-exit/jquery-mouse-exit-tests.ts
Normal file
9
types/jquery-mouse-exit/jquery-mouse-exit-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// init plugin
|
||||
$('#container').mouseExit({
|
||||
delay: 500
|
||||
});
|
||||
|
||||
// handle event
|
||||
$('#container').on('mouseExit', (e, data) => {
|
||||
console.log(data.lostFocus, data.gainedFocus);
|
||||
});
|
||||
25
types/jquery-mouse-exit/tsconfig.json
Normal file
25
types/jquery-mouse-exit/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jquery-mouse-exit-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/jquery-mouse-exit/tslint.json
Normal file
1
types/jquery-mouse-exit/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{"extends": "dtslint/dt.json"}
|
||||
Reference in New Issue
Block a user