@types/jquery-mousewheel
TypeScript icon, indicating that this package has built-in type declarations

3.1.12 • Public • Published

Installation

npm install --save @types/jquery-mousewheel

Summary

This package contains type definitions for jquery-mousewheel (https://github.com/jquery/jquery-mousewheel).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery-mousewheel.

index.d.ts

/// <reference types="jquery" />

declare global {
    namespace JQueryMousewheel {
        type JQueryMousewheelEventHook<
            O = JQueryMousewheelEventObject,
            D = JQueryMousewheelEventData,
        > =
            & { version: string }
            & { setup: (Extract<JQuery.SpecialEventHook<O, D>, { setup: any }>)["setup"] }
            & { teardown: (Extract<JQuery.SpecialEventHook<O, D>, { teardown: any }>)["teardown"] }
            & { getLineHeight(elem: Parameters<JQuery["appendTo"]>[0]): number | never }
            & { getPageHeight(elem: Parameters<JQuery["appendTo"]>[0]): number | never }
            & {
                settings: {
                    adjustOldDeltas: boolean;
                    normalizeOffset: boolean;
                };
            };
        type JQueryMousewheelEventHandler = (eventObject: JQueryMousewheelEventObject, ...args: any[]) => any;
        interface JQueryMousewheelEventObject extends JQueryEventObject {
            deltaX: number;
            deltaY: number;
            deltaFactor: number;
            deltaMode: number;
            absDelta: number;
            offsetX: number;
            offsetY: number;
        }
        interface JQueryMousewheelEventData {
            "mousewheel-line-height": number;
            "mousewheel-page-height": number;
        }
    }
    namespace JQuery {
        interface SpecialEventHooks {
            mousewheel: JQueryMousewheel.JQueryMousewheelEventHook;
        }
    }
    interface JQuery {
        on(event: "mousewheel", handler: JQueryMousewheel.JQueryMousewheelEventHandler): JQuery;
        mousewheel(handler: JQueryMousewheel.JQueryMousewheelEventHandler): JQuery;
        unmousewheel(): JQuery;
    }
}

/**
 * Factory function for Browserify in Node.js/CommonJS environments.
 * Modifies `$` to include the `jquery-mousewheel` library.
 * Designed for use with export-related JS features.
 *
 * @param $ JQuery static library object.
 */
declare function factory($: JQueryStatic): void;
export = factory;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Brian Surowiec.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/jquery-mousewheel

Weekly Downloads

4,151

Version

3.1.12

License

MIT

Unpacked Size

6.78 kB

Total Files

5

Last publish

Collaborators

  • types