-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
100 lines (85 loc) · 2.2 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
90
91
92
93
94
95
96
97
98
99
100
type AnimNames = 'stand' | 'walk' | 'run' | 'jump'
type Position = { x: number, y: number }
type CharMoveState = {
character: HTMLDivElement | null,
animation: AnimNames,
move: Position,
isGoing: boolean,
firstTimer: ReturnType<typeof setTimeout> | null,
secondTimer: ReturnType<typeof setTimeout> | null,
}
type CharMoveAction = {
moveByKey: (e: KeyboardEvent) => void,
toStand: (e: KeyboardEvent) => void,
moveByPointer: (e: PointerEvent) => void,
setCharacter: (el: HTMLDivElement | null) => void,
setAnimation: (action: AnimNames) => void,
setCharPos: (pos: Position) => void,
getCurrentPos: () => Position
removeKeyFromSet: (e: KeyboardEvent) => void
}
type Line = {
ptOne: Position,
ptTwo: Position
}
type Intersect = {
type: 'none' | 'intersecting' | 'parallel' | 'colinear',
point?: Position
}
type ReqCSS = 'top' | 'left'
type RequiredStyles = Record<ReqCSS, string | number> & {
scale?: string
}
type HitBoxStyle = {
width?: number,
height?: number,
top?: string,
bottom?: string,
left?: string,
right?: string,
}
type Category = 'ingestible' | 'equipment' | 'material' | 'quest'
type CategoryImg = {
category: Category,
imgUrl: string
}
type Item = {
name: string,
description: string,
imgUrl: string,
price: number,
category: Category,
addHP?: number,
addDef?: number,
addAtk?: number,
addDebuff?: string
}
type InventoryItem = Item & {
amnt: number
}
type InventoryStore = {
inventory: InventoryItem[],
addItem: (item: InventoryItem) => void,
removeItem: (item: InventoryItem) => void
}
type CardTypeStore = {
isSelling: boolean,
inInventory: boolean,
setIsSelling: (isSelling: boolean) => void,
setInInventory: (dialogRef: RefObject<HTMLDialogElement>) => void
}
type CharStatsStore = {
hp: number,
maxHP: number,
debuffSet: Set<string>,
coins: number,
updateHP: (toBeAdded: number) => void,
updateMaxHP: (toBeAdded: number) => void,
updateCoins: (toBeAdded: number) => void,
updateDebuff: (debuff: string, toBeAdded?: true) => void,
}
type TutorialVid = {
url: string,
name: string,
description: string
}