/** * Navigation Row, where 0 is inactive cell, but 1 is active, e.g. * 0 0 1 1 */ type NavigationRow = (0 | 1)[]; /** * Navigation Grid, where 0 is inactive cell, but 1 is active, e.g. * 0 0 1 1 * 1 1 0 1 * 1 0 1 1 * 1 1 0 1 */ type NavigationGrid = NavigationRow[]; /** * Cell, where first number is column index and second number is row index. * Indexes are zero-based */ type CellIndex = [number, number]; /** * Navigate left from the start cell. * If there is no active cell on the left, * than iterate over preceding rows to to find one * @param grid Navigation grid * @param cell Start cell * @returns cell Previous cell. If none return null */ declare const left: (grid: NavigationGrid, cell: CellIndex) => CellIndex | null; /** * Navigate right from the start cell. * If there is no active cell on the right, * than iterate over following rows to to find one * @param grid Navigation grid * @param cell Start cell * @returns cell Next cell. If none return null */ declare const right: (grid: NavigationGrid, cell: CellIndex) => CellIndex | null; /** * Navigate up from the start cell trying to * find the closest cell on the preceding rows * @param grid Navigation grid * @param cell Start cell * @returns cell Closest cell on the previous row. If none return null */ declare const up: (grid: NavigationGrid, cell: CellIndex) => CellIndex | null; /** * Navigate down from the start cell trying to * find the closest cell on the following rows * @param grid Navigation grid * @param cell Start cell * @returns cell Closest cell on the next row. If none return null */ declare const down: (grid: NavigationGrid, cell: CellIndex) => CellIndex | null; /** * Get the first active cell * @param grid Navigation grid * @returns cell The first active cell. If none return null */ declare const first: (grid: NavigationGrid) => CellIndex | null; /** * Get the last active cell * @param grid Navigation grid * @returns cell The last active cell. If none return null */ declare const last: (grid: NavigationGrid) => CellIndex | null; export { NavigationRow, NavigationGrid, CellIndex, right, left, down, up, first, last };