import '../../../assert/js/assert.js';
import '../../../tandem/js/PhetioIDUtils.js';
import '../../../globals.js';
import TProperty from '../../../axon/js/TProperty.js';
import TReadOnlyProperty from '../../../axon/js/TReadOnlyProperty.js';
import Bounds2 from '../../../dot/js/Bounds2.js';
import Transform3 from '../../../dot/js/Transform3.js';
import Vector2 from '../../../dot/js/Vector2.js';
import { AllDragListenerOptions, Node, PressedPressListener, PressListener, PressListenerDOMEvent, PressListenerEvent, PressListenerOptions, SceneryEvent, TInputListener } from '../imports.js';
type OffsetPosition<Listener extends DragListener> = (point: Vector2, listener: Listener) => Vector2;
type SelfOptions<Listener extends DragListener> = AllDragListenerOptions<Listener, PressListenerDOMEvent> & {
    allowTouchSnag?: boolean;
    applyOffset?: boolean;
    useParentOffset?: boolean;
    trackAncestors?: boolean;
    offsetPosition?: OffsetPosition<Listener> | null;
    canClick?: boolean;
};
type CreateForwardingListenerOptions = {
    allowTouchSnag?: boolean;
};
export type DragListenerOptions<Listener extends DragListener = DragListener> = SelfOptions<Listener> & PressListenerOptions<Listener>;
export type PressedDragListener = DragListener & PressedPressListener;
export default class DragListener extends PressListener implements TInputListener {
    isUserControlledProperty: TProperty<boolean>;
    private _allowTouchSnag;
    private _applyOffset;
    private _useParentOffset;
    private _trackAncestors;
    private _translateNode;
    private _transform;
    private _positionProperty;
    private _mapPosition;
    private _offsetPosition;
    private _dragBoundsProperty;
    private _start;
    private _end;
    private _canClick;
    private _globalPoint;
    private _localPoint;
    private _parentPoint;
    private _modelPoint;
    private _modelDelta;
    private _parentOffset;
    private _transformTracker;
    private _transformTrackerListener;
    private _lastInterruptedTouchLikePointer;
    private _dragAction;
    constructor(providedOptions?: DragListenerOptions<PressedDragListener>);
    /**
     * Attempts to start a drag with a press.
     *
     * NOTE: This is safe to call externally in order to attempt to start a press. dragListener.canPress( event ) can
     * be used to determine whether this will actually start a drag.
     *
     * @param event
     * @param [targetNode] - If provided, will take the place of the targetNode for this call. Useful for forwarded presses.
     * @param [callback] - to be run at the end of the function, but only on success
     * @returns success - Returns whether the press was actually started
     */
    press(event: PressListenerEvent, targetNode?: Node, callback?: () => void): boolean;
    /**
     * Stops the drag.
     *
     * This can be called from the outside to stop the drag without the pointer having actually fired any 'up'
     * events. If the cancel/interrupt behavior is more preferable, call interrupt() on this listener instead.
     *
     * @param [event] - scenery event if there was one
     * @param [callback] - called at the end of the release
     */
    release(event?: PressListenerEvent, callback?: () => void): void;
    /**
     * Components using DragListener should generally not be activated with a click. A single click from alternative
     * input would pick up the component then immediately release it. But occasionally that is desirable and can be
     * controlled with the canClick option.
     */
    canClick(): boolean;
    /**
     * Activate the DragListener with a click activation. Usually, DragListener will NOT be activated with a click
     * and canClick will return false. Components that can be dragged usually should not be picked up/released
     * from a single click event that may have even come from event bubbling. But it can be optionally allowed for some
     * components that have drag functionality but can still be activated with a single click event.
     * (scenery-internal) (part of the scenery listener API)
     */
    click(event: SceneryEvent<MouseEvent>, callback?: () => void): boolean;
    /**
     * Called when move events are fired on the attached pointer listener during a drag.
     */
    drag(event: PressListenerEvent): void;
    /**
     * Attempts to start a touch snag, given a SceneryEvent.
     *
     * Should be safe to be called externally with an event.
     */
    tryTouchSnag(event: PressListenerEvent): void;
    /**
     * Returns a defensive copy of the local-coordinate-frame point of the drag.
     */
    getGlobalPoint(): Vector2;
    get globalPoint(): Vector2;
    /**
     * Returns a defensive copy of the local-coordinate-frame point of the drag.
     */
    getLocalPoint(): Vector2;
    get localPoint(): Vector2;
    /**
     * Returns a defensive copy of the parent-coordinate-frame point of the drag.
     */
    getParentPoint(): Vector2;
    get parentPoint(): Vector2;
    /**
     * Returns a defensive copy of the model-coordinate-frame point of the drag.
     */
    getModelPoint(): Vector2;
    get modelPoint(): Vector2;
    /**
     * Returns a defensive copy of the model-coordinate-frame delta.
     */
    getModelDelta(): Vector2;
    get modelDelta(): Vector2;
    /**
     * Maps a point from the global coordinate frame to our drag target's parent coordinate frame.
     *
     * NOTE: This mutates the input vector (for performance)
     *
     * Should be overridden if a custom transformation is needed.
     */
    protected globalToParentPoint(globalPoint: Vector2): Vector2;
    /**
     * Maps a point from the drag target's parent coordinate frame to its local coordinate frame.
     *
     * NOTE: This mutates the input vector (for performance)
     *
     * Should be overridden if a custom transformation is needed.
     */
    protected parentToLocalPoint(parentPoint: Vector2): Vector2;
    /**
     * Maps a point from the drag target's local coordinate frame to its parent coordinate frame.
     *
     * NOTE: This mutates the input vector (for performance)
     *
     * Should be overridden if a custom transformation is needed.
     */
    protected localToParentPoint(localPoint: Vector2): Vector2;
    /**
     * Maps a point from the drag target's parent coordinate frame to the model coordinate frame.
     *
     * NOTE: This mutates the input vector (for performance)
     *
     * Should be overridden if a custom transformation is needed. Note that by default, unless a transform is provided,
     * the parent coordinate frame will be the same as the model coordinate frame.
     */
    protected parentToModelPoint(parentPoint: Vector2): Vector2;
    /**
     * Maps a point from the model coordinate frame to the drag target's parent coordinate frame.
     *
     * NOTE: This mutates the input vector (for performance)
     *
     * Should be overridden if a custom transformation is needed. Note that by default, unless a transform is provided,
     * the parent coordinate frame will be the same as the model coordinate frame.
     */
    protected modelToParentPoint(modelPoint: Vector2): Vector2;
    /**
     * Apply a mapping from the drag target's model position to an allowed model position.
     *
     * A common example is using dragBounds, where the position of the drag target is constrained to within a bounding
     * box. This is done by mapping points outside the bounding box to the closest position inside the box. More
     * general mappings can be used.
     *
     * Should be overridden (or use mapPosition) if a custom transformation is needed.
     *
     * @returns - A point in the model coordinate frame
     */
    protected mapModelPoint(modelPoint: Vector2): Vector2;
    /**
     * Mutates the parentPoint given to account for the initial pointer's offset from the drag target's origin.
     */
    protected applyParentOffset(parentPoint: Vector2): void;
    /**
     * Triggers an update of the drag position, potentially changing position properties.
     *
     * Should be called when something that changes the output positions of the drag occurs (most often, a drag event
     * itself).
     */
    reposition(globalPoint: Vector2): void;
    /**
     * Called with 'touchenter' events (part of the listener API). (scenery-internal)
     *
     * NOTE: Do not call directly. See the press method instead.
     */
    touchenter(event: PressListenerEvent): void;
    /**
     * Called with 'touchmove' events (part of the listener API). (scenery-internal)
     *
     * NOTE: Do not call directly. See the press method instead.
     */
    touchmove(event: PressListenerEvent): void;
    /**
     * Called when an ancestor's transform has changed (when trackAncestors is true).
     */
    private ancestorTransformed;
    /**
     * Attaches our transform tracker (begins listening to the ancestor transforms)
     */
    private attachTransformTracker;
    /**
     * Detaches our transform tracker (stops listening to the ancestor transforms)
     */
    private detachTransformTracker;
    /**
     * Returns the drag bounds of the listener.
     */
    getDragBounds(): Bounds2 | null;
    get dragBounds(): Bounds2 | null;
    /**
     * Sets the drag transform of the listener.
     */
    setTransform(transform: Transform3 | TReadOnlyProperty<Transform3> | null): void;
    set transform(transform: Transform3 | TReadOnlyProperty<Transform3> | null);
    get transform(): Transform3 | TReadOnlyProperty<Transform3> | null;
    /**
     * Returns the transform of the listener.
     */
    getTransform(): Transform3 | TReadOnlyProperty<Transform3> | null;
    /**
     * Interrupts the listener, releasing it (canceling behavior).
     *
     * This effectively releases/ends the press, and sets the `interrupted` flag to true while firing these events
     * so that code can determine whether a release/end happened naturally, or was canceled in some way.
     *
     * This can be called manually, but can also be called through node.interruptSubtreeInput().
     */
    interrupt(): void;
    /**
     * Returns whether a press can be started with a particular event.
     */
    canPress(event: PressListenerEvent): boolean;
    /**
     * Disposes the listener, releasing references. It should not be used after this.
     */
    dispose(): void;
    /**
     * Creates an input listener that forwards events to the specified input listener. The target listener should
     * probably be using PressListener.options.targetNode so that the forwarded drag has the correct Trail
     *
     * See https://github.com/phetsims/scenery/issues/639
     */
    static createForwardingListener(down: (event: PressListenerEvent) => void, providedOptions?: CreateForwardingListenerOptions): TInputListener;
}
export {};
//# sourceMappingURL=DragListener.d.ts.map