@logic-pad/core 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1970,6 +1970,8 @@ declare global {
1970
1970
  parseSymbol(input: string): Symbol$1;
1971
1971
  stringifyGrid(grid: GridData): string;
1972
1972
  parseGrid(input: string): GridData;
1973
+ stringifyGridWithSolution(puzzle: PuzzleData): string;
1974
+ parseGridWithSolution(input: string): PuzzleData;
1973
1975
  /**
1974
1976
  * Convert a puzzle to a string.
1975
1977
  * @param puzzle The puzzle to convert.
@@ -1,5 +1,5 @@
1
1
  import GridData from '../grid.js';
2
- import { Puzzle } from '../puzzle.js';
2
+ import { Puzzle, PuzzleData } from '../puzzle.js';
3
3
  import Rule from '../rules/rule.js';
4
4
  import Symbol from '../symbols/symbol.js';
5
5
  /**
@@ -14,6 +14,8 @@ declare const Serializer: {
14
14
  parseSymbol(input: string): Symbol;
15
15
  stringifyGrid(grid: GridData): string;
16
16
  parseGrid(input: string): GridData;
17
+ stringifyGridWithSolution(puzzle: PuzzleData): string;
18
+ parseGridWithSolution(input: string): PuzzleData;
17
19
  /**
18
20
  * Convert a puzzle to a string.
19
21
  * @param puzzle The puzzle to convert.
@@ -43,6 +43,13 @@ const Serializer = {
43
43
  const { serializer, data } = selectSerializer(input);
44
44
  return serializer.parseGrid(data);
45
45
  },
46
+ stringifyGridWithSolution(puzzle) {
47
+ return `${defaultSerializer.version}_${defaultSerializer.stringifyGridWithSolution(puzzle)}`;
48
+ },
49
+ parseGridWithSolution(input) {
50
+ const { serializer, data } = selectSerializer(input);
51
+ return serializer.parseGridWithSolution(data);
52
+ },
46
53
  /**
47
54
  * Convert a puzzle to a string.
48
55
  * @param puzzle The puzzle to convert.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logic-pad/core",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",