@logic-pad/core
Version:
31 lines (30 loc) • 987 B
TypeScript
import GridData from '../grid.js';
import { Puzzle } from '../puzzle.js';
import Rule from '../rules/rule.js';
import Symbol from '../symbols/symbol.js';
/**
* The master serializer for puzzles.
*
* It uses the default serializer when stringifying puzzles, and select the correct deserializer when parsing puzzles.
*/
declare const Serializer: {
stringifyRule(rule: Rule): string;
parseRule(input: string): Rule;
stringifySymbol(symbol: Symbol): string;
parseSymbol(input: string): Symbol;
stringifyGrid(grid: GridData): string;
parseGrid(input: string): GridData;
/**
* Convert a puzzle to a string.
* @param puzzle The puzzle to convert.
* @returns The string representation of the puzzle.
*/
stringifyPuzzle(puzzle: Puzzle): string;
/**
* Parse a puzzle from a string.
* @param input The string to parse.
* @returns The parsed puzzle.
*/
parsePuzzle(input: string): Puzzle;
};
export { Serializer };