@nativescript/core
Version:
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
33 lines (32 loc) • 1.55 kB
TypeScript
import type { GesturesObserverDefinition, GestureEventData } from './gestures-types';
import { GestureTypes } from './gestures-types';
import type { View } from '../core/view';
/**
* Returns a string representation of a gesture type.
* @param type - The singular type of the gesture. Looks for an exact match, so
* passing plural types like `GestureTypes.tap & GestureTypes.doubleTap` will
* simply return undefined.
*/
export declare function toString(type: GestureTypes): (typeof GestureTypes)[GestureTypes] | undefined;
/**
* Returns a gesture type enum value from a string (case insensitive).
*
* @param type - A string representation of a single gesture type (e.g. "tap").
*/
export declare function fromString(type: (typeof GestureTypes)[GestureTypes]): GestureTypes | undefined;
export declare abstract class GesturesObserverBase implements GesturesObserverDefinition {
private _callback;
private _target;
private _context?;
/** This is populated on the first call to observe(). */
type: GestureTypes;
get callback(): (args: GestureEventData) => void;
get target(): View;
get context(): any;
constructor(target: View, callback: (args: GestureEventData) => void, context?: any);
abstract androidOnTouchEvent(motionEvent: android.view.MotionEvent): any;
abstract observe(type: GestureTypes): any;
disconnect(): void;
}
export { GesturesObserverBase as GesturesObserver };
export { TouchAction, GestureStateTypes, GestureTypes, SwipeDirection, GestureEvents } from './gestures-types';