advanced-poe-filter-parser 0.9.0 → 0.9.1
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/README.md +2 -2
- package/lib/parser.d.ts +54 -35
- package/lib/parser.mjs +6334 -0
- package/package.json +5 -1
- package/.eslintrc +0 -17
- package/.git_consistent +0 -80
- package/.gitcommit_template +0 -3
- package/.github/workflows/main.yml +0 -32
- package/.node-version +0 -1
- package/.prettierrc.json +0 -11
- package/.vscode/settings.json +0 -17
- package/test/parser.test.js +0 -1173
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Advanced PoE Filter Parser [](https://github.com/isuke/advanced-poe-filter-parser/actions/workflows/main.yml) [](https://github.com/isuke/git-consistent) [](https://raw.githubusercontent.com/isuke/
|
|
1
|
+
# Advanced PoE Filter Parser [](https://github.com/isuke/advanced-poe-filter-parser/actions/workflows/main.yml) [](https://github.com/isuke/git-consistent) [](https://raw.githubusercontent.com/isuke/advanced-poe-filter-parser/main/LICENSE) [](https://www.npmjs.com/package/advanced-poe-filter-parser)
|
|
2
2
|
|
|
3
|
-
Advanced PoE Filter is used by [Filter of
|
|
3
|
+
Advanced PoE Filter is used by [Filter of Kalandra](https://filter-of-kalandra.netlify.com/).
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
package/lib/parser.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
type Activity = "Show" | "Hide" | "Unset" | "Ignore"
|
|
2
|
+
|
|
3
|
+
type BranchType = "Fork" | "Mixin"
|
|
4
|
+
|
|
1
5
|
type MatchOperator = "==" | "="
|
|
2
6
|
type NumOperator = "<=" | ">=" | "<" | ">" | "="
|
|
3
7
|
|
|
@@ -6,8 +10,10 @@ type Influence = "Shaper" | "Elder" | "Crusader" | "Hunter" | "Redeemer" | "Warl
|
|
|
6
10
|
type GemQualityType = "Superior" | "Divergent" | "Anomalous" | "Phantasmal"
|
|
7
11
|
type SocketType = "R" | "G" | "B" | "W" | "A" | "D"
|
|
8
12
|
|
|
13
|
+
type ColorName = "Red" | "Green" | "Blue" | "Brown" | "White" | "Yellow" | "Cyan" | "Grey" | "Orange" | "Pink" | "Purple"
|
|
14
|
+
|
|
9
15
|
type MinimapIconSize = 0 | 1 | 2 | "0" | "1" | "2" | "Largest" | "Medium" | "Small"
|
|
10
|
-
type MinimapIconColor =
|
|
16
|
+
type MinimapIconColor = ColorName
|
|
11
17
|
type MinimapIconShape =
|
|
12
18
|
| "Circle"
|
|
13
19
|
| "Diamond"
|
|
@@ -21,24 +27,8 @@ type MinimapIconShape =
|
|
|
21
27
|
| "Kite"
|
|
22
28
|
| "Pentagon"
|
|
23
29
|
| "UpsideDownHouse"
|
|
24
|
-
type PlayEffectColor =
|
|
30
|
+
type PlayEffectColor = ColorName
|
|
25
31
|
type SoundId =
|
|
26
|
-
| 1
|
|
27
|
-
| 2
|
|
28
|
-
| 3
|
|
29
|
-
| 4
|
|
30
|
-
| 5
|
|
31
|
-
| 6
|
|
32
|
-
| 7
|
|
33
|
-
| 8
|
|
34
|
-
| 9
|
|
35
|
-
| 10
|
|
36
|
-
| 11
|
|
37
|
-
| 12
|
|
38
|
-
| 13
|
|
39
|
-
| 14
|
|
40
|
-
| 15
|
|
41
|
-
| 16
|
|
42
32
|
| "1"
|
|
43
33
|
| "2"
|
|
44
34
|
| "3"
|
|
@@ -55,6 +45,22 @@ type SoundId =
|
|
|
55
45
|
| "14"
|
|
56
46
|
| "15"
|
|
57
47
|
| "16"
|
|
48
|
+
| "Sh01"
|
|
49
|
+
| "Sh02"
|
|
50
|
+
| "Sh03"
|
|
51
|
+
| "Sh04"
|
|
52
|
+
| "Sh05"
|
|
53
|
+
| "Sh06"
|
|
54
|
+
| "Sh07"
|
|
55
|
+
| "Sh08"
|
|
56
|
+
| "Sh09"
|
|
57
|
+
| "Sh10"
|
|
58
|
+
| "Sh11"
|
|
59
|
+
| "Sh12"
|
|
60
|
+
| "Sh13"
|
|
61
|
+
| "Sh14"
|
|
62
|
+
| "Sh15"
|
|
63
|
+
| "Sh16"
|
|
58
64
|
| "ShAlchemy"
|
|
59
65
|
| "ShBlessed"
|
|
60
66
|
| "ShChaos"
|
|
@@ -66,14 +72,17 @@ type SoundId =
|
|
|
66
72
|
| "ShRegal"
|
|
67
73
|
| "ShVaal"
|
|
68
74
|
|
|
75
|
+
type RGBA = { rgb: { r: number; g: number; b: number }; alpha: number }
|
|
76
|
+
type Sound = { id: SoundId; volume: number | undefined }
|
|
77
|
+
|
|
69
78
|
type AdvancedBlock = {
|
|
70
79
|
id: string
|
|
71
80
|
name: string
|
|
72
|
-
activity:
|
|
81
|
+
activity: Activity
|
|
73
82
|
conditions: {
|
|
74
83
|
Class?: { ope: MatchOperator; vals: string[] }
|
|
75
84
|
BaseType?: { ope: MatchOperator; vals: string[] }
|
|
76
|
-
Rarity?: `${MatchOperator} ${Rarity}`
|
|
85
|
+
Rarity?: `${MatchOperator} ${Rarity}` | Rarity
|
|
77
86
|
BaseDefencePercentile?: `${NumOperator} ${number}`
|
|
78
87
|
BaseArmour?: `${NumOperator} ${number}`
|
|
79
88
|
BaseEnergyShield?: `${NumOperator} ${number}`
|
|
@@ -119,13 +128,13 @@ type AdvancedBlock = {
|
|
|
119
128
|
}
|
|
120
129
|
actions: {
|
|
121
130
|
SetFontSize?: number
|
|
122
|
-
SetTextColor?:
|
|
123
|
-
SetBackgroundColor?:
|
|
124
|
-
SetBorderColor?:
|
|
131
|
+
SetTextColor?: RGBA
|
|
132
|
+
SetBackgroundColor?: RGBA
|
|
133
|
+
SetBorderColor?: RGBA
|
|
125
134
|
MinimapIcon?: { size: MinimapIconSize; color: MinimapIconColor; shape: MinimapIconShape }
|
|
126
135
|
PlayEffect?: { color: PlayEffectColor; temp: boolean }
|
|
127
|
-
PlayAlertSound?:
|
|
128
|
-
PlayAlertSoundPositional?:
|
|
136
|
+
PlayAlertSound?: Sound
|
|
137
|
+
PlayAlertSoundPositional?: Sound
|
|
129
138
|
CustomAlertSound?: {
|
|
130
139
|
filePath: string
|
|
131
140
|
volume: number | undefined
|
|
@@ -133,7 +142,7 @@ type AdvancedBlock = {
|
|
|
133
142
|
DisableDropSound?: boolean
|
|
134
143
|
EnableDropSound?: boolean
|
|
135
144
|
}
|
|
136
|
-
branches:
|
|
145
|
+
branches: Branch[]
|
|
137
146
|
location: {
|
|
138
147
|
start: { line: number; column: number; offset: number }
|
|
139
148
|
end: { line: number; column: number; offset: number }
|
|
@@ -142,18 +151,28 @@ type AdvancedBlock = {
|
|
|
142
151
|
|
|
143
152
|
type Branch = {
|
|
144
153
|
name: string
|
|
145
|
-
type:
|
|
146
|
-
blocks:
|
|
154
|
+
type: BranchType
|
|
155
|
+
blocks: AdvancedBlock[]
|
|
147
156
|
}
|
|
148
157
|
|
|
149
158
|
type Condition = keyof AdvancedBlock["conditions"]
|
|
150
159
|
type Action = keyof AdvancedBlock["actions"]
|
|
151
160
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
161
|
+
type SyntaxError = {
|
|
162
|
+
message: string
|
|
163
|
+
found?: string
|
|
164
|
+
location: {
|
|
165
|
+
start: {
|
|
166
|
+
offset: number
|
|
167
|
+
line: number
|
|
168
|
+
column: number
|
|
169
|
+
}
|
|
170
|
+
end: {
|
|
171
|
+
offset: number
|
|
172
|
+
line: number
|
|
173
|
+
column: number
|
|
174
|
+
}
|
|
175
|
+
}
|
|
159
176
|
}
|
|
177
|
+
|
|
178
|
+
export function parse(input: string): AdvancedBlock[]
|