@scrabble-solver/types 2.9.0 → 2.9.2
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/LICENSE +1 -1
- package/build/Locale.d.ts +2 -2
- package/build/Locale.js +1 -1
- package/build/WordDefinition.d.ts +8 -5
- package/build/WordDefinition.js +5 -1
- package/build/WordDefinitionJson.d.ts +7 -0
- package/package.json +5 -5
- package/src/Locale.ts +1 -1
- package/src/WordDefinition.ts +13 -1
- package/src/WordDefinitionJson.ts +7 -0
package/LICENSE
CHANGED
package/build/Locale.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare enum Locale {
|
|
2
|
+
DE_DE = "de-DE",
|
|
2
3
|
EN_GB = "en-GB",
|
|
3
4
|
EN_US = "en-US",
|
|
4
5
|
ES_ES = "es-ES",
|
|
5
6
|
FR_FR = "fr-FR",
|
|
6
|
-
PL_PL = "pl-PL"
|
|
7
|
-
DE_DE = "de-DE"
|
|
7
|
+
PL_PL = "pl-PL"
|
|
8
8
|
}
|
|
9
9
|
export declare const isLocale: (locale: unknown) => locale is Locale;
|
|
10
10
|
export default Locale;
|
package/build/Locale.js
CHANGED
|
@@ -4,12 +4,12 @@ exports.isLocale = void 0;
|
|
|
4
4
|
// eslint-disable-next-line no-shadow
|
|
5
5
|
var Locale;
|
|
6
6
|
(function (Locale) {
|
|
7
|
+
Locale["DE_DE"] = "de-DE";
|
|
7
8
|
Locale["EN_GB"] = "en-GB";
|
|
8
9
|
Locale["EN_US"] = "en-US";
|
|
9
10
|
Locale["ES_ES"] = "es-ES";
|
|
10
11
|
Locale["FR_FR"] = "fr-FR";
|
|
11
12
|
Locale["PL_PL"] = "pl-PL";
|
|
12
|
-
Locale["DE_DE"] = "de-DE";
|
|
13
13
|
})(Locale || (Locale = {}));
|
|
14
14
|
const locales = Object.values(Locale);
|
|
15
15
|
const isLocale = (locale) => locales.includes(locale);
|
|
@@ -3,13 +3,16 @@ declare class WordDefinition {
|
|
|
3
3
|
static fromJson(json: WordDefinitionJson | null): WordDefinition;
|
|
4
4
|
static readonly Null: WordDefinition;
|
|
5
5
|
readonly definitions: string[];
|
|
6
|
+
/**
|
|
7
|
+
* Does the word have an entry in a corresponding online dictionary?
|
|
8
|
+
*/
|
|
9
|
+
readonly exists: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Can the word be legally used in the game?
|
|
12
|
+
*/
|
|
6
13
|
readonly isAllowed: boolean;
|
|
7
14
|
readonly word: string;
|
|
8
|
-
constructor({ definitions, isAllowed, word }:
|
|
9
|
-
definitions: string[];
|
|
10
|
-
isAllowed: boolean;
|
|
11
|
-
word: string;
|
|
12
|
-
});
|
|
15
|
+
constructor({ definitions, exists, isAllowed, word }: WordDefinitionJson);
|
|
13
16
|
toJson(): WordDefinitionJson | null;
|
|
14
17
|
}
|
|
15
18
|
export default WordDefinition;
|
package/build/WordDefinition.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class WordDefinition {
|
|
4
|
-
constructor({ definitions, isAllowed, word }) {
|
|
4
|
+
constructor({ definitions, exists, isAllowed, word }) {
|
|
5
5
|
this.definitions = definitions;
|
|
6
|
+
this.exists = exists;
|
|
6
7
|
this.isAllowed = isAllowed;
|
|
7
8
|
this.word = word;
|
|
8
9
|
}
|
|
@@ -12,6 +13,7 @@ class WordDefinition {
|
|
|
12
13
|
}
|
|
13
14
|
return new WordDefinition({
|
|
14
15
|
definitions: json.definitions,
|
|
16
|
+
exists: json.exists,
|
|
15
17
|
isAllowed: json.isAllowed,
|
|
16
18
|
word: json.word,
|
|
17
19
|
});
|
|
@@ -19,6 +21,7 @@ class WordDefinition {
|
|
|
19
21
|
toJson() {
|
|
20
22
|
return {
|
|
21
23
|
definitions: this.definitions,
|
|
24
|
+
exists: this.exists,
|
|
22
25
|
isAllowed: this.isAllowed,
|
|
23
26
|
word: this.word,
|
|
24
27
|
};
|
|
@@ -26,6 +29,7 @@ class WordDefinition {
|
|
|
26
29
|
}
|
|
27
30
|
WordDefinition.Null = Object.freeze({
|
|
28
31
|
definitions: [],
|
|
32
|
+
exists: false,
|
|
29
33
|
isAllowed: false,
|
|
30
34
|
word: '',
|
|
31
35
|
toJson: () => null,
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
interface WordDefinitionJson {
|
|
2
2
|
definitions: string[];
|
|
3
|
+
/**
|
|
4
|
+
* Does the word have an entry in a corresponding online dictionary?
|
|
5
|
+
*/
|
|
6
|
+
exists: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Can the word be legally used in the game?
|
|
9
|
+
*/
|
|
3
10
|
isAllowed: boolean;
|
|
4
11
|
word: string;
|
|
5
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/types",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "Scrabble Solver 2 - Types",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"author": {
|
|
12
12
|
"name": "Kamil Mielnik",
|
|
13
|
-
"email": "kamil
|
|
14
|
-
"url": "https://kamilmielnik.com
|
|
13
|
+
"email": "kamil@kamilmielnik.com",
|
|
14
|
+
"url": "https://kamilmielnik.com"
|
|
15
15
|
},
|
|
16
16
|
"license": "CC-BY-NC-ND-4.0",
|
|
17
17
|
"bugs": {
|
|
@@ -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.9.
|
|
27
|
+
"@scrabble-solver/constants": "^2.9.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f50d782088cb89544f0c2c504f31fca81a6ff409"
|
|
30
30
|
}
|
package/src/Locale.ts
CHANGED
package/src/WordDefinition.ts
CHANGED
|
@@ -8,6 +8,7 @@ class WordDefinition {
|
|
|
8
8
|
|
|
9
9
|
return new WordDefinition({
|
|
10
10
|
definitions: json.definitions,
|
|
11
|
+
exists: json.exists,
|
|
11
12
|
isAllowed: json.isAllowed,
|
|
12
13
|
word: json.word,
|
|
13
14
|
});
|
|
@@ -15,6 +16,7 @@ class WordDefinition {
|
|
|
15
16
|
|
|
16
17
|
public static readonly Null: WordDefinition = Object.freeze({
|
|
17
18
|
definitions: [],
|
|
19
|
+
exists: false,
|
|
18
20
|
isAllowed: false,
|
|
19
21
|
word: '',
|
|
20
22
|
toJson: () => null,
|
|
@@ -22,12 +24,21 @@ class WordDefinition {
|
|
|
22
24
|
|
|
23
25
|
public readonly definitions: string[];
|
|
24
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Does the word have an entry in a corresponding online dictionary?
|
|
29
|
+
*/
|
|
30
|
+
public readonly exists: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Can the word be legally used in the game?
|
|
34
|
+
*/
|
|
25
35
|
public readonly isAllowed: boolean;
|
|
26
36
|
|
|
27
37
|
public readonly word: string;
|
|
28
38
|
|
|
29
|
-
constructor({ definitions, isAllowed, word }:
|
|
39
|
+
constructor({ definitions, exists, isAllowed, word }: WordDefinitionJson) {
|
|
30
40
|
this.definitions = definitions;
|
|
41
|
+
this.exists = exists;
|
|
31
42
|
this.isAllowed = isAllowed;
|
|
32
43
|
this.word = word;
|
|
33
44
|
}
|
|
@@ -35,6 +46,7 @@ class WordDefinition {
|
|
|
35
46
|
public toJson(): WordDefinitionJson | null {
|
|
36
47
|
return {
|
|
37
48
|
definitions: this.definitions,
|
|
49
|
+
exists: this.exists,
|
|
38
50
|
isAllowed: this.isAllowed,
|
|
39
51
|
word: this.word,
|
|
40
52
|
};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
interface WordDefinitionJson {
|
|
2
2
|
definitions: string[];
|
|
3
|
+
/**
|
|
4
|
+
* Does the word have an entry in a corresponding online dictionary?
|
|
5
|
+
*/
|
|
6
|
+
exists: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Can the word be legally used in the game?
|
|
9
|
+
*/
|
|
3
10
|
isAllowed: boolean;
|
|
4
11
|
word: string;
|
|
5
12
|
}
|