@webgamekit/dictionary 0.0.0-stage → 0.1.0
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/dist/index.d.ts +2 -0
- package/dist/index.js +32025 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/picker.d.ts +34 -0
- package/package.json +30 -3
- package/README.md +0 -3
package/dist/picker.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type DictionaryDifficulty = 'easy' | 'medium' | 'hard';
|
|
2
|
+
/**
|
|
3
|
+
* Get the full word list for a given difficulty level.
|
|
4
|
+
* @param difficulty - Difficulty tier to fetch words for.
|
|
5
|
+
* @returns Frozen list of words (do not mutate).
|
|
6
|
+
*/
|
|
7
|
+
export declare const dictionaryGetWords: (difficulty: DictionaryDifficulty) => readonly string[];
|
|
8
|
+
/**
|
|
9
|
+
* Get the full comprehensive word list for Boggle-style enumeration (3–6 letters, no proper nouns).
|
|
10
|
+
* @returns Frozen list of lowercase words.
|
|
11
|
+
*/
|
|
12
|
+
export declare const dictionaryGetBoggleWords: () => readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* Get the definition for a word if available.
|
|
15
|
+
* @param word - The word to look up (case-insensitive).
|
|
16
|
+
* @returns The definition string, or undefined if not found.
|
|
17
|
+
*/
|
|
18
|
+
export declare const dictionaryGetDefinition: (word: string) => string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Pick a random word from the chosen difficulty list.
|
|
21
|
+
* @param difficulty - Difficulty tier to draw from.
|
|
22
|
+
* @param random - Pluggable [0,1) random source, defaults to `Math.random`.
|
|
23
|
+
* @returns A randomly selected word.
|
|
24
|
+
*/
|
|
25
|
+
export declare const dictionaryPickRandom: (difficulty: DictionaryDifficulty, random?: () => number) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Produce a progressively revealed hint for a target word.
|
|
28
|
+
* Reveals letters at positions determined by `revealRatio` (0..1).
|
|
29
|
+
* Unrevealed letters become `_`; spaces remain as spaces.
|
|
30
|
+
* @param word - Target word to mask.
|
|
31
|
+
* @param revealRatio - Fraction of letters to reveal, clamped to [0,1].
|
|
32
|
+
* @returns Hint string with placeholders for hidden letters.
|
|
33
|
+
*/
|
|
34
|
+
export declare const dictionaryMaskWord: (word: string, revealRatio: number) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webgamekit/dictionary",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/cnotv/generative-art.git",
|
|
7
|
+
"directory": "packages/dictionary"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"main": "./dist/index.umd.cjs",
|
|
14
|
+
"module": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"require": "./dist/index.umd.cjs",
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"typescript": "^5.0.0",
|
|
28
|
+
"vite": "^5.0.0"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "vite build && tsc"
|
|
32
|
+
}
|
|
6
33
|
}
|
package/README.md
DELETED