# @any-touch/swipe

> any-touch的识别器, 用来识别划动手势.

Latest version **2.2.0** (published 2022-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @any-touch/swipe
pnpm add @any-touch/swipe
yarn add @any-touch/swipe
bun add @any-touch/swipe
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2022-05-24 |
| First published | 2020-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | any86 |
| Maintainers | russell-ne |

## Links

- npm: https://www.npmjs.com/package/@any-touch/swipe
- npm.io page: https://npm.io/package/@any-touch/swipe

## Dependencies (2)

- [@any-touch/shared](https://npm.io/package/@any-touch/shared.md) ^2.2.0
- [@any-touch/compute](https://npm.io/package/@any-touch/compute.md) ^2.2.0

## Recent versions

- 2.2.0 (latest) — 2022-05-24
- 2.0.3-alpha.0 (next) — 2022-01-18
- 2.1.3 — 2022-05-24
- 2.1.2 — 2022-04-28
- 2.1.1 — 2022-04-08
- 2.1.0 — 2022-04-02
- 2.0.3 — 2022-03-30
- 2.0.3-2.0.3-alpha.1.0 — 2022-03-30
- 2.0.2 — 2022-01-06
- 2.0.2-alpha.1 — 2022-01-06
- 2.0.2-alpha.0 — 2022-01-06
- 2.0.1 — 2021-12-29
- 2.0.1-alpha.0 — 2021-12-28
- 2.0.0 — 2021-12-28
- 2.0.0-alpha.4 — 2021-12-02
- … 65 more at https://npm.io/package/@any-touch/swipe/versions

## README

# @any-touch/swipe
**快划**识别器.

## 安装
```shell
npm i -S @any-touch/swipe
```

## 快速开始
```javascript
// 只加载rotate识别器(旋转)
import Core from '@any-touch/core';
import swipe from '@any-touch/swipe';
const at = new Core(el);
at.use(swipe, 参数)

// 旋转
at.on('swipe', (event) => {
    // event包含位置/速度/方向等信息
});
```

## 参数
|名称|数据类型|默认值|说明|
|---|---|---|---|
|name|`String`|'swipe'|自定义事件名称|
|pointLength|`Number`|1|支持的触点数, 可支持多指触发|
|threshold| `Number`|10|触点离开前, 按压移动的距离超过10px才能触发事件|
|velocity| `Number`|0.3|快划超过30px/ms才触发事件|

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