UNPKG

@blockly/keyboard-navigation

Version:
36 lines 924 B
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ export declare enum Direction { Up = 1, Down = 2, Left = 3, Right = 4 } /** * Convert a direction enum into an XY pair. * * @param dir The direction, or undefined. * @returns An object containing x and y values corresponding to the input * direction. */ export declare function getXYFromDirection(dir: Direction | undefined): { x: number; y: number; }; /** * Convert an XY pair into a direction enum. * * @param xy The input pair. * @param xy.x The x direction, or undefined. * @param xy.y The y direction, or undefined. * @returns A direction corresponding to the XY pair, or null if they are invalid * or undefined. */ export declare function getDirectionFromXY(xy: { x: number | undefined; y: number | undefined; }): Direction | null; //# sourceMappingURL=drag_direction.d.ts.map