diff --git a/jquery/updateTooltipAccessKeys.d.ts b/jquery/updateTooltipAccessKeys.d.ts new file mode 100644 index 0000000..5e0a459 --- /dev/null +++ b/jquery/updateTooltipAccessKeys.d.ts @@ -0,0 +1,45 @@ +import { Navigator } from "./client"; + +declare global { + interface JQuery { + updateTooltipAccessKeys: TooltipAccessKeys; + } +} + +type Modifier = "alt" | "alt-shift" | "ctrl" | "ctrl-option"; + +interface TooltipAccessKeys { + /** + * 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 {};