summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/third_party/polymer2/bower_components/polymer/types/lib/utils/gestures.d.ts
blob: 6c7843506c33553427f7c378289f8a16e3a85496 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
 * DO NOT EDIT
 *
 * This file was automatically generated by
 *   https://github.com/Polymer/gen-typescript-declarations
 *
 * To modify these typings, edit the source file(s):
 *   lib/utils/gestures.html
 */

/// <reference path="boot.d.ts" />
/// <reference path="async.d.ts" />
/// <reference path="debounce.d.ts" />

declare namespace Polymer {

  /**
   * Module for adding listeners to a node for the following normalized
   * cross-platform "gesture" events:
   * - `down` - mouse or touch went down
   * - `up` - mouse or touch went up
   * - `tap` - mouse click or finger tap
   * - `track` - mouse drag or touch move
   */
  namespace Gestures {


    /**
     * Finds the element rendered on the screen at the provided coordinates.
     *
     * Similar to `document.elementFromPoint`, but pierces through
     * shadow roots.
     *
     * @returns Returns the deepest shadowRoot inclusive element
     * found at the screen position given.
     */
    function deepTargetFind(x: number, y: number): _Element|null;


    /**
     * Adds an event listener to a node for the given gesture type.
     *
     * @returns Returns true if a gesture event listener was added.
     */
    function addListener(node: Node, evType: string, handler: (p0: Event) => void): boolean;


    /**
     * Removes an event listener from a node for the given gesture type.
     *
     * @returns Returns true if a gesture event listener was removed.
     */
    function removeListener(node: Node, evType: string, handler: (p0: Event) => void): boolean;


    /**
     * Registers a new gesture event recognizer for adding new custom
     * gesture event types.
     */
    function register(recog: GestureRecognizer): void;


    /**
     * Sets scrolling direction on node.
     *
     * This value is checked on first move, thus it should be called prior to
     * adding event listeners.
     */
    function setTouchAction(node: _Element, value: string): void;


    /**
     * Prevents the dispatch and default action of the given event name.
     */
    function prevent(evName: string): void;


    /**
     * Reset the 2500ms timeout on processing mouse input after detecting touch input.
     *
     * Touch inputs create synthesized mouse inputs anywhere from 0 to 2000ms after the touch.
     * This method should only be called during testing with simulated touch inputs.
     * Calling this method in production may cause duplicate taps or other Gestures.
     */
    function resetMouseCanceller(): void;
  }
}