UNPKG

1.28 kBJavaScriptView Raw
1/**
2 * Copyright 2013-present, Facebook, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
8 *
9 */
10
11'use strict';
12
13var SyntheticUIEvent = require('./SyntheticUIEvent');
14
15var getEventModifierState = require('./getEventModifierState');
16
17/**
18 * @interface TouchEvent
19 * @see http://www.w3.org/TR/touch-events/
20 */
21var TouchEventInterface = {
22 touches: null,
23 targetTouches: null,
24 changedTouches: null,
25 altKey: null,
26 metaKey: null,
27 ctrlKey: null,
28 shiftKey: null,
29 getModifierState: getEventModifierState
30};
31
32/**
33 * @param {object} dispatchConfig Configuration used to dispatch this event.
34 * @param {string} dispatchMarker Marker identifying the event target.
35 * @param {object} nativeEvent Native browser event.
36 * @extends {SyntheticUIEvent}
37 */
38function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
40}
41
42SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
43
44module.exports = SyntheticTouchEvent;
\No newline at end of file