react-tap-event-plugin: include shouldRejectClick option. (#9444)

This commit is contained in:
Nathan Brown
2016-06-02 23:24:34 +09:00
committed by Masahiro Wakame
parent 31c3c5db10
commit d9b6b8e455
2 changed files with 22 additions and 4 deletions
@@ -1,5 +1,18 @@
/// <reference path="react-tap-event-plugin.d.ts"/>
import * as injectTapEventPlugin from 'react-tap-event-plugin';
import * as injectTapEventPluginAll from 'react-tap-event-plugin';
injectTapEventPlugin();
// since the export is a function, this is the only actual correct way:
import injectTapEventPluginRequire = require("react-tap-event-plugin");
injectTapEventPluginAll();
injectTapEventPluginAll({
shouldRejectClick: function (lastTouchEventTimestamp, clickEventTimestamp) {
return true;
}
});
injectTapEventPluginRequire();
injectTapEventPluginRequire({});
+7 -2
View File
@@ -4,6 +4,11 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'react-tap-event-plugin'{
var exports:()=>any;
export = exports;
interface StrategyOverrides {
shouldRejectClick?: (lastTouchEventTimestamp: Date, clickEventTimestamp: Date) => boolean;
}
var injectTapEventPlugin: (strategyOverrides?: StrategyOverrides) => void;
export = injectTapEventPlugin;
}