import type { BBox } from './bbox'; import { Matrix } from './matrix'; import { Node } from './node'; type Constructor = new (...args: any[]) => T; interface LocalToParentCoordinateSpaceTransforms { /** Apply local node transforms to the given BBox. */ toParent(bbox: BBox): BBox; /** Apply local node transforms to the given point. */ toParentPoint(x: number, y: number): { x: number; y: number; }; } interface ParentToLocalCoordinateSpaceTransforms { /** Apply local node inverse transforms to the given BBox. */ fromParent(bbox: BBox): BBox; /** Apply local node inverse transforms to the given point. */ fromParentPoint(x: number, y: number): { x: number; y: number; }; } type MatrixTransformType = T & LocalToParentCoordinateSpaceTransforms & ParentToLocalCoordinateSpaceTransforms & { updateMatrix(matrix: Matrix): void; computeBBoxWithoutTransforms(): BBox | undefined; }; export type RotatableType = MatrixTransformType; /** Mixin type for scene Nodes that are rotatable. */ export declare function Rotatable>(Parent: Constructor): Constructor>; export type ScalableType = MatrixTransformType; /** * Type guard to check if a node has scalable properties. * Used to determine if scaling transformations can be applied to a scene graph node. */ export declare function isScalable(node: T): node is ScalableType; /** Mixin type for scene Nodes that are scalable. */ export declare function Scalable>(Parent: Constructor): Constructor>; export type TranslatableType = MatrixTransformType; /** Mixin type for scene Nodes that are translatable. */ export declare function Translatable>(Parent: Constructor): Constructor>; /** Utility class for operations relating to matrix-transformable mixin types. */ export declare class Transformable { /** * Converts a BBox from canvas coordinate space into the coordinate space of the given Node. */ static fromCanvas(node: Node, bbox: BBox): BBox; /** * Converts a Nodes BBox (or an arbitrary BBox if supplied) from local Node coordinate space * into the Canvas coordinate space. */ static toCanvas(node: Node, bbox?: BBox): BBox; /** * Converts a point from canvas coordinate space into the coordinate space of the given Node. */ static fromCanvasPoint(node: Node, x: number, y: number): { x: number; y: number; }; /** * Converts a point from a Nodes local coordinate space into the Canvas coordinate space. */ static toCanvasPoint(node: Node, x: number, y: number): { x: number; y: number; }; } export {};