@tf2-automatic/tf2-format 9.3.0-dev.3 → 10.0.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.
Files changed (53) hide show
  1. package/README.md +124 -7
  2. package/package.json +1 -1
  3. package/src/index.d.ts +1 -0
  4. package/src/index.js +1 -0
  5. package/src/index.js.map +1 -1
  6. package/src/lib/common.d.ts +29 -0
  7. package/src/lib/common.js +33 -0
  8. package/src/lib/common.js.map +1 -0
  9. package/src/lib/naming/index.d.ts +2 -1
  10. package/src/lib/naming/index.js +21 -26
  11. package/src/lib/naming/index.js.map +1 -1
  12. package/src/lib/parsing/bptf/parser.d.ts +8 -0
  13. package/src/lib/parsing/bptf/parser.js +89 -0
  14. package/src/lib/parsing/bptf/parser.js.map +1 -0
  15. package/src/lib/parsing/bptf/types.d.ts +94 -0
  16. package/src/lib/parsing/bptf/types.js +3 -0
  17. package/src/lib/parsing/bptf/types.js.map +1 -0
  18. package/src/lib/parsing/econ/parser.d.ts +3 -9
  19. package/src/lib/parsing/econ/parser.js +74 -138
  20. package/src/lib/parsing/econ/parser.js.map +1 -1
  21. package/src/lib/parsing/econ/types.d.ts +1 -1
  22. package/src/lib/parsing/helpers.d.ts +7 -0
  23. package/src/lib/parsing/helpers.js +105 -0
  24. package/src/lib/parsing/helpers.js.map +1 -0
  25. package/src/lib/parsing/index.d.ts +3 -1
  26. package/src/lib/parsing/index.js +3 -1
  27. package/src/lib/parsing/index.js.map +1 -1
  28. package/src/lib/parsing/parser.d.ts +4 -4
  29. package/src/lib/parsing/parser.js.map +1 -1
  30. package/src/lib/parsing/tf2/parser.d.ts +9 -10
  31. package/src/lib/parsing/tf2/parser.js +123 -384
  32. package/src/lib/parsing/tf2/parser.js.map +1 -1
  33. package/src/lib/parsing/tf2/types.d.ts +12 -59
  34. package/src/lib/parsing/tf2-api/parser.d.ts +10 -0
  35. package/src/lib/parsing/tf2-api/parser.js +128 -0
  36. package/src/lib/parsing/tf2-api/parser.js.map +1 -0
  37. package/src/lib/parsing/tf2-api/types.d.ts +47 -0
  38. package/src/lib/parsing/tf2-api/types.js +3 -0
  39. package/src/lib/parsing/tf2-api/types.js.map +1 -0
  40. package/src/lib/parsing/tf2-gc/constants.js.map +1 -0
  41. package/src/lib/parsing/tf2-gc/parser.d.ts +12 -0
  42. package/src/lib/parsing/tf2-gc/parser.js +277 -0
  43. package/src/lib/parsing/tf2-gc/parser.js.map +1 -0
  44. package/src/lib/parsing/tf2-gc/types.d.ts +43 -0
  45. package/src/lib/parsing/tf2-gc/types.js +3 -0
  46. package/src/lib/parsing/tf2-gc/types.js.map +1 -0
  47. package/src/lib/schemas.d.ts +65 -0
  48. package/src/lib/schemas.js +3 -0
  49. package/src/lib/schemas.js.map +1 -0
  50. package/src/lib/types.d.ts +11 -323
  51. package/src/lib/parsing/tf2/constants.js.map +0 -1
  52. /package/src/lib/parsing/{tf2 → tf2-gc}/constants.d.ts +0 -0
  53. /package/src/lib/parsing/{tf2 → tf2-gc}/constants.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../libs/tf2-format/src/lib/parsing/tf2-gc/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ import { ItemsGameItem, NumberOrNull, SchemaItem, Spell, UndefinedOrError, UndefinedOrNull } from './types';
2
+ export interface ItemsGameItemByDefindex {
3
+ getItemsGameItemByDefindex(defindex: number): UndefinedOrError<ItemsGameItem>;
4
+ fetchItemsGameItemByDefindex(defindex: number): Promise<ItemsGameItem>;
5
+ }
6
+ export interface SchemaItemByDefindex {
7
+ getSchemaItemByDefindex(defindex: number): UndefinedOrError<SchemaItem>;
8
+ fetchSchemaItemByDefindex(defindex: number): Promise<SchemaItem>;
9
+ }
10
+ export interface DefindexByName {
11
+ getDefindexByName(name: string): UndefinedOrError<number>;
12
+ fetchDefindexByName(name: string): Promise<NumberOrNull>;
13
+ }
14
+ export interface QualityByName {
15
+ getQualityByName(name: string): UndefinedOrError<number>;
16
+ fetchQualityByName(name: string): Promise<number>;
17
+ }
18
+ export interface QualityById {
19
+ getQualityById(id: number): UndefinedOrError<string>;
20
+ fetchQualityById(id: number): Promise<string>;
21
+ }
22
+ export interface EffectById {
23
+ getEffectById(id: number): UndefinedOrError<string>;
24
+ fetchEffectById(id: number): Promise<string>;
25
+ }
26
+ export interface PaintkitById {
27
+ getPaintkitById(id: number): UndefinedOrError<string>;
28
+ fetchPaintkitById(id: number): Promise<string>;
29
+ }
30
+ export interface EffectByName {
31
+ getEffectByName(name: string): UndefinedOrError<number>;
32
+ fetchEffectByName(name: string): Promise<number>;
33
+ }
34
+ export interface TextureByName {
35
+ getTextureByName(name: string): UndefinedOrError<number>;
36
+ fetchTextureByName(name: string): Promise<number>;
37
+ }
38
+ export interface SpellByName {
39
+ getSpellByName(name: string): UndefinedOrError<Spell>;
40
+ fetchSpellByName(name: string): Promise<Spell>;
41
+ }
42
+ export interface StrangePartByScoreType {
43
+ getStrangePartByScoreType(scoreType: string): UndefinedOrNull<number>;
44
+ fetchStrangePartByScoreType(scoreType: string): Promise<NumberOrNull>;
45
+ }
46
+ export interface SheenByName {
47
+ getSheenByName(name: string): UndefinedOrError<number>;
48
+ fetchSheenByName(name: string): Promise<number>;
49
+ }
50
+ export interface KillstreakerByName {
51
+ getKillstreakerByName(name: string): UndefinedOrError<number>;
52
+ fetchKillstreakerByName(name: string): Promise<number>;
53
+ }
54
+ export interface PaintByColor {
55
+ getPaintByColor(color: string): UndefinedOrError<number>;
56
+ fetchPaintByColor(color: string): Promise<number>;
57
+ }
58
+ export interface StrangePartById {
59
+ getStrangePartById(id: number): UndefinedOrError<NumberOrNull>;
60
+ fetchStrangePartById(id: number): Promise<NumberOrNull>;
61
+ }
62
+ export type ItemNamingSchema = SchemaItemByDefindex & QualityById & PaintkitById & EffectById;
63
+ export type EconParserSchema = ItemsGameItemByDefindex & DefindexByName & QualityByName & EffectByName & TextureByName & SpellByName & StrangePartByScoreType & SheenByName & KillstreakerByName;
64
+ export type TF2ParserSchema = ItemsGameItemByDefindex & PaintByColor & StrangePartById;
65
+ export type BptfParserSchema = DefindexByName & QualityByName & SpellByName & SchemaItemByDefindex;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../libs/tf2-format/src/lib/schemas.ts"],"names":[],"mappings":""}
@@ -8,6 +8,12 @@ export type Item = PrimaryItemAttributes & ExtraItemAttributes;
8
8
  export interface InventoryItem extends Item {
9
9
  assetid: string;
10
10
  }
11
+ /**
12
+ * An annoying type I have to make to be able to parse backpack.tf listings
13
+ */
14
+ export interface PossibleInventoryItem extends Item {
15
+ assetid: string | null;
16
+ }
11
17
  /**
12
18
  * The primary attributes of a TF2 item that are used to identify it.
13
19
  */
@@ -32,20 +38,21 @@ export interface RecipeInput {
32
38
  defindex?: number;
33
39
  killstreak?: number;
34
40
  quality: number;
35
- amount: number;
41
+ quantity: number;
36
42
  }
37
43
  /**
38
44
  * Extra attributes of a TF2 item.
39
45
  */
40
46
  export interface ExtraItemAttributes {
41
47
  paint: NumberOrNull;
42
- spells: number[];
48
+ spells: Spell[];
43
49
  parts: number[];
44
50
  sheen: NumberOrNull;
45
51
  killstreaker: NumberOrNull;
46
52
  inputs: RecipeInput[] | null;
47
53
  quantity: number;
48
54
  }
55
+ export type Spell = [defindex: number, value: number];
49
56
  type RequiredKeys<T extends keyof U, U> = {
50
57
  [K in T]-?: K extends keyof U ? U[K] : never;
51
58
  } & {
@@ -62,332 +69,13 @@ export interface ItemsGameItem {
62
69
  }>;
63
70
  }
64
71
  export interface SchemaItem {
72
+ defindex: number;
65
73
  item_name: string;
66
74
  proper_name: boolean;
67
75
  item_quality: number;
76
+ used_by_classes?: string[];
68
77
  }
69
78
  export type UndefinedOrError<T> = T | undefined | Error;
70
79
  export type UndefinedOrNull<T> = T | undefined | null;
71
80
  export type NumberOrNull = number | null;
72
- interface GetItemsGameItem {
73
- /**
74
- * Synchronously get an item by its defindex from items_game.txt.
75
- * @param defindex The defindex of the item.
76
- * @returns Returns the matching item from items_game.txt, undefined if it
77
- * is not possible to get the item synchronously or an error to exit early.
78
- * @example schema.getItemByDefindex(5021) -> { name: "Decoder Ring", ... }
79
- * @example schema.getItemByDefindex(-1) -> undefined
80
- * @example schema.getItemByDefindex(-1) -> new Error("Item not found")
81
- */
82
- getItemByDefindex(defindex: number): UndefinedOrError<ItemsGameItem>;
83
- /**
84
- * Asynchronously get an item by its defindex from items_game.txt.
85
- * @param defindex The defindex of the item.
86
- * @returns Returns the matching item from items_game.txt or throws an error
87
- * if it was not found.
88
- * @example schema.fetchItemByDefindex(5021) -> Promise.resolve({ name: "Decoder Ring", ... })
89
- * @example schema.fetchItemByDefindex(-1) -> Promise.reject(new Error("Item not found"))
90
- */
91
- fetchItemByDefindex(defindex: number): Promise<ItemsGameItem>;
92
- }
93
- /**
94
- * Various information needs to be retrieved externally to name items.
95
- * This schema is used to define the getters for this information.
96
- */
97
- export interface ItemNamingSchema {
98
- /**
99
- * Syncronously get an item by its defindex from the TF2 GetItemsGame API.
100
- * @param defindex The defindex of the item.
101
- * @returns Returns the matching item, undefined if it is not possible to get
102
- * the item synchronously or an error to exit early.
103
- * @example schema.getItemByDefindex(5021) -> { item_name: "Mann Co. Supply Crate Key", ... }
104
- * @example schema.getItemByDefindex(5021) -> undefined
105
- * @example schema.getItemByDefindex(-1) -> new Error("Item not found")
106
- */
107
- getItemByDefindex(defindex: number): UndefinedOrError<SchemaItem>;
108
- /**
109
- * Asynchronously get an item by its defindex from the TF2 GetItemsGame API.
110
- * @param defindex The defindex of the item.
111
- * @returns Returns the matching item or throws an error if it was not found.
112
- * @example schema.fetchItemByDefindex(5021) -> Promise.resolve({ item_name: "Mann Co. Supply Crate Key", ... })
113
- * @example schema.fetchItemByDefindex(-1) -> Promise.reject(new Error("Item not found"))
114
- */
115
- fetchItemByDefindex(defindex: number): Promise<SchemaItem>;
116
- /**
117
- * Syncronously get the name of an item by its defindex.
118
- * @param id The id of the quality.
119
- * @returns Returns the name of the quality, undefined if the quality cannot
120
- * be found syncronously or an error to exit early.
121
- * @example schema.getQualityById(6) -> "Unique"
122
- * @example schema.getQualityById(6) -> undefined
123
- * @example schema.getQualityById(-1) -> new Error("Quality not found")
124
- */
125
- getQualityById(id: number): UndefinedOrError<string>;
126
- /**
127
- * Asynchronously get the name of a quality by its id.
128
- * @param id The id of the quality.
129
- * @returns Returns the name of the quality or throws an error if the quality
130
- * cannot be found.
131
- * @example schema.fetchQualityById(6) -> Promise.resolve("Unique")
132
- * @example schema.fetchQualityById(-1) -> Promise.reject(new Error("Quality not found"))
133
- */
134
- fetchQualityById(id: number): Promise<string>;
135
- /**
136
- * Syncronously get the name of an effect by its id.
137
- * @param id The id of the effect.
138
- * @returns Returns the name of the effect, undefined if the effect cannot
139
- * be found syncronously or an error to exit early.
140
- * @example schema.getEffectById(13) -> "Burning Flames"
141
- * @example schema.getEffectById(13) -> undefined
142
- * @example schema.getEffectById(-1) -> new Error("Effect not found")
143
- */
144
- getEffectById(id: number): UndefinedOrError<string>;
145
- /**
146
- * Asynchronously get the name of an effect by its id.
147
- * @param id The id of the effect.
148
- * @returns Returns the name of the effect or throws an error if the effect
149
- * cannot be found.
150
- * @example schema.fetchEffectById(13) -> Promise.resolve("Burning Flames")
151
- * @example schema.fetchEffectById(-1) -> Promise.reject(new Error("Effect not found"))
152
- */
153
- fetchEffectById(id: number): Promise<string>;
154
- /**
155
- * Syncronously get the name of a texture by its id.
156
- * @param id The id of the texture.
157
- * @returns Returns the name of the texture, undefined if the texture cannot
158
- * be found syncronously or an error to exit early.
159
- * @example schema.getTextureById(14) -> "Night Owl"
160
- * @example schema.getTextureById(14) -> undefined
161
- * @example schema.getTextureById(-1) -> new Error("Texture not found")
162
- */
163
- getPaintkitById(id: number): UndefinedOrError<string>;
164
- /**
165
- * Asynchronously get the name of a texture by its id.
166
- * @param id The id of the texture.
167
- * @returns Returns the name of the texture or throws an error if the texture
168
- * cannot be found.
169
- * @example schema.fetchTextureById(14) -> Promise.resolve("Night Owl")
170
- * @example schema.fetchTextureById(-1) -> Promise.reject(new Error("Texture not found"))
171
- */
172
- fetchPaintkitById(id: number): Promise<string>;
173
- }
174
- /**
175
- * Various information needs to be retrieved externally to format the Econ items.
176
- * This schema is used to define the getters for this information.
177
- */
178
- export interface EconParserSchema extends GetItemsGameItem {
179
- /**
180
- * Syncronously get the defindex of an item by its `item_name` using the
181
- * GetSchemaItems API.
182
- * @param name The name of the item.
183
- * @returns Returns the defindex of the item, null if an item with the given
184
- * name is known not to exist or undefined if it could not be found syncronously.
185
- * @example schema.getDefindexByName("Mann Co. Supply Crate Key") -> 5021
186
- * @example schema.getDefindexByName("Mann Co. Supply Crate Key") -> undefined
187
- * @example schema.getDefindexByName("Non-existent item") -> null
188
- */
189
- getDefindexByName(name: string): UndefinedOrError<number>;
190
- /**
191
- * Asyncronously get the defindex of an item by its `item_name` using
192
- * the GetSchemaItems API.
193
- * @param name The name of the item.
194
- * @returns Returns the defindex of the item or null if an item with the given
195
- * name does not exist.
196
- * @example schema.fetchDefindexByName("Mann Co. Supply Crate Key") -> Promise.resolve(5021)
197
- * @example schema.fetchDefindexByName("Non-existent item") -> Promise.resolve(null)
198
- */
199
- fetchDefindexByName(name: string): Promise<NumberOrNull>;
200
- /**
201
- * Synchronously get the id of a quality by its name.
202
- * @param name The name of the quality.
203
- * @returns Returns the id of the quality, undefined if the quality cannot be
204
- * found syncronously or an error to exit early.
205
- * @example schema.getQualityByName("Unique") -> 6
206
- * @example schema.getQualityByName("Non-existent quality") -> undefined
207
- * @example schema.getQualityByName("Non-existent quality") -> new Error("Quality not found")
208
- */
209
- getQualityByName(name: string): UndefinedOrError<number>;
210
- /**
211
- * Asynchronously get the id of a quality by its name.
212
- * @param name The name of the quality.
213
- * @returns Returns the id of the quality or throws an error if the quality
214
- * cannot be found.
215
- * @example schema.fetchQualityByName("Unique") -> Promise.resolve(6)
216
- * @example schema.fetchQualityByName("Non-existent quality") -> Promise.reject(new Error("Quality not found"))
217
- */
218
- fetchQualityByName(name: string): Promise<number>;
219
- /**
220
- * Synchronously get the id of an effect by its name.
221
- * @param name The name of the effect.
222
- * @returns Returns the id of the effect, undefined if the effect cannot be
223
- * found synchronously or an error to exit early.
224
- * @example schema.getEffectByName("Burning Flames") -> 13
225
- * @example schema.getEffectByName("Non-existent effect") -> undefined
226
- * @example schema.getEffectByName("Non-existent effect") -> new Error("Effect not found")
227
- */
228
- getEffectByName(name: string): UndefinedOrError<number>;
229
- /**
230
- * Asynchronously get the id of an effect by its name.
231
- * @param name The name of the effect.
232
- * @returns Returns the id of the effect or throws an error if the effect
233
- * cannot be found.
234
- * @example schema.fetchEffectByName("Burning Flames") -> Promise.resolve(13)
235
- * @example schema.fetchEffectByName("Non-existent effect") -> Promise.reject(new Error("Effect not found"))
236
- */
237
- fetchEffectByName(name: string): Promise<number>;
238
- /**
239
- * Synchronously get the id of a texture by its name.
240
- * @param name The name of the texture.
241
- * @returns Returns the id of the texture, undefined if the texture cannot be
242
- * found synchronously or an error to exit early.
243
- * @example schema.getTextureByName("Night Owl") -> 14
244
- * @example schema.getTextureByName("Non-existent texture") -> undefined
245
- * @example schema.getTextureByName("Non-existent texture") -> new Error("Texture not found")
246
- */
247
- getTextureByName(name: string): UndefinedOrError<number>;
248
- /**
249
- * Asynchronously get the id of a texture by its name.
250
- * @param name The name of the texture.
251
- * @returns Returns the id of the texture or throws an error if the texture
252
- * cannot be found.
253
- * @example schema.fetchTextureByName("Night Owl") -> Promise.resolve(14)
254
- * @example schema.fetchTextureByName("Non-existent texture") -> Promise.reject(new Error("Texture not found"))
255
- */
256
- fetchTextureByName(name: string): Promise<number>;
257
- /**
258
- * Syncronously get the id of a spell by its name.
259
- * @param name The name of the spell.
260
- * @returns Returns the id of the spell, undefined if the spell cannot be
261
- * found syncronously or an error to exit early.
262
- * @example schema.getSpellByName("Exorcism") -> 1009
263
- * @example schema.getSpellByName("Non-existent spell") -> undefined
264
- * @example schema.getSpellByName("Non-existent spell") -> new Error("Spell not found")
265
- */
266
- getSpellByName(name: string): UndefinedOrError<number>;
267
- /**
268
- * Asynchronously get the id of a spell by its name.
269
- * @param name The name of the spell.
270
- * @returns Returns the id of the spell or throws an error if the spell
271
- * cannot be found.
272
- * @example schema.fetchSpellByName("Exorcism") -> Promise.resolve(1009)
273
- * @example schema.fetchSpellByName("Non-existent spell") -> Promise.reject(new Error("Spell not found"))
274
- */
275
- fetchSpellByName(name: string): Promise<number>;
276
- /**
277
- * Syncronously get the defindex of a strange part by its score type. Because
278
- * some score types may not have a corresponding strange part, e.g. "Kills", then
279
- * this method has to return null when no match instead of throwing an error.
280
- * @param scoreType The score type.
281
- * @returns Returns the id of the strange part, null if a strange part with the
282
- * given score type does not exist or undefined if it could not be found syncronously.
283
- * @example schema.getStrangePartByScoreType("Kills Under A Full Moon") -> 6015
284
- * @example schema.getStrangePartByScoreType("Kills Under A Full Moon") -> undefined
285
- * @example schema.getStrangePartByScoreType("Non-existent score type") -> null
286
- */
287
- getStrangePartByScoreType(scoreType: string): UndefinedOrNull<number>;
288
- /**
289
- * Asynchronously get the defindex of a strange part by its score type. Because
290
- * some score types may not have a corresponding strange part, e.g. "Kills", then
291
- * this method has to return null when no match instead of throwing an error.
292
- * @param scoreType The score type.
293
- * @returns Returns the id of the strange part or null if a strange part with
294
- * the given score type does not exist.
295
- * @example schema.fetchStrangePartByScoreType("Kills Under A Full Moon") -> Promise.resolve(6015)
296
- * @example schema.fetchStrangePartByScoreType("Non-existent score type") -> Promise.resolve(null)
297
- */
298
- fetchStrangePartByScoreType(scoreType: string): Promise<NumberOrNull>;
299
- /**
300
- * Syncronously get the id of a sheen by its name.
301
- * @param name The name of the sheen.
302
- * @returns Returns the id of the sheen, undefined if the sheen cannot be
303
- * found syncronously or an error to exit early.
304
- * @example schema.getSheenByName("Villainous Violet") -> 6
305
- * @example schema.getSheenByName("Non-existent sheen") -> undefined
306
- * @example schema.getSheenByName("Non-existent sheen") -> new Error("Sheen not found")
307
- */
308
- getSheenByName(name: string): UndefinedOrError<number>;
309
- /**
310
- * Asynchronously get the id of a sheen by its name.
311
- * @param name The name of the sheen.
312
- * @returns Returns the id of the sheen or throws an error if the sheen
313
- * cannot be found.
314
- * @example schema.fetchSheenByName("Villainous Violet") -> Promise.resolve(6)
315
- * @example schema.fetchSheenByName("Non-existent sheen") -> Promise.reject(new Error("Sheen not found"))
316
- */
317
- fetchSheenByName(name: string): Promise<number>;
318
- /**
319
- * Syncronously get the id of a killstreaker by its name.
320
- * @param name The name of the killstreaker.
321
- * @returns Returns the id of the killstreaker, undefined if the killstreaker
322
- * cannot be found syncronously or an error to exit early.
323
- * @example schema.getKillstreakerByName("Cerebral Discharge") -> 2003
324
- * @example schema.getKillstreakerByName("Non-existent killstreaker") -> undefined
325
- * @example schema.getKillstreakerByName("Non-existent killstreaker") -> new Error("Killstreaker not found")
326
- */
327
- getKillstreakerByName(name: string): UndefinedOrError<number>;
328
- /**
329
- * Asynchronously get the id of a killstreaker by its name.
330
- * @param name The name of the killstreaker.
331
- * @returns Returns the id of the killstreaker or throws an error if the
332
- * killstreaker cannot be found.
333
- * @example schema.fetchKillstreakerByName("Cerebral Discharge") -> Promise.resolve(2003)
334
- * @example schema.fetchKillstreakerByName("Non-existent killstreaker") -> Promise.reject(new Error("Killstreaker not found"))
335
- */
336
- fetchKillstreakerByName(name: string): Promise<number>;
337
- }
338
- /**
339
- * Various information needs to be retrieved externally to format the TF2 items.
340
- * This schema is used to define the getters for this information.
341
- */
342
- export interface TF2ParserSchema extends GetItemsGameItem {
343
- getSpellById(defindex: number, id: number): UndefinedOrError<number>;
344
- /**
345
- * Asynchronously get the defindex of a spell by the attribute defindex and value.
346
- * @param defindex The defindex of the spell attribute.
347
- * @param id The value of the spell attribute.
348
- * @returns Returns the defindex of the spell or throws an error if the spell
349
- * cannot be found.
350
- * @example schema.fetchSpellById(1004, 1) -> Promise.resolve(8902)
351
- * @example schema.fetchSpellById(1004, 1) -> Promise.reject(new Error("Spell not found"))
352
- */
353
- fetchSpellById(defindex: number, id: number): Promise<number>;
354
- /**
355
- * Syncronously get the defindex of a paint by its hex color code.
356
- * @param color The hex color code of the paint.
357
- * @returns Returns the defindex of the paint, undefined if the paint cannot
358
- * be found syncronously or an error to exit early.
359
- * @example schema.getPaintByColor("e7b53b") -> 5037
360
- * @example schema.getPaintByColor("e7b53b") -> undefined
361
- * @example schema.getPaintByColor("") -> new Error("Paint not found")
362
- */
363
- getPaintByColor(color: string): UndefinedOrError<number>;
364
- /**
365
- * Asynchronously get the defindex of a paint by its hex color code.
366
- * @param color The hex color code of the paint.
367
- * @returns Returns the defindex of the paint or throws an error if the paint
368
- * cannot be found.
369
- * @example schema.fetchPaintByColor("e7b53b") -> Promise.resolve(5037)
370
- * @example schema.fetchPaintByColor("e7b53b") -> Promise.reject(new Error("Paint not found"))
371
- */
372
- fetchPaintByColor(color: string): Promise<number>;
373
- /**
374
- * Syncronously get the defindex of a strange part by its id.
375
- * @param id The id of the strange part.
376
- * @returns Returns the defindex of the strange part, undefined if the strange
377
- * part cannot be found syncronously or an error to exit early.
378
- * @example schema.getStrangePartById(27) -> 6015
379
- * @example schema.getStrangePartById(27) -> undefined
380
- * @example schema.getStrangePartById(-1) -> new Error("Strange part not found")
381
- */
382
- getStrangePartById(id: number): UndefinedOrError<number>;
383
- /**
384
- * Asynchronously get the defindex of a strange part by its id.
385
- * @param id The id of the strange part.
386
- * @returns Returns the defindex of the strange part or throws an error if the
387
- * strange part cannot be found.
388
- * @example schema.fetchStrangePartById(27) -> Promise.resolve(6015)
389
- * @example schema.fetchStrangePartById(-1) -> Promise.reject(new Error("Strange part not found"))
390
- */
391
- fetchStrangePartById(id: number): Promise<number>;
392
- }
393
81
  export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../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