Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@any-touch/pinch

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@any-touch/pinch - npm Package Compare versions

Comparing version 0.7.9 to 0.8.0

12

dist/index.d.ts

@@ -1,2 +0,2 @@

import { Input, CommonEmitFunction } from '@any-touch/shared';
import type { Computed, EventTrigger } from '@any-touch/shared';
import Recognizer from '@any-touch/recognizer';

@@ -12,12 +12,12 @@ declare const DEFAULT_OPTIONS: {

* 识别条件
* @param {AnyTouchEvent} 计算数据
* @param {(isRecognized: boolean) => void}} 接收是否识别状态
* @param computed 计算数据
* @param 是否符合
*/
test(input: Input): boolean;
test(computed: Computed): boolean;
/**
* 开始识别
* @param {Input} 输入
* @param computed 计算结果
*/
recognize(input: Input, emit: CommonEmitFunction): void;
recognize(computed: Computed, emit: EventTrigger): void;
}
export {};
import { __extends, __assign } from 'tslib';
import { ComputeVectorForMutli, computeScale } from '@any-touch/compute';
import { ComputeScale } from '@any-touch/compute';
import Recognizer, { recognizeForPressMoveLike } from '@any-touch/recognizer';

@@ -13,7 +13,8 @@

function default_1(options) {
return _super.call(this, __assign(__assign({}, DEFAULT_OPTIONS), options)) || this;
var _this = _super.call(this, __assign(__assign({}, DEFAULT_OPTIONS), options)) || this;
_this.computeFunctions = [ComputeScale];
return _this;
}
default_1.prototype.test = function (input) {
var pointLength = input.pointLength;
var scale = this.computed.scale;
default_1.prototype.test = function (computed) {
var pointLength = computed.pointLength, scale = computed.scale;
return this.isValidPointLength(pointLength)

@@ -23,8 +24,4 @@ && void 0 !== scale

};
default_1.prototype.recognize = function (input, emit) {
var computed = this.compute([ComputeVectorForMutli], input);
if ("activeV" in computed) {
this.computed = __assign(__assign({}, this.computed), computeScale(computed));
}
recognizeForPressMoveLike(this, input, emit);
default_1.prototype.recognize = function (computed, emit) {
recognizeForPressMoveLike(this, computed, emit);
};

@@ -31,0 +28,0 @@ return default_1;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("tslib"),i=require("@any-touch/compute"),o=require("@any-touch/recognizer"),s=(t=o)&&"object"==typeof t&&"default"in t?t.default:t,n={name:"pinch",threshold:0,pointLength:2},r=function(t){function s(i){return t.call(this,e.__assign(e.__assign({},n),i))||this}return e.__extends(s,t),s.prototype.test=function(t){var e=t.pointLength,i=this.computed.scale;return this.isValidPointLength(e)&&void 0!==i&&(this.options.threshold<Math.abs(i-1)||this.isRecognized)},s.prototype.recognize=function(t,s){var n=this.compute([i.ComputeVectorForMutli],t);"activeV"in n&&(this.computed=e.__assign(e.__assign({},this.computed),i.computeScale(n))),o.recognizeForPressMoveLike(this,t,s)},s}(s);exports.default=r;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),i=require("@any-touch/compute"),o=require("@any-touch/recognizer"),n=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,r={name:"pinch",threshold:0,pointLength:2},s=function(e){function n(o){var n=e.call(this,t.__assign(t.__assign({},r),o))||this;return n.computeFunctions=[i.ComputeScale],n}return t.__extends(n,e),n.prototype.test=function(e){var t=e.pointLength,i=e.scale;return this.isValidPointLength(t)&&void 0!==i&&(this.options.threshold<Math.abs(i-1)||this.isRecognized)},n.prototype.recognize=function(e,t){o.recognizeForPressMoveLike(this,e,t)},n}(n);exports.default=s;
{
"name": "@any-touch/pinch",
"version": "0.7.9",
"version": "0.8.0",
"description": "any-touch的识别器, 用来识别捏合手势.",

@@ -17,4 +17,4 @@ "main": "./dist/index",

"dependencies": {
"@any-touch/compute": "^0.7.9",
"@any-touch/recognizer": "^0.7.9"
"@any-touch/compute": "^0.8.0",
"@any-touch/recognizer": "^0.8.0"
},

@@ -25,3 +25,3 @@ "publishConfig": {

"sideEffects": false,
"gitHead": "4d795d9ac1c0cf597db9bc070284f3de7578e5fd"
"gitHead": "2bc02cd25dc78562a2b61c95e2d481ac718e805e"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc