-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add types for JQuery plugin of
mediawiki.util
- Loading branch information
Adrien LESÉNÉCHAL
committed
Mar 8, 2024
1 parent
d764135
commit 651af94
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Navigator } from "./client"; | ||
|
||
declare global { | ||
interface JQuery { | ||
updateTooltipAccessKeys: TooltipAccessKeys<this>; | ||
} | ||
} | ||
|
||
type Modifier = "alt" | "alt-shift" | "ctrl" | "ctrl-option"; | ||
|
||
interface TooltipAccessKeys<This = JQuery> { | ||
/** | ||
* Update the titles for all elements in a jQuery selection. | ||
* | ||
* @returns {JQuery} | ||
*/ | ||
(): This; | ||
|
||
/** | ||
* Get the access key label for an element. | ||
* | ||
* Will use native accessKeyLabel if available (currently only in Firefox 8+), | ||
* falls back to #getAccessKeyModifiers. | ||
* | ||
* @param {HTMLElement} element Element to get the label for | ||
* @returns {string} Access key label | ||
*/ | ||
// result may be HTMLElement.accessKeyLabel, the format of which depend very much on the browser. | ||
getAccessKeyLabel(element: HTMLElement): string; | ||
|
||
/** | ||
* @param {Navigator} [nav] An object with a 'userAgent' and 'platform' property. | ||
* @returns {string} | ||
*/ | ||
getAccessKeyPrefix(nav?: Navigator): `${Modifier}-`; | ||
|
||
/** | ||
* Switch test mode on and off. | ||
* | ||
* @param {boolean} mode New mode | ||
*/ | ||
setTestMode(mode: boolean): void; | ||
} | ||
|
||
export {}; |