libram 0.6.21 → 0.6.24
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/Path.d.ts +4 -1
- package/dist/Path.js +27 -23
- package/dist/challengePaths/2015/CommunityService.js +1 -1
- package/dist/combat.js +2 -5
- package/dist/diet/index.js +1 -1
- package/dist/lib.js +12 -11
- package/dist/maximize.js +27 -16
- package/dist/mood.js +2 -2
- package/dist/property.js +1 -1
- package/dist/propertyTypes.d.ts +4 -4
- package/dist/propertyTypes.js +4 -4
- package/dist/resources/2014/CrimboShrub.js +4 -1
- package/dist/resources/2014/DNALab.d.ts +2 -2
- package/dist/resources/2014/DNALab.js +6 -6
- package/dist/resources/2017/Robortender.js +1 -1
- package/dist/resources/2020/Cartography.d.ts +5 -0
- package/dist/resources/2020/Cartography.js +36 -0
- package/dist/template-string.d.ts +60 -15
- package/dist/template-string.js +7 -3
- package/package.json +6 -3
|
@@ -4,7 +4,10 @@ import { Bounty, Class, Coinmaster, Effect, Element, Familiar, Item, Location, M
|
|
|
4
4
|
*
|
|
5
5
|
* @category In-game constant
|
|
6
6
|
*/
|
|
7
|
-
export declare const $bounty:
|
|
7
|
+
export declare const $bounty: {
|
|
8
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Bounty;
|
|
9
|
+
none: Bounty;
|
|
10
|
+
};
|
|
8
11
|
/**
|
|
9
12
|
* A list of Bounties specified by a comma-separated list of names.
|
|
10
13
|
* For a list of all possible Bounties, leave the template string blank.
|
|
@@ -17,7 +20,10 @@ export declare const $bounties: (literals: TemplateStringsArray, ...placeholders
|
|
|
17
20
|
*
|
|
18
21
|
* @category In-game constant
|
|
19
22
|
*/
|
|
20
|
-
export declare const $class:
|
|
23
|
+
export declare const $class: {
|
|
24
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Class;
|
|
25
|
+
none: Class;
|
|
26
|
+
};
|
|
21
27
|
/**
|
|
22
28
|
* A list of Classes specified by a comma-separated list of names.
|
|
23
29
|
* For a list of all possible Classes, leave the template string blank.
|
|
@@ -30,7 +36,10 @@ export declare const $classes: (literals: TemplateStringsArray, ...placeholders:
|
|
|
30
36
|
*
|
|
31
37
|
* @category In-game constant
|
|
32
38
|
*/
|
|
33
|
-
export declare const $coinmaster:
|
|
39
|
+
export declare const $coinmaster: {
|
|
40
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Coinmaster;
|
|
41
|
+
none: Coinmaster;
|
|
42
|
+
};
|
|
34
43
|
/**
|
|
35
44
|
* A list of Coinmasters specified by a comma-separated list of names.
|
|
36
45
|
* For a list of all possible Coinmasters, leave the template string blank.
|
|
@@ -43,7 +52,10 @@ export declare const $coinmasters: (literals: TemplateStringsArray, ...placehold
|
|
|
43
52
|
*
|
|
44
53
|
* @category In-game constant
|
|
45
54
|
*/
|
|
46
|
-
export declare const $effect:
|
|
55
|
+
export declare const $effect: {
|
|
56
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Effect;
|
|
57
|
+
none: Effect;
|
|
58
|
+
};
|
|
47
59
|
/**
|
|
48
60
|
* A list of Effects specified by a comma-separated list of names.
|
|
49
61
|
* For a list of all possible Effects, leave the template string blank.
|
|
@@ -56,7 +68,10 @@ export declare const $effects: (literals: TemplateStringsArray, ...placeholders:
|
|
|
56
68
|
*
|
|
57
69
|
* @category In-game constant
|
|
58
70
|
*/
|
|
59
|
-
export declare const $element:
|
|
71
|
+
export declare const $element: {
|
|
72
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Element;
|
|
73
|
+
none: Element;
|
|
74
|
+
};
|
|
60
75
|
/**
|
|
61
76
|
* A list of Elements specified by a comma-separated list of names.
|
|
62
77
|
* For a list of all possible Elements, leave the template string blank.
|
|
@@ -69,7 +84,10 @@ export declare const $elements: (literals: TemplateStringsArray, ...placeholders
|
|
|
69
84
|
*
|
|
70
85
|
* @category In-game constant
|
|
71
86
|
*/
|
|
72
|
-
export declare const $familiar:
|
|
87
|
+
export declare const $familiar: {
|
|
88
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Familiar;
|
|
89
|
+
none: Familiar;
|
|
90
|
+
};
|
|
73
91
|
/**
|
|
74
92
|
* A list of Familiars specified by a comma-separated list of names.
|
|
75
93
|
* For a list of all possible Familiars, leave the template string blank.
|
|
@@ -82,7 +100,10 @@ export declare const $familiars: (literals: TemplateStringsArray, ...placeholder
|
|
|
82
100
|
*
|
|
83
101
|
* @category In-game constant
|
|
84
102
|
*/
|
|
85
|
-
export declare const $item:
|
|
103
|
+
export declare const $item: {
|
|
104
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Item;
|
|
105
|
+
none: Item;
|
|
106
|
+
};
|
|
86
107
|
/**
|
|
87
108
|
* A list of Items specified by a comma-separated list of names.
|
|
88
109
|
* For a list of all possible Items, leave the template string blank.
|
|
@@ -95,7 +116,10 @@ export declare const $items: (literals: TemplateStringsArray, ...placeholders: s
|
|
|
95
116
|
*
|
|
96
117
|
* @category In-game constant
|
|
97
118
|
*/
|
|
98
|
-
export declare const $location:
|
|
119
|
+
export declare const $location: {
|
|
120
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Location;
|
|
121
|
+
none: Location;
|
|
122
|
+
};
|
|
99
123
|
/**
|
|
100
124
|
* A list of Locations specified by a comma-separated list of names.
|
|
101
125
|
* For a list of all possible Locations, leave the template string blank.
|
|
@@ -108,7 +132,10 @@ export declare const $locations: (literals: TemplateStringsArray, ...placeholder
|
|
|
108
132
|
*
|
|
109
133
|
* @category In-game constant
|
|
110
134
|
*/
|
|
111
|
-
export declare const $monster:
|
|
135
|
+
export declare const $monster: {
|
|
136
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Monster;
|
|
137
|
+
none: Monster;
|
|
138
|
+
};
|
|
112
139
|
/**
|
|
113
140
|
* A list of Monsters specified by a comma-separated list of names.
|
|
114
141
|
* For a list of all possible Monsters, leave the template string blank.
|
|
@@ -121,7 +148,10 @@ export declare const $monsters: (literals: TemplateStringsArray, ...placeholders
|
|
|
121
148
|
*
|
|
122
149
|
* @category In-game constant
|
|
123
150
|
*/
|
|
124
|
-
export declare const $phylum:
|
|
151
|
+
export declare const $phylum: {
|
|
152
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Phylum;
|
|
153
|
+
none: Phylum;
|
|
154
|
+
};
|
|
125
155
|
/**
|
|
126
156
|
* A list of Phyla specified by a comma-separated list of names.
|
|
127
157
|
* For a list of all possible Phyla, leave the template string blank.
|
|
@@ -134,7 +164,10 @@ export declare const $phyla: (literals: TemplateStringsArray, ...placeholders: s
|
|
|
134
164
|
*
|
|
135
165
|
* @category In-game constant
|
|
136
166
|
*/
|
|
137
|
-
export declare const $servant:
|
|
167
|
+
export declare const $servant: {
|
|
168
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Servant;
|
|
169
|
+
none: Servant;
|
|
170
|
+
};
|
|
138
171
|
/**
|
|
139
172
|
* A list of Servants specified by a comma-separated list of names.
|
|
140
173
|
* For a list of all possible Servants, leave the template string blank.
|
|
@@ -147,7 +180,10 @@ export declare const $servants: (literals: TemplateStringsArray, ...placeholders
|
|
|
147
180
|
*
|
|
148
181
|
* @category In-game constant
|
|
149
182
|
*/
|
|
150
|
-
export declare const $skill:
|
|
183
|
+
export declare const $skill: {
|
|
184
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Skill;
|
|
185
|
+
none: Skill;
|
|
186
|
+
};
|
|
151
187
|
/**
|
|
152
188
|
* A list of Skills specified by a comma-separated list of names.
|
|
153
189
|
* For a list of all possible Skills, leave the template string blank.
|
|
@@ -160,7 +196,10 @@ export declare const $skills: (literals: TemplateStringsArray, ...placeholders:
|
|
|
160
196
|
*
|
|
161
197
|
* @category In-game constant
|
|
162
198
|
*/
|
|
163
|
-
export declare const $slot:
|
|
199
|
+
export declare const $slot: {
|
|
200
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Slot;
|
|
201
|
+
none: Slot;
|
|
202
|
+
};
|
|
164
203
|
/**
|
|
165
204
|
* A list of Slots specified by a comma-separated list of names.
|
|
166
205
|
* For a list of all possible Slots, leave the template string blank.
|
|
@@ -173,7 +212,10 @@ export declare const $slots: (literals: TemplateStringsArray, ...placeholders: s
|
|
|
173
212
|
*
|
|
174
213
|
* @category In-game constant
|
|
175
214
|
*/
|
|
176
|
-
export declare const $stat:
|
|
215
|
+
export declare const $stat: {
|
|
216
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Stat;
|
|
217
|
+
none: Stat;
|
|
218
|
+
};
|
|
177
219
|
/**
|
|
178
220
|
* A list of Stats specified by a comma-separated list of names.
|
|
179
221
|
* For a list of all possible Stats, leave the template string blank.
|
|
@@ -186,7 +228,10 @@ export declare const $stats: (literals: TemplateStringsArray, ...placeholders: s
|
|
|
186
228
|
*
|
|
187
229
|
* @category In-game constant
|
|
188
230
|
*/
|
|
189
|
-
export declare const $thrall:
|
|
231
|
+
export declare const $thrall: {
|
|
232
|
+
(literals: TemplateStringsArray, ...placeholders: string[]): Thrall;
|
|
233
|
+
none: Thrall;
|
|
234
|
+
};
|
|
190
235
|
/**
|
|
191
236
|
* A list of Thralls specified by a comma-separated list of names.
|
|
192
237
|
* For a list of all possible Thralls, leave the template string blank.
|
package/dist/template-string.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Bounty, Class, Coinmaster, Effect, Element, Familiar, Item, Location, Monster, Phylum, Servant, Skill, Slot, Stat, Thrall, } from "kolmafia";
|
|
2
2
|
import { splitByCommasWithEscapes } from "./utils";
|
|
3
3
|
const concatTemplateString = (literals, ...placeholders) => literals.raw.reduce((acc, literal, i) => acc + literal + (placeholders[i] ?? ""), "");
|
|
4
|
-
const createSingleConstant = (Type) =>
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const createSingleConstant = (Type) => {
|
|
5
|
+
const tagFunction = (literals, ...placeholders) => {
|
|
6
|
+
const input = concatTemplateString(literals, ...placeholders);
|
|
7
|
+
return Type.get(input);
|
|
8
|
+
};
|
|
9
|
+
tagFunction.none = Type.none;
|
|
10
|
+
return tagFunction;
|
|
7
11
|
};
|
|
8
12
|
const createPluralConstant = (Type) => (literals, ...placeholders) => {
|
|
9
13
|
const input = concatTemplateString(literals, ...placeholders);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libram",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.24",
|
|
4
4
|
"description": "JavaScript helper library for KoLmafia",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"repository": "https://github.com/
|
|
7
|
+
"repository": "https://github.com/loathers/libram",
|
|
8
8
|
"author": "Samuel Gaus <sam@gaus.co.uk>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"private": false,
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"husky": "^4.3.6",
|
|
50
50
|
"java-parser": "^1.4.0",
|
|
51
51
|
"jest": "^27.1.0",
|
|
52
|
+
"kolmafia": "^3.4.0",
|
|
52
53
|
"lint-staged": ">=10",
|
|
53
54
|
"node-fetch": "^2.6.1",
|
|
54
55
|
"prettier": "^2.1.2",
|
|
@@ -62,9 +63,11 @@
|
|
|
62
63
|
"dependencies": {
|
|
63
64
|
"@babel/runtime-corejs3": "^7.17.2",
|
|
64
65
|
"core-js": "^3.21.0",
|
|
65
|
-
"kolmafia": "^3.0.2",
|
|
66
66
|
"lodash": "^4.17.21"
|
|
67
67
|
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"kolmafia": "^3.4.0"
|
|
70
|
+
},
|
|
68
71
|
"husky": {
|
|
69
72
|
"hooks": {
|
|
70
73
|
"pre-commit": "lint-staged"
|