@zeainc/zea-ux
Version:
74 lines • 2.38 kB
TypeScript
import { BaseTool, ZeaMouseEvent, ZeaKeyboardEvent } from '@zeainc/zea-engine';
/**
* @extends BaseTool
*/
declare class ToolManager extends BaseTool {
toolStack: BaseTool[];
tools: Record<string, BaseTool>;
constructor();
registerTool(toolName: string, tool: BaseTool): void;
insertTool(tool: string | BaseTool, index: number): void;
removeTool(tool: string | BaseTool): void;
pushTool(tool: string | BaseTool): void;
popTool(): void;
/**
* Returns the tool currently at the top of the stack.
* @return - the currently active tool.
*/
activeTool(): BaseTool | undefined;
/**
* Returns the name of the tool currently at the top of the stack.
* @return - the name of the tool.
*/
activeToolName(): string;
/**
* Event fired when a pointing device button is pressed while the pointer is over the tool.
*
* @param event - The event param.
*/
onPointerDown(event: ZeaMouseEvent): void;
/**
* Event fired when a pointing device is moved while the cursor's hotspot is inside it.
*
* @param event - The event param.
*/
onPointerMove(event: ZeaMouseEvent): void;
/**
* Event fired when a pointing device button is released while the pointer is over the tool.
*
* @param event - The event param.
*/
onPointerUp(event: ZeaMouseEvent): void;
/**
* Event fired when a pointing device button is released and released in the same location.
*
* @param event - The event param.
*/
onPointerClick(event: ZeaMouseEvent): void;
/**
* Event fired when a pointing device button is double clicked on the tool.
*
* @param event - The event param.
*/
onPointerDoubleClick(event: ZeaMouseEvent): void;
/**
* Event fired when the user rotates the pointing device wheel.
*
* @param event - The event param.
*/
onWheel(event: ZeaMouseEvent): void;
/**
* Event fired when the user presses down a key on the keyboard.
*
* @param event - The event param.
*/
onKeyDown(event: ZeaKeyboardEvent): void;
/**
* Event fired when the user releases a key on the keyboard.
*
* @param event - The event param.
*/
onKeyUp(event: ZeaKeyboardEvent): void;
}
export { ToolManager };
//# sourceMappingURL=ToolManager.d.ts.map