# @types/react-dnd-scrollzone

> TypeScript definitions for react-dnd-scrollzone

Latest version **5.0.3** (published 2024-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-dnd-scrollzone
pnpm add @types/react-dnd-scrollzone
yarn add @types/react-dnd-scrollzone
bun add @types/react-dnd-scrollzone
```

## 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 | 5.0.3 |
| Published | 2024-09-30 |
| First published | 2019-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-dnd-scrollzone
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dnd-scrollzone
- npm.io page: https://npm.io/package/@types/react-dnd-scrollzone

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 5.0.3 (latest) — 2024-09-30
- 5.0.2 (ts4.7) — 2023-11-07
- 5.0.0 (ts3.0) — 2019-11-19
- 5.0.1 — 2023-10-18

## README

# Installation
> `npm install --save @types/react-dnd-scrollzone`

# Summary
This package contains type definitions for react-dnd-scrollzone (https://github.com/azuqua/react-dnd-scrollzone#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dnd-scrollzone.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dnd-scrollzone/index.d.ts)
````ts
import { ComponentType } from "react";

/**
 * The strength functions are both called with two arguments.
 * 1. An object representing the rectangle occupied by the Scrollzone.
 * 2. An object representing the coordinates of mouse.
 *
 * They should return a value between -1 and 1.
 * - Negative values scroll up or left.
 * - Positive values scroll down or right.
 * - 0 stops all scrolling.
 */
export type StrengthCallback = (
    scrollZone: {
        x: number;
        y: number;
        w: number;
        h: number;
    },
    mouse: {
        x: number;
        y: number;
    },
) => number;

export function createVerticalStrength(buffer: number): StrengthCallback;
export function createHorizontalStrength(buffer: number): StrengthCallback;

export const defaultVerticalStrength: StrengthCallback;
export const defaultHorizontalStrength: StrengthCallback;

export default function withScrolling<T>(component: ComponentType<T>): ComponentType<
    T & {
        /**
         * A function that is called when scrollLeft or scrollTop of the component are changed.
         * Called with those two arguments in that order.
         *
         * @default noop
         */
        onScrollChange?: (top: number, left: number) => void;

        /**
         * A function that returns the strength of the vertical scroll direction.
         * It should return a value between -1 and 1.
         *
         * @default defaultVerticalStrength
         */
        verticalStrength?: StrengthCallback;

        /**
         * A function that returns the strength of the horizontal scroll direction.
         *
         * @default defaultHorizontalStrength
         */
        horizontalStrength?: StrengthCallback;

        /**
         * Strength multiplier
         *
         * @default 30
         */
        strengthMultiplier?: number;
    }
>;

````

### Additional Details
 * Last updated: Mon, 30 Sep 2024 14:38:59 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [Marcos Junior](https://github.com/junalmeida).

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