diff --git a/apps/client/src/scenes/game/input/joystick/JoystickInputPresenter.tsx b/apps/client/src/scenes/game/input/joystick/JoystickInputPresenter.tsx index cc6dd72..6ce42aa 100644 --- a/apps/client/src/scenes/game/input/joystick/JoystickInputPresenter.tsx +++ b/apps/client/src/scenes/game/input/joystick/JoystickInputPresenter.tsx @@ -5,18 +5,13 @@ */ import { useJoystickController } from "./useJoystickController"; import { JoystickView } from "./JoystickView"; +import type { UseJoystickInputPresenterProps } from "./common"; /** 入力半径の既定値を外部から参照できるように再公開 */ export { MAX_DIST } from "./common"; -/** JoystickInputPresenter の入力コールバック */ -type Props = { - onInput: (moveX: number, moveY: number) => void; - maxDist?: number; -}; - /** 入力と表示状態の橋渡しを行う */ -export const JoystickInputPresenter = ({ onInput, maxDist }: Props) => { +export const JoystickInputPresenter = ({ onInput, maxDist }: UseJoystickInputPresenterProps) => { const { isMoving, center, knobOffset, radius, handleStart, handleMove, handleEnd } = useJoystickController({ onInput, maxDist }); diff --git a/apps/client/src/scenes/game/input/joystick/common/index.ts b/apps/client/src/scenes/game/input/joystick/common/index.ts index b13792d..ec6f310 100644 --- a/apps/client/src/scenes/game/input/joystick/common/index.ts +++ b/apps/client/src/scenes/game/input/joystick/common/index.ts @@ -10,6 +10,7 @@ Point, UseJoystickControllerProps, UseJoystickControllerReturn, + UseJoystickInputPresenterProps, UseJoystickStateProps, UseJoystickStateReturn, } from './joystick.types'; diff --git a/apps/client/src/scenes/game/input/joystick/common/joystick.types.ts b/apps/client/src/scenes/game/input/joystick/common/joystick.types.ts index bfbd55f..16ee180 100644 --- a/apps/client/src/scenes/game/input/joystick/common/joystick.types.ts +++ b/apps/client/src/scenes/game/input/joystick/common/joystick.types.ts @@ -47,3 +47,9 @@ handleMove: (e: JoystickPointerEvent) => void; handleEnd: () => void; }; + +/** JoystickInputPresenter に渡す入力設定型 */ +export type UseJoystickInputPresenterProps = { + onInput: (moveX: number, moveY: number) => void; + maxDist?: number; +};