export * from './touch-manager';
/**
 * Events emitted during gesture lifecycle
 */
export var GestureEvents;
(function (GestureEvents) {
    /**
     * When the gesture is attached to the view
     * Provides access to the native gesture recognizer for further customization
     */
    GestureEvents["gestureAttached"] = "gestureAttached";
    /**
     * When a touch down was detected
     */
    GestureEvents["touchDown"] = "touchDown";
    /**
     * When a touch up was detected
     */
    GestureEvents["touchUp"] = "touchUp";
})(GestureEvents || (GestureEvents = {}));
/**
 * Defines an enum with supported gesture types.
 */
export var GestureTypes;
(function (GestureTypes) {
    /**
     * Denotes tap (click) gesture.
     */
    GestureTypes[GestureTypes["tap"] = 1] = "tap";
    /**
     * Denotes double tap gesture.
     */
    GestureTypes[GestureTypes["doubleTap"] = 2] = "doubleTap";
    /**
     * Denotes pinch gesture.
     */
    GestureTypes[GestureTypes["pinch"] = 4] = "pinch";
    /**
     * Denotes pan gesture.
     */
    GestureTypes[GestureTypes["pan"] = 8] = "pan";
    /**
     * Denotes swipe gesture.
     */
    GestureTypes[GestureTypes["swipe"] = 16] = "swipe";
    /**
     * Denotes rotation gesture.
     */
    GestureTypes[GestureTypes["rotation"] = 32] = "rotation";
    /**
     * Denotes long press gesture.
     */
    GestureTypes[GestureTypes["longPress"] = 64] = "longPress";
    /**
     * Denotes touch action.
     */
    GestureTypes[GestureTypes["touch"] = 128] = "touch";
})(GestureTypes || (GestureTypes = {}));
/**
 * Defines an enum with supported gesture states.
 */
export var GestureStateTypes;
(function (GestureStateTypes) {
    /**
     * Gesture canceled.
     */
    GestureStateTypes[GestureStateTypes["cancelled"] = 0] = "cancelled";
    /**
     * Gesture began.
     */
    GestureStateTypes[GestureStateTypes["began"] = 1] = "began";
    /**
     * Gesture changed.
     */
    GestureStateTypes[GestureStateTypes["changed"] = 2] = "changed";
    /**
     * Gesture ended.
     */
    GestureStateTypes[GestureStateTypes["ended"] = 3] = "ended";
})(GestureStateTypes || (GestureStateTypes = {}));
/**
 * Defines an enum for swipe gesture direction.
 */
export var SwipeDirection;
(function (SwipeDirection) {
    /**
     * Denotes right direction for swipe gesture.
     */
    SwipeDirection[SwipeDirection["right"] = 1] = "right";
    /**
     * Denotes left direction for swipe gesture.
     */
    SwipeDirection[SwipeDirection["left"] = 2] = "left";
    /**
     * Denotes up direction for swipe gesture.
     */
    SwipeDirection[SwipeDirection["up"] = 4] = "up";
    /**
     * Denotes down direction for swipe gesture.
     */
    SwipeDirection[SwipeDirection["down"] = 8] = "down";
})(SwipeDirection || (SwipeDirection = {}));
/**
 * Defines a touch action
 */
export var TouchAction;
(function (TouchAction) {
    /**
     * Down action.
     */
    TouchAction["down"] = "down";
    /**
     * Up action.
     */
    TouchAction["up"] = "up";
    /**
     * Move action.
     */
    TouchAction["move"] = "move";
    /**
     * Cancel action.
     */
    TouchAction["cancel"] = "cancel";
})(TouchAction || (TouchAction = {}));
/**
 * 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 function toString(type) {
    switch (type) {
        case GestureTypes.tap:
            return GestureTypes[GestureTypes.tap];
        case GestureTypes.doubleTap:
            return GestureTypes[GestureTypes.doubleTap];
        case GestureTypes.pinch:
            return GestureTypes[GestureTypes.pinch];
        case GestureTypes.pan:
            return GestureTypes[GestureTypes.pan];
        case GestureTypes.swipe:
            return GestureTypes[GestureTypes.swipe];
        case GestureTypes.rotation:
            return GestureTypes[GestureTypes.rotation];
        case GestureTypes.longPress:
            return GestureTypes[GestureTypes.longPress];
        case GestureTypes.touch:
            return GestureTypes[GestureTypes.touch];
    }
}
/**
 * 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 function fromString(type) {
    return GestureTypes[type];
}
export class GesturesObserverBase {
    get callback() {
        return this._callback;
    }
    get target() {
        return this._target;
    }
    get context() {
        return this._context;
    }
    constructor(target, callback, context) {
        this._target = target;
        this._callback = callback;
        this._context = context;
    }
    disconnect() {
        this._target = null;
        this._callback = null;
        this._context = null;
    }
}
//# sourceMappingURL=gestures-common.js.map