import type { Vector2 } from './math'; import type { FrameManager } from './frame/frame-module'; import type { Selection } from './selection/selection'; import type { GizmoManager } from './gizmo-manager'; import type { ConfigManager } from './configs/config-manager'; import type { SnapManager } from './selection/snap-manager'; import type { Engine } from '@galacean/effects'; import type { ViewportNavigationController } from './viewport'; import type { GizmoOwnerEvents } from './gizmo-action'; import type { TextEditActivation } from './text/types'; import type { LoadingManager } from './gizmos/loading-manager'; import type { GestureCursorResult } from './cursor'; /** 当前选区变换会话的语义类型;与 pointer capture owner 相互独立。 */ export type SelectionTransformKind = 'idle' | 'move' | 'resize'; /** * gizmo 与宿主(GestureHandler)的接口契约。 * * Gizmos read shared input, selection, FrameManager views, drag state, and Engine through this contract. * GizmoManager 不持有;dispatch 子集重算经 owner.getSelection() 取。视口 / 相机参数 gizmo 经 {@link getEngine} 取 engine。 * * 跨 Gizmo 依赖由 State 创建阶段通过构造函数显式注入;Manager 查询只供宿主与命令装配读取, * Gizmo 自身不得用它作为依赖定位器。 */ export interface GizmoOwner { /** 将 Gizmo 产生的业务 Action 统一交给 GestureHandler 发射。 */ emit(eventName: E, ...args: GizmoOwnerEvents[E]): void; /** 取选中态真源 + 命中查询。 */ getSelection(): Selection; /** 取 canonical Frame records and projected runtime geometry. */ getFrameManager(): FrameManager; /** * 交互上下文共享的画布吸附器。Gizmo 只通过 owner 取得,不自行创建或互相持有; * 临时吸附提示由宿主统一 overlay 绘制。 */ getSnapManager(): SnapManager; /** 取跨 Gizmo 图稳定的 loading 状态管理器。 */ getLoadingManager(): LoadingManager; /** 取 shared backend for hand pan and wheel-driven viewport navigation. */ getViewportNavigation(): ViewportNavigationController; /** 读取当前选区变换会话。Hand/viewport capture 不会改变该状态。 */ getSelectionTransformKind(): SelectionTransformKind; /** 由实际获得交互所有权的 selection gizmo 提交会话状态。 */ setSelectionTransformKind(kind: SelectionTransformKind): void; /** * 缓存的鼠标位置(视图坐标)。事件外 / 每帧 pull 用;事件路径直接读 runtime mouse event 坐标。 * 返回手势层在 mousemove 维护的不可变快照。 */ getMousePosition(): Vector2; /** 将 Gizmo 光标意图提交给宿主,由宿主写入当前 Control 的 defaultCursorShape。 */ setCursor(result: GestureCursorResult): void; /** Whether the active toolbar Tool is the Hand tool. */ isHandToolMode(): boolean; /** Whether a mouse button is currently held according to the runtime Control input stream. */ isMouseButtonPressed(): boolean; /** * 宿主 State 交互图的统一重建入口。GestureHandler 替换候选图, * 当前 capture 可继续持有退役图完成 pointer sequence;随后装配公共前置与当前 State/context 分支并重绘。 */ rebuildGizmos(): void; /** Enter inline text editing inside the current GizmoTool. */ beginTextEditing(textareaType?: TextEditActivation): boolean; /** Leave inline text editing and restore the default EditMode. */ finishTextEditing(): void; /** * 取所属 GizmoManager(供宿主查询当前图的实例和配置)。 * Gizmo 间依赖不得经此获取,应由 State 在构造阶段显式注入。 */ getGizmoManager(): GizmoManager; /** * 取所属 Effects Engine(gizmo 经此读 engine,取代构造注入)。 */ getEngine(): Engine; /** 取 Gizmo 配置的唯一值管理器;Gizmo 直接读取,变更统一经 typed set/onChange。 */ getConfigManager(): ConfigManager; }