import '../../../assert/js/assert.js';
import '../../../globals.js';
/**
 * MultiListener is responsible for monitoring the mouse, touch, and other presses on the screen and determines the
 * operations to apply to a target Node from this input. Single touch dragging on the screen will initiate
 * panning. Multi-touch gestures will initiate scaling, translation, and potentially rotation depending on
 * the gesture.
 *
 * MultiListener will keep track of all "background" presses on the screen. When certain conditions are met, the
 * "background" presses become active and attached listeners may be interrupted so that the MultiListener
 * gestures take precedence. MultiListener uses the Intent feature of Pointer, so that the default behavior of this
 * listener can be prevented if necessary. Generally, you would use Pointer.reserveForDrag() to indicate
 * that your Node is intended for other input that should not be interrupted by this listener.
 *
 * For example usage, see scenery/examples/input.html. A typical "simple" MultiListener usage
 * would be something like:
 *
 *    display.addInputListener( new PressListener( targetNode ) );
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 * @author Jesse Greenberg
 */
import Property from '../../../axon/js/Property.js';
import Matrix3 from '../../../dot/js/Matrix3.js';
import { PhetioObjectOptions } from '../../../tandem/js/PhetioObject.js';
import { MultiListenerPress, Node, SceneryEvent, TInputListener } from '../imports.js';
export type MultiListenerOptions = {
    mouseButton?: number;
    pressCursor?: string;
    allowScale?: boolean;
    allowRotation?: boolean;
    allowMultitouchInterruption?: boolean;
    allowMoveInterruption?: boolean;
    minScale?: number;
    maxScale?: number;
} & Pick<PhetioObjectOptions, 'tandem'>;
declare class MultiListener implements TInputListener {
    protected readonly _targetNode: Node;
    protected readonly _minScale: number;
    protected readonly _maxScale: number;
    private readonly _mouseButton;
    protected readonly _pressCursor: string;
    private readonly _allowScale;
    private readonly _allowRotation;
    private readonly _allowMultitouchInterruption;
    private readonly _allowMoveInterruption;
    protected readonly _presses: MultiListenerPress[];
    private readonly _backgroundPresses;
    readonly matrixProperty: Property<Matrix3>;
    private _interrupted;
    private _pressListener;
    private _backgroundListener;
    /**
     * @constructor
     *
     * @param targetNode - The Node that should be transformed by this MultiListener.
     * @param [providedOptions]
     */
    constructor(targetNode: Node, providedOptions?: MultiListenerOptions);
    /**
     * Finds a Press by searching for the one with the provided Pointer.
     */
    private findPress;
    /**
     * Find a background Press by searching for one with the provided Pointer. A background Press is one created
     * when we receive an event while a Pointer is already attached.
     */
    private findBackgroundPress;
    /**
     * Returns true if the press is already contained in one of this._backgroundPresses or this._presses. There are cases
     * where we may try to add the same pointer twice (user opened context menu, using a mouse during fuzz testing), and
     * we want to avoid adding a press again in those cases.
     */
    private hasPress;
    /**
     * Interrupt all listeners on the pointer, except for background listeners that
     * were added by this MultiListener. Useful when it is time for this listener to
     * "take over" and interrupt any other listeners on the pointer.
     */
    private interruptOtherListeners;
    /**
     * Part of the scenery event API. (scenery-internal)
     */
    down(event: SceneryEvent): void;
    /**
     * Add a Press to this listener when a new Pointer is down.
     */
    protected addPress(press: MultiListenerPress): void;
    /**
     * Reposition in response to movement of any Presses.
     */
    protected movePress(press: MultiListenerPress): void;
    /**
     * Remove a Press from this listener.
     */
    protected removePress(press: MultiListenerPress): void;
    /**
     * Add a background Press, a Press that we receive while a Pointer is already attached. Depending on background
     * Presses, we may interrupt the attached pointer to begin zoom operations.
     */
    private addBackgroundPress;
    /**
     * Remove a background Press from this listener.
     */
    private removeBackgroundPress;
    /**
     * Reposition the target Node (including all apsects of transformation) of this listener's target Node.
     */
    protected reposition(): void;
    /**
     * Recompute the local points of the Presses for this listener, relative to the target Node.
     */
    protected recomputeLocals(): void;
    /**
     * Interrupt this listener.
     */
    interrupt(): void;
    /**
     * Compute the transformation matrix for the target Node based on Presses.
     */
    private computeMatrix;
    /**
     * Compute a transformation matrix from a single press. Single press indicates translation (panning) for the
     * target Node.
     */
    private computeSinglePressMatrix;
    /**
     * Compute a translation matrix from multiple presses. Usually multiple presses will have some scale or rotation
     * as well, but this is to be used if rotation and scale are not enabled for this listener.
     */
    computeTranslationMatrix(): Matrix3;
    /**
     * A transformation matrix from multiple Presses that will translate and scale the target Node.
     */
    private computeTranslationScaleMatrix;
    /**
     * Limit the provided scale by constraints of this MultiListener.
     */
    protected limitScale(scale: number): number;
    /**
     * Compute a transformation matrix that will translate and scale the target Node from multiple presses. Should
     * be used when scaling is not enabled for this listener.
     */
    private computeTranslationRotationMatrix;
    /**
     * Compute a transformation matrix that will translate, scale, and rotate the target Node from multiple Presses.
     */
    private computeTranslationRotationScaleMatrix;
    /**
     * Get the current scale on the target Node, assumes that there is isometric scaling in both x and y.
     */
    getCurrentScale(): number;
    /**
     * Reset transform on the target Node.
     */
    resetTransform(): void;
}
export default MultiListener;
//# sourceMappingURL=MultiListener.d.ts.map