# @types/dragula

> TypeScript definitions for dragula

Latest version **3.7.5** (published 2024-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/dragula
pnpm add @types/dragula
yarn add @types/dragula
bun add @types/dragula
```

## 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 | 3.7.5 |
| Published | 2024-04-19 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

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

## Recent versions

- 3.7.5 (latest) — 2024-04-19
- 3.7.4 (ts4.5) — 2023-11-07
- 3.7.1 (ts3.8) — 2021-07-06
- 3.7.0 (ts3.5) — 2020-02-05
- 2.1.34 (ts2.6) — 2018-10-27
- 2.1.39 — 2023-11-07
- 2.1.38 — 2023-10-18
- 3.7.3 — 2023-10-18
- 2.1.37 — 2023-09-22
- 3.7.2 — 2023-09-22
- 2.1.36 — 2021-07-06
- 2.1.35 — 2020-02-05
- 2.1.33 — 2018-03-09
- 2.1.32 — 2017-08-21
- 2.1.31 — 2017-07-14
- … 12 more at https://npm.io/package/@types/dragula/versions

## README

# Installation
> `npm install --save @types/dragula`

# Summary
This package contains type definitions for dragula (http://bevacqua.github.io/dragula/).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dragula.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dragula/index.d.ts)
````ts
declare const dragula: dragula.Dragula;

export = dragula;
export as namespace dragula;

declare namespace dragula {
    interface DragulaOptions {
        containers?: Element[] | undefined;
        isContainer?: ((el?: Element) => boolean) | undefined;
        moves?: ((el?: Element, container?: Element, handle?: Element, sibling?: Element) => boolean) | undefined;
        accepts?: ((el?: Element, target?: Element, source?: Element, sibling?: Element) => boolean) | undefined;
        invalid?: ((el?: Element, target?: Element) => boolean) | undefined;
        direction?: string | undefined;
        copy?: ((el: Element, source: Element) => boolean) | boolean | undefined;
        copySortSource?: boolean | undefined;
        revertOnSpill?: boolean | undefined;
        removeOnSpill?: boolean | undefined;
        delay?: boolean | number | undefined;
        mirrorContainer?: Element | undefined;
        ignoreInputTextSelection?: boolean | undefined;
        slideFactorX?: number | undefined;
        slideFactorY?: number | undefined;
    }

    interface Drake {
        containers: Element[];
        dragging: boolean;
        start(item: Element): void;
        end(): void;
        cancel(revert?: boolean): void;
        canMove(item: Element): boolean;
        remove(): void;
        on(event: "drag", listener: (el: Element, source: Element) => void): Drake;
        on(event: "dragend", listener: (el: Element) => void): Drake;
        on(event: "drop", listener: (el: Element, target: Element, source: Element, sibling: Element) => void): Drake;
        on(
            event: "cancel" | "remove" | "shadow" | "over" | "out",
            listener: (el: Element, container: Element, source: Element) => void,
        ): Drake;
        on(event: "cloned", listener: (clone: Element, original: Element, type: "mirror" | "copy") => void): Drake;
        destroy(): void;
    }

    interface Dragula {
        (containers: Element, options: DragulaOptions): Drake;
        (containers: Element[], options?: DragulaOptions): Drake;
        (options?: DragulaOptions): Drake;
    }
}

````

### Additional Details
 * Last updated: Fri, 19 Apr 2024 16:36:56 GMT
 * Dependencies: none

# Credits
These definitions were written by [Paul Welter](https://github.com/pwelter34), [Yang He](https://github.com/abruzzihraig), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).

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