UNPKG

@miketmoore/maze-generator

Version:

This is a javascript library, written in TypeScript that generates a maze data structure.

14 lines (13 loc) 740 B
import { ICoord } from './coord'; import { ICell, Direction } from './cell'; export interface IGrid { readonly forEachRow: (cb: (row: ICell[], rowIndex: number) => void) => void; readonly getCell: (coord: ICoord) => ICell | undefined; readonly getAdjacentCell: (direction: Direction, coord: ICoord) => ICell | undefined; readonly getAdjacentCoord: (direction: Direction, coord: ICoord) => ICoord | undefined; readonly getRandCoord: () => ICoord; readonly getRandCell: () => ICell; readonly getAvailableCellWalls: (cell: ICell, cellCoord: ICoord) => Direction[]; readonly carveCellWall: (coord: ICoord, direction: Direction) => void; } export declare const gridFactory: (rows: number, cols: number) => IGrid;