Directions fit perfectly as a union of string literals. A switch on the direction narrows the union and makes it obvious how to adjust coordinates. Returning a new object keeps code predictable and avoids side effects.
type Step = "up" | "down" | "left" | "right";
Move by exactly one unit each time and keep the function pure.