-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtypes.d.ts
89 lines (75 loc) · 1.78 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
declare global {
interface Window {
wordHints: WordHints;
}
}
export type Difficulty = "easy" | "medium" | "hard";
export type GuessState = "pending" | "match" | "present" | "miss";
export type LetterGuess = {
letter: string;
state: GuessState;
};
export type Guess = LetterGuess[];
export type Hint = {
/** to display to user */
message: string;
/** to highlight on the keyboard */
letter?: string;
/** letters that are definitely not in the target */
misses?: string[];
};
export type KeyState = {
/** most keys are letters but one is backspace, one is to submit a guess */
type: "letter" | "back" | "enter";
/** shown on the keyboard */
label: string;
/** keys start as "available" and update as user guesses (based on presence in the target word) */
state: "available" | "match" | "present" | "miss" | "unavailable";
};
export type Knowledge = {
matches: string[];
presents: string[];
misses: string[];
availables: string[];
};
export type Settings = {
difficulty: "easy" | "medium" | "hard";
keyboardLayout: "atoz" | "qwerty";
theme: "blue" | "high";
case: "lowercase" | "uppercase";
sharingEmojis: EmojiMatchThemeKey;
spellChecker: "off" | "on";
};
export type EmojiMatchThemeKey =
| "nature"
| "fruit"
| "vegetable"
| "tree"
| "circle"
| "poop";
export type EmojiMatchThemeValue = {
match: string;
present: string;
miss: string;
};
export type EmojiMatchThemes = {
[key in EmojiMatchThemeKey]: EmojiMatchThemeValue;
};
export type DailyPuzzles = {
easy: string;
medium: string;
hard: string;
};
export type HolidayPuzzles = {
name: string;
easy: string[];
medium: string[];
hard: string[];
};
export type WordHints = {
[key: string]: {
category?: string;
emoji?: string;
hints?: string[];
};
};