import * as Core from "@intelligentgraphics/ig.gfx.core";
import { Bounds, MathTypes } from "@intelligentgraphics/ig.gfx.core";
import { SnapMatch } from "../SnapMatches";
/** Abstract result interface for communication between Operation and StandardInteractor */
export interface OperationResult {
    /** The transformations to be applied to the selected ids */
    transformations: MathTypes.Transformation[];
    /** Indicates if the movedToPosition is invalid (i.e. overlap) */
    isInvalid: boolean;
    /** If snap occurred, this will contain the id of the snapped component */
    snapTo?: string;
    snapMatches: SnapMatch[];
    /** True if snap is invalid (due to collision, unsupported points etc. */
    isSnapInvalid?: boolean;
}
/** Interface for the return value of an operation. */
export interface MotionResult extends OperationResult {
}
/** Interface for results after mouse/touch has been lifted. */
export interface EndResult extends OperationResult {
}
/** Abstract request interface for communication between StandardInteractor and Operation */
export interface OperationRequest {
    /** X position. */
    x: number;
    /** Y position. */
    y: number;
    /** Z position. */
    z: number;
    /** Rotation in radians. */
    angle: number;
    /** The id that is below the mouse cursor */
    hitInfosBelowMouse?: Core.IDetailedHitInfo[];
}
/** Interface for differences in mouse position between two events. */
export interface TouchStartRequest extends OperationRequest {
}
/** Interface for differences in mouse position between two events. */
export interface TouchMotionRequest extends OperationRequest {
}
/** Interface for differences in mouse position between two events. */
export interface TouchEndRequest extends OperationRequest {
    ignoreSnap: boolean;
}
/** Interface for operations. Operations are basic activities to be combined.
 * The three phases of a touch are: Start (mouse/touch down) Motion (move mouse while mouse down and End (mouse up).
 */
export interface Operation {
    /**
     * Initialize the operation and various parameters.
     * @param request The Touch supplied by the event of push the mouse button.
     */
    executeStart(request: TouchStartRequest): void;
    /**
     * Calculate the changes that have to be applied to the components.
     * @param request The Touch supplied by the event of push the mouse button.
     */
    executeMotion(request: TouchMotionRequest): MotionResult;
    /**
     * Finalize the motion, i.e. look for snapping/invalid positions etc. depending on the operation.
     * @param request The Touch supplied by the event of push the mouse button.
     */
    executeEnd(request: TouchEndRequest): EndResult;
}
/**
 * To restrict the transformation of an object to the given bounds,
 * we will calculate the point that is furthest outside of the bounds
 * and bring it back inside by translation.
 * This algorithm assumes that the passed bounds are inside the xz-plane,
 * e.g. that the y-component of the constraints is 0
 */
export declare function restrictTransformationToBounds(transformation: MathTypes.Transformation, constraints: Bounds, componentId: string): MathTypes.Transformation;
