@scrabble-solver/types 2.12.2 → 2.12.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.
- package/build/Config.d.ts +2 -0
- package/build/Config.js +3 -0
- package/build/ConfigJson.d.ts +2 -1
- package/build/Dictionary.d.ts +7 -0
- package/build/Dictionary.js +2 -0
- package/build/Game.d.ts +7 -0
- package/build/Game.js +13 -0
- package/build/Locale.d.ts +5 -0
- package/build/Locale.js +5 -1
- package/build/index.d.ts +4 -2
- package/build/index.js +8 -5
- package/package.json +3 -3
- package/src/Config.ts +5 -0
- package/src/ConfigJson.ts +2 -1
- package/src/Dictionary.ts +9 -0
- package/src/Game.ts +11 -0
- package/src/Locale.ts +5 -1
- package/src/index.ts +4 -2
package/build/Config.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import Bonus from './Bonus';
|
|
|
2
2
|
import BonusValue from './BonusValue';
|
|
3
3
|
import Cell from './Cell';
|
|
4
4
|
import ConfigJson from './ConfigJson';
|
|
5
|
+
import Game from './Game';
|
|
5
6
|
import Locale from './Locale';
|
|
6
7
|
import Tile from './Tile';
|
|
7
8
|
import TileConfig from './TileConfig';
|
|
@@ -17,6 +18,7 @@ declare class Config {
|
|
|
17
18
|
get blanksCount(): number;
|
|
18
19
|
get boardHeight(): number;
|
|
19
20
|
get boardWidth(): number;
|
|
21
|
+
get game(): Game;
|
|
20
22
|
get locale(): Locale;
|
|
21
23
|
get twoCharacterTiles(): string[];
|
|
22
24
|
getCellBonus(cell: Cell): Bonus | undefined;
|
package/build/Config.js
CHANGED
package/build/ConfigJson.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BonusJson from './BonusJson';
|
|
2
|
+
import Game from './Game';
|
|
2
3
|
import Locale from './Locale';
|
|
3
4
|
import TileConfig from './TileConfig';
|
|
4
5
|
interface ConfigJson {
|
|
@@ -8,7 +9,7 @@ interface ConfigJson {
|
|
|
8
9
|
boardHeight: number;
|
|
9
10
|
boardWidth: number;
|
|
10
11
|
bonuses: BonusJson[];
|
|
11
|
-
|
|
12
|
+
game: Game;
|
|
12
13
|
locale: Locale;
|
|
13
14
|
maximumCharactersCount: number;
|
|
14
15
|
name: string;
|
package/build/Game.d.ts
ADDED
package/build/Game.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isGame = void 0;
|
|
4
|
+
var Game;
|
|
5
|
+
(function (Game) {
|
|
6
|
+
Game["Literaki"] = "literaki";
|
|
7
|
+
Game["Scrabble"] = "scrabble";
|
|
8
|
+
Game["SuperScrabble"] = "super-scrabble";
|
|
9
|
+
})(Game || (Game = {}));
|
|
10
|
+
const games = Object.values(Game);
|
|
11
|
+
const isGame = (locale) => games.includes(locale);
|
|
12
|
+
exports.isGame = isGame;
|
|
13
|
+
exports.default = Game;
|
package/build/Locale.d.ts
CHANGED
package/build/Locale.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isLocale = void 0;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Locales are defined using IETF language tags
|
|
6
|
+
* @see https://en.wikipedia.org/wiki/IETF_language_tag
|
|
7
|
+
* @see https://en.wikipedia.org/wiki/ISO_3166-1
|
|
8
|
+
*/
|
|
5
9
|
var Locale;
|
|
6
10
|
(function (Locale) {
|
|
7
11
|
Locale["DE_DE"] = "de-DE";
|
package/build/index.d.ts
CHANGED
|
@@ -10,10 +10,10 @@ export { default as Collision } from './Collision';
|
|
|
10
10
|
export { default as CollisionJson } from './CollisionJson';
|
|
11
11
|
export { default as Config } from './Config';
|
|
12
12
|
export { default as ConfigJson } from './ConfigJson';
|
|
13
|
+
export { default as Dictionary } from './Dictionary';
|
|
13
14
|
export { default as FinalPattern } from './FinalPattern';
|
|
15
|
+
export { default as Game, isGame } from './Game';
|
|
14
16
|
export { default as HorizontalPattern } from './HorizontalPattern';
|
|
15
|
-
export { default as isError } from './isError';
|
|
16
|
-
export { default as isObject } from './isObject';
|
|
17
17
|
export { default as Locale, isLocale } from './Locale';
|
|
18
18
|
export { default as Pattern } from './Pattern';
|
|
19
19
|
export { default as PatternJson } from './PatternJson';
|
|
@@ -26,3 +26,5 @@ export { default as VerticalPattern } from './VerticalPattern';
|
|
|
26
26
|
export { default as WordBonus } from './WordBonus';
|
|
27
27
|
export { default as WordDefinition } from './WordDefinition';
|
|
28
28
|
export { default as WordDefinitionJson } from './WordDefinitionJson';
|
|
29
|
+
export { default as isError } from './isError';
|
|
30
|
+
export { default as isObject } from './isObject';
|
package/build/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WordDefinition = exports.WordBonus = exports.VerticalPattern = exports.isTileJson = exports.Tile = exports.Result = exports.Pattern = exports.isLocale = exports.Locale = exports.
|
|
6
|
+
exports.isObject = exports.isError = exports.WordDefinition = exports.WordBonus = exports.VerticalPattern = exports.isTileJson = exports.Tile = exports.Result = exports.Pattern = exports.isLocale = exports.Locale = exports.HorizontalPattern = exports.isGame = exports.Game = exports.FinalPattern = exports.Config = exports.CharacterBonus = exports.isCellJson = exports.Cell = exports.Bonus = exports.isBoardJson = exports.Board = void 0;
|
|
7
7
|
var Board_1 = require("./Board");
|
|
8
8
|
Object.defineProperty(exports, "Board", { enumerable: true, get: function () { return __importDefault(Board_1).default; } });
|
|
9
9
|
var BoardJson_1 = require("./BoardJson");
|
|
@@ -20,12 +20,11 @@ var Config_1 = require("./Config");
|
|
|
20
20
|
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return __importDefault(Config_1).default; } });
|
|
21
21
|
var FinalPattern_1 = require("./FinalPattern");
|
|
22
22
|
Object.defineProperty(exports, "FinalPattern", { enumerable: true, get: function () { return __importDefault(FinalPattern_1).default; } });
|
|
23
|
+
var Game_1 = require("./Game");
|
|
24
|
+
Object.defineProperty(exports, "Game", { enumerable: true, get: function () { return __importDefault(Game_1).default; } });
|
|
25
|
+
Object.defineProperty(exports, "isGame", { enumerable: true, get: function () { return Game_1.isGame; } });
|
|
23
26
|
var HorizontalPattern_1 = require("./HorizontalPattern");
|
|
24
27
|
Object.defineProperty(exports, "HorizontalPattern", { enumerable: true, get: function () { return __importDefault(HorizontalPattern_1).default; } });
|
|
25
|
-
var isError_1 = require("./isError");
|
|
26
|
-
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return __importDefault(isError_1).default; } });
|
|
27
|
-
var isObject_1 = require("./isObject");
|
|
28
|
-
Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return __importDefault(isObject_1).default; } });
|
|
29
28
|
var Locale_1 = require("./Locale");
|
|
30
29
|
Object.defineProperty(exports, "Locale", { enumerable: true, get: function () { return __importDefault(Locale_1).default; } });
|
|
31
30
|
Object.defineProperty(exports, "isLocale", { enumerable: true, get: function () { return Locale_1.isLocale; } });
|
|
@@ -43,3 +42,7 @@ var WordBonus_1 = require("./WordBonus");
|
|
|
43
42
|
Object.defineProperty(exports, "WordBonus", { enumerable: true, get: function () { return __importDefault(WordBonus_1).default; } });
|
|
44
43
|
var WordDefinition_1 = require("./WordDefinition");
|
|
45
44
|
Object.defineProperty(exports, "WordDefinition", { enumerable: true, get: function () { return __importDefault(WordDefinition_1).default; } });
|
|
45
|
+
var isError_1 = require("./isError");
|
|
46
|
+
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return __importDefault(isError_1).default; } });
|
|
47
|
+
var isObject_1 = require("./isObject");
|
|
48
|
+
Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return __importDefault(isObject_1).default; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/types",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.4",
|
|
4
4
|
"description": "Scrabble Solver 2 - Types",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"clean:force": "npm run clean && rimraf package-lock.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@scrabble-solver/constants": "^2.12.
|
|
27
|
+
"@scrabble-solver/constants": "^2.12.4"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "b7af635998fc55dcfb05c009d856819550cb20d8"
|
|
30
30
|
}
|
package/src/Config.ts
CHANGED
|
@@ -5,6 +5,7 @@ import BonusValue from './BonusValue';
|
|
|
5
5
|
import Cell from './Cell';
|
|
6
6
|
import CharacterBonus from './CharacterBonus';
|
|
7
7
|
import ConfigJson from './ConfigJson';
|
|
8
|
+
import Game from './Game';
|
|
8
9
|
import Locale from './Locale';
|
|
9
10
|
import Tile from './Tile';
|
|
10
11
|
import TileConfig from './TileConfig';
|
|
@@ -51,6 +52,10 @@ class Config {
|
|
|
51
52
|
return this.config.boardWidth;
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
public get game(): Game {
|
|
56
|
+
return this.config.game;
|
|
57
|
+
}
|
|
58
|
+
|
|
54
59
|
public get locale(): Locale {
|
|
55
60
|
return this.config.locale;
|
|
56
61
|
}
|
package/src/ConfigJson.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BonusJson from './BonusJson';
|
|
2
|
+
import Game from './Game';
|
|
2
3
|
import Locale from './Locale';
|
|
3
4
|
import TileConfig from './TileConfig';
|
|
4
5
|
|
|
@@ -9,7 +10,7 @@ interface ConfigJson {
|
|
|
9
10
|
boardHeight: number;
|
|
10
11
|
boardWidth: number;
|
|
11
12
|
bonuses: BonusJson[];
|
|
12
|
-
|
|
13
|
+
game: Game;
|
|
13
14
|
locale: Locale;
|
|
14
15
|
maximumCharactersCount: number;
|
|
15
16
|
name: string;
|
package/src/Game.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
enum Game {
|
|
2
|
+
Literaki = 'literaki',
|
|
3
|
+
Scrabble = 'scrabble',
|
|
4
|
+
SuperScrabble = 'super-scrabble',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const games = Object.values(Game);
|
|
8
|
+
|
|
9
|
+
export const isGame = (locale: unknown): locale is Game => games.includes(locale as Game);
|
|
10
|
+
|
|
11
|
+
export default Game;
|
package/src/Locale.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -10,10 +10,10 @@ export { default as Collision } from './Collision';
|
|
|
10
10
|
export { default as CollisionJson } from './CollisionJson';
|
|
11
11
|
export { default as Config } from './Config';
|
|
12
12
|
export { default as ConfigJson } from './ConfigJson';
|
|
13
|
+
export { default as Dictionary } from './Dictionary';
|
|
13
14
|
export { default as FinalPattern } from './FinalPattern';
|
|
15
|
+
export { default as Game, isGame } from './Game';
|
|
14
16
|
export { default as HorizontalPattern } from './HorizontalPattern';
|
|
15
|
-
export { default as isError } from './isError';
|
|
16
|
-
export { default as isObject } from './isObject';
|
|
17
17
|
export { default as Locale, isLocale } from './Locale';
|
|
18
18
|
export { default as Pattern } from './Pattern';
|
|
19
19
|
export { default as PatternJson } from './PatternJson';
|
|
@@ -26,3 +26,5 @@ export { default as VerticalPattern } from './VerticalPattern';
|
|
|
26
26
|
export { default as WordBonus } from './WordBonus';
|
|
27
27
|
export { default as WordDefinition } from './WordDefinition';
|
|
28
28
|
export { default as WordDefinitionJson } from './WordDefinitionJson';
|
|
29
|
+
export { default as isError } from './isError';
|
|
30
|
+
export { default as isObject } from './isObject';
|