@exmg/lit-base
Version:
Lit Base Elements for ExMachina
97 lines (96 loc) • 3.72 kB
TypeScript
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
export declare const wrap: (n: any) => any;
/** @type {!Object<string, !GestureRecognizer>} */
export declare const gestures: {};
/** @type {!Array<!GestureRecognizer>} */
export declare const recognizers: never[];
/**
* Finds the element rendered on the screen at the provided coordinates.
*
* Similar to `document.elementFromPoint`, but pierces through
* shadow roots.
*
* @param {number} x Horizontal pixel coordinate
* @param {number} y Vertical pixel coordinate
* @return {Element} Returns the deepest shadowRoot inclusive element
* found at the screen position given.
*/
export declare function deepTargetFind(x: any, y: any): Element | null;
/**
* a cheaper check than ev.composedPath()[0];
*
* @private
* @param {Event|Touch} ev Event.
* @return {EventTarget} Returns the event target.
*/
declare function _findOriginalTarget(ev: any): any;
/**
* Adds an event listener to a node for the given gesture type.
*
* @param {!EventTarget} node Node to add listener on
* @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`
* @param {!function(!Event):void} handler Event listener function to call
* @return {boolean} Returns true if a gesture event listener was added.
*/
export declare function addListener(node: any, evType: any, handler: any): boolean;
/**
* Removes an event listener from a node for the given gesture type.
*
* @param {!EventTarget} node Node to remove listener from
* @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`
* @param {!function(!Event):void} handler Event listener function previously passed to
* `addListener`.
* @return {boolean} Returns true if a gesture event listener was removed.
*/
export declare function removeListener(node: any, evType: any, handler: any): boolean;
/**
* Registers a new gesture event recognizer for adding new custom
* gesture event types.
*
* @param {!GestureRecognizer} recog Gesture recognizer descriptor
* @return {void}
*/
export declare function register(recog: any): void;
/**
* Sets scrolling direction on node.
*
* This value is checked on first move, thus it should be called prior to
* adding event listeners.
*
* @param {!EventTarget} node Node to set touch action setting on
* @param {string} value Touch action value
* @return {void}
*/
export declare function setTouchAction(node: any, value: any): void;
/**
* Prevents the dispatch and default action of the given event name.
*
* @param {string} evName Event name.
* @return {void}
*/
export declare function prevent(evName: any): 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.
*
* @return {void}
*/
export declare function resetMouseCanceller(): void;
/** @deprecated */
export declare const findOriginalTarget: typeof _findOriginalTarget;
/** @deprecated */
export declare const add: typeof addListener;
/** @deprecated */
export declare const remove: typeof removeListener;
export {};