import { Cell } from './Cell'; import { CellCollection } from './CellCollection'; import { CellValueChange, GridBlocks, GridColumns, GridLocation, GridRows } from './ValueTypes'; /** * Defines an immutable grid structure of Sudoku cells. */ export declare class Grid extends CellCollection { /** * This helper function transforms a location (x 1 to 9, y 1 to 9) into the * corresponding GridBlock (1 - 9) representing one of the 9 sub-squares in the * Sudoku grid. * @param location The x y location to look up. * @returns The GridBlock that the location sits in. */ static gridBlockFromLocation(location: GridLocation): GridBlocks; /** * Creates a new Grid object from a 9x9 array containing known values. Unknown values * should be set to zero. * @param values A 9x9 grid of numbers that gives the starting point for the grid. * @returns A Grid object containing the required Cells. */ static fromGrid(values: number[][]): Grid; /** * Converts a raw CellCollection into a Grid. * @param cells The cell collection from which to create the Grid. * @returns A reference to the created Grid object. */ static fromCellCollection(cells: CellCollection): Grid; /** * Instantiates a new Grid object. * @param values An array of 81 Cells */ constructor(values: Cell[]); /** * Returns a copy of the data at a specified row. * @param row The row to return. * @returns A CellCollection containing a copy of the requested row. */ row(row: GridRows): CellCollection; /** * Returns a copy of the data at a specified column. * @param column The column to return. * @returns A CellCollection containing a copy of the requested column. */ column(column: GridColumns): CellCollection; /** * Returns a copy of the data at a specified column. * @param column The column to return. * @returns A CellCollection containing a copy of the requested column. */ block(block: GridBlocks): CellCollection; /** * Returns a value indicating whether the puzzle is completely solved or not. * @returns True if the puzzle is solved or false if it isn't. */ get isSolved(): boolean; /** * returns a list of values that apply what's in this grid to what's in the grid parameter. * @param targetGrid The grid to compare it to. * @returns A list of values and their locations that differ between the Grids. */ differences(targetGrid: Grid): CellValueChange[]; /** * Converts the values in this Grid to a 2D array of numbers. * @returns The Grid as a 2D array of numbers. */ toPuzzleArray(): number[][]; }