@logic-pad/core 0.13.2 → 0.13.4
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.
|
@@ -2101,8 +2101,11 @@ declare global {
|
|
|
2101
2101
|
parseRules(_input: string): Rule[];
|
|
2102
2102
|
stringifySymbols(symbols: ReadonlyMap<string, readonly Symbol$1[]>): string;
|
|
2103
2103
|
parseSymbols(_input: string): Map<string, Symbol$1[]>;
|
|
2104
|
+
stringifyGrid(grid: GridData): string;
|
|
2104
2105
|
parseGrid(_input: string): GridData;
|
|
2106
|
+
stringifyGridWithSolution(puzzle: PuzzleData): string;
|
|
2105
2107
|
parseGridWithSolution(_input: string): PuzzleData;
|
|
2108
|
+
stringifyPuzzle(puzzle: Puzzle): string;
|
|
2106
2109
|
parsePuzzle(_input: string): Puzzle;
|
|
2107
2110
|
}
|
|
2108
2111
|
/**
|
|
@@ -13,7 +13,7 @@ export default class ChecksumCompressor extends CompressorBase {
|
|
|
13
13
|
const hashHex = hashArray
|
|
14
14
|
.map(b => b.toString(16).padStart(2, '0'))
|
|
15
15
|
.join('');
|
|
16
|
-
return hashHex
|
|
16
|
+
return `${this.id}_${hashHex}`;
|
|
17
17
|
}
|
|
18
18
|
decompress(_input) {
|
|
19
19
|
throw new Error('Checksum decompression is not supported');
|
|
@@ -26,7 +26,10 @@ export default class SerializerChecksum extends SerializerV0 {
|
|
|
26
26
|
parseRules(_input: string): Rule[];
|
|
27
27
|
stringifySymbols(symbols: ReadonlyMap<string, readonly Symbol[]>): string;
|
|
28
28
|
parseSymbols(_input: string): Map<string, Symbol[]>;
|
|
29
|
+
stringifyGrid(grid: GridData): string;
|
|
29
30
|
parseGrid(_input: string): GridData;
|
|
31
|
+
stringifyGridWithSolution(puzzle: PuzzleData): string;
|
|
30
32
|
parseGridWithSolution(_input: string): PuzzleData;
|
|
33
|
+
stringifyPuzzle(puzzle: Puzzle): string;
|
|
31
34
|
parsePuzzle(_input: string): Puzzle;
|
|
32
35
|
}
|
|
@@ -9,7 +9,7 @@ export default class SerializerChecksum extends SerializerV0 {
|
|
|
9
9
|
enumerable: true,
|
|
10
10
|
configurable: true,
|
|
11
11
|
writable: true,
|
|
12
|
-
value:
|
|
12
|
+
value: 2
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
parseTile(_str) {
|
|
@@ -38,7 +38,7 @@ export default class SerializerChecksum extends SerializerV0 {
|
|
|
38
38
|
case ConfigType.Orientation:
|
|
39
39
|
return (config.field +
|
|
40
40
|
'=' +
|
|
41
|
-
instruction[config.field]
|
|
41
|
+
String(instruction[config.field])
|
|
42
42
|
.toLowerCase()
|
|
43
43
|
.trim());
|
|
44
44
|
case ConfigType.NullableBoolean:
|
|
@@ -154,12 +154,21 @@ export default class SerializerChecksum extends SerializerV0 {
|
|
|
154
154
|
parseSymbols(_input) {
|
|
155
155
|
throw new Error('Checksum serializer does not support parsing');
|
|
156
156
|
}
|
|
157
|
+
stringifyGrid(grid) {
|
|
158
|
+
return super.stringifyGrid(grid.resetTiles());
|
|
159
|
+
}
|
|
157
160
|
parseGrid(_input) {
|
|
158
161
|
throw new Error('Checksum serializer does not support parsing');
|
|
159
162
|
}
|
|
163
|
+
stringifyGridWithSolution(puzzle) {
|
|
164
|
+
return this.stringifyGrid(puzzle.grid);
|
|
165
|
+
}
|
|
160
166
|
parseGridWithSolution(_input) {
|
|
161
167
|
throw new Error('Checksum serializer does not support parsing');
|
|
162
168
|
}
|
|
169
|
+
stringifyPuzzle(puzzle) {
|
|
170
|
+
return this.stringifyGrid(puzzle.grid);
|
|
171
|
+
}
|
|
163
172
|
parsePuzzle(_input) {
|
|
164
173
|
throw new Error('Checksum serializer does not support parsing');
|
|
165
174
|
}
|