UNPKG

@logic-pad/core

Version:
20 lines (19 loc) 778 B
import GridData from './grid.js'; import { Color, Position } from './primitives.js'; import TileData from './tile.js'; export interface ShapeElement { x: number; y: number; color: Color; } export interface Shape { width: number; height: number; elements: ShapeElement[]; } export declare function shapeEquals(a: Shape, b: Shape): boolean; export declare function tilesToShape(tiles: readonly (readonly TileData[])[]): Shape; export declare function positionsToShape(positions: Position[], color: Color): Shape; export declare function getShapeVariants(shape: Shape): Shape[]; export declare function normalizeShape(shape: Shape): Shape; export declare function sanitizePatternGrid(pattern: GridData, tileMapper?: (tile: TileData) => TileData): GridData;