# @types/subscribe-ui-event

> TypeScript definitions for subscribe-ui-event

Latest version **1.1.8** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/subscribe-ui-event
pnpm add @types/subscribe-ui-event
yarn add @types/subscribe-ui-event
bun add @types/subscribe-ui-event
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.8 |
| Published | 2023-11-07 |
| First published | 2018-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51444 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/subscribe-ui-event
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/subscribe-ui-event
- npm.io page: https://npm.io/package/@types/subscribe-ui-event

## Recent versions

- 1.1.8 (latest) — 2023-11-07
- 1.1.5 (ts4.0) — 2022-07-05
- 1.1.4 (ts3.8) — 2021-12-24
- 1.1.3 (ts3.6) — 2021-07-09
- 1.1.1 (ts2.3) — 2018-09-18
- 1.1.7 — 2023-10-18
- 1.1.6 — 2023-09-25
- 1.1.2 — 2021-07-02
- 1.1.0 — 2018-04-13

## README

# Installation
> `npm install --save @types/subscribe-ui-event`

# Summary
This package contains type definitions for subscribe-ui-event (https://github.com/yahoo/subscribe-ui-event#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/subscribe-ui-event.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/subscribe-ui-event/index.d.ts)
````ts
export type UIEventType =
    | "resize"
    | "resizeEnd"
    | "resizeStart"
    | "scroll"
    | "scrollEnd"
    | "scrollStart"
    | "visibilitychange";

export type TouchEventType =
    | "touchend"
    | "touchmove"
    | "touchmoveEnd"
    | "touchmoveStart"
    | "touchstart";

export type EventType = UIEventType | TouchEventType;

export interface SubscribeOptions {
    context?: any;
    enableResizeInfo?: boolean | undefined;
    enableScrollInfo?: boolean | undefined;
    enableTouchInfo?: boolean | undefined;
    eventOptions?: AddEventListenerOptions | undefined;
    target?: HTMLElement | Window | Document | null;
    throttleRate?: number | undefined;
    useRAF?: boolean | undefined;
}

export interface ArgmentedEvent<T extends EventType> {
    mainType: string;
    resize: {
        height: number;
        width: number;
    };
    scroll: {
        delta: number;
        top: number;
    };
    subType: string;
    type: T;
    touch: {
        axisIntention: "x" | "y" | "";
        deltaX: number;
        deltaY: number;
        startX: number;
        startY: number;
    };
}

export type UIEventCallback<T extends UIEventType = UIEventType> = (
    event: UIEvent,
    payload: ArgmentedEvent<T>,
) => any;

export type TouchEventCallback<T extends TouchEventType = TouchEventType> = (
    event: TouchEvent,
    payload: ArgmentedEvent<T>,
) => any;

export interface Subscription {
    unsubscribe: () => void;
}

export function subscribe<T extends UIEventType>(
    eventType: T,
    callback: UIEventCallback<T>,
    options?: SubscribeOptions,
): Subscription;

export function subscribe<T extends TouchEventType>(
    eventType: T,
    callback: TouchEventCallback<T>,
    options?: SubscribeOptions,
): Subscription;

export function unsubscribe<T extends UIEventType>(
    eventType: T,
    callback: UIEventCallback<T>,
): void;

export function unsubscribe<T extends TouchEventType>(
    eventType: T,
    callback: TouchEventCallback<T>,
): void;

export function listen(
    target: EventTarget,
    eventType: string,
    handler: EventListenerOrEventListenerObject,
    options?: AddEventListenerOptions,
): {
    remove: () => void;
};

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by .

---
_Source: https://npm.io/package/@types/subscribe-ui-event · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
