UNPKG

@logic-pad/core

Version:
38 lines (37 loc) 1.46 kB
import Rule, { SearchVariant } from './rule.js'; import GridData from '../grid.js'; import { AnyConfig } from '../config.js'; import { Color, Comparison, RuleState } from '../primitives.js'; export default class SymbolsPerRegionRule extends Rule { readonly color: Color; readonly count: number; readonly comparison: Comparison; private static readonly SYMBOL_POSITIONS; private static readonly CONFIGS; private static readonly EXAMPLE_GRIDS; private static readonly SEARCH_VARIANTS; /** * **Exactly <count> symbols per <color> area** * * @param color - Color of the region affected by the rule * @param count - Number of symbols to have in each region * @param comparison - Comparison to use when checking the number of symbols */ constructor(color: Color, count: number, comparison?: Comparison); get id(): string; get explanation(): string; get configs(): readonly AnyConfig[] | null; createExampleGrid(): GridData; get searchVariants(): SearchVariant[]; validateGrid(grid: GridData): RuleState; copyWith({ count, color, comparison, }: { count?: number; color?: Color; comparison?: Comparison; }): this; withColor(color: Color): this; withCount(count: number): this; withComparison(comparison: Comparison): this; private static countAllSymbolsOfPosition; } export declare const instance: SymbolsPerRegionRule;