pokemmo-items-prices 1.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.
@@ -0,0 +1,59 @@
1
+ declare class Item {
2
+ name: {
3
+ [key: string]: string;
4
+ };
5
+ description: {
6
+ [key: string]: string;
7
+ };
8
+ price: number;
9
+ listings: number;
10
+ quantity: number;
11
+ constructor(name: {
12
+ [key: string]: string;
13
+ }, description: {
14
+ [key: string]: string;
15
+ }, price: number, listings: number, quantity: number);
16
+ /**
17
+ * @param lang Language code (e.g., "en", "fr")
18
+ * @returns Localized name of the item. Falls back to English if the requested language is not available.
19
+ */
20
+ getName(lang: string): string;
21
+ /**
22
+ * @param lang Language code (e.g., "en", "fr")
23
+ * @returns Localized description of the item. Falls back to English if the requested language is not available.
24
+ */
25
+ getDescription(lang: string): string;
26
+ }
27
+
28
+ declare class PokemmoItemsPrices {
29
+ private items;
30
+ /**
31
+ * Updates the local items array with the latest API data.
32
+ */
33
+ refreshItems(): Promise<void>;
34
+ /**
35
+ * Fetches the data from the API if it haven't been done yet.
36
+ * @returns A promise of an array containing the list of all the items
37
+ */
38
+ getAllItems(): Promise<Item[]>;
39
+ /**
40
+ * Retrieves the name and description of an item from its id.
41
+ * @param item API item object
42
+ * @returns An array containing the item's name and description.
43
+ */
44
+ private getItemInfos;
45
+ /**
46
+ * Retrieves the name of an item from its id.
47
+ * @param id The item's id
48
+ * @returns An object containing the item's names in different languages ("Unknown item" if the id isn't found in the items.json file)
49
+ */
50
+ private getItemName;
51
+ /**
52
+ * Retrieves the description of an item from its id.
53
+ * @param id The item's id
54
+ * @returns An object containing the item's description in different languages ("Unknown item" if the id isn't found in the items.json file)
55
+ */
56
+ private getItemDescription;
57
+ }
58
+
59
+ export { Item, PokemmoItemsPrices };
@@ -0,0 +1,59 @@
1
+ declare class Item {
2
+ name: {
3
+ [key: string]: string;
4
+ };
5
+ description: {
6
+ [key: string]: string;
7
+ };
8
+ price: number;
9
+ listings: number;
10
+ quantity: number;
11
+ constructor(name: {
12
+ [key: string]: string;
13
+ }, description: {
14
+ [key: string]: string;
15
+ }, price: number, listings: number, quantity: number);
16
+ /**
17
+ * @param lang Language code (e.g., "en", "fr")
18
+ * @returns Localized name of the item. Falls back to English if the requested language is not available.
19
+ */
20
+ getName(lang: string): string;
21
+ /**
22
+ * @param lang Language code (e.g., "en", "fr")
23
+ * @returns Localized description of the item. Falls back to English if the requested language is not available.
24
+ */
25
+ getDescription(lang: string): string;
26
+ }
27
+
28
+ declare class PokemmoItemsPrices {
29
+ private items;
30
+ /**
31
+ * Updates the local items array with the latest API data.
32
+ */
33
+ refreshItems(): Promise<void>;
34
+ /**
35
+ * Fetches the data from the API if it haven't been done yet.
36
+ * @returns A promise of an array containing the list of all the items
37
+ */
38
+ getAllItems(): Promise<Item[]>;
39
+ /**
40
+ * Retrieves the name and description of an item from its id.
41
+ * @param item API item object
42
+ * @returns An array containing the item's name and description.
43
+ */
44
+ private getItemInfos;
45
+ /**
46
+ * Retrieves the name of an item from its id.
47
+ * @param id The item's id
48
+ * @returns An object containing the item's names in different languages ("Unknown item" if the id isn't found in the items.json file)
49
+ */
50
+ private getItemName;
51
+ /**
52
+ * Retrieves the description of an item from its id.
53
+ * @param id The item's id
54
+ * @returns An object containing the item's description in different languages ("Unknown item" if the id isn't found in the items.json file)
55
+ */
56
+ private getItemDescription;
57
+ }
58
+
59
+ export { Item, PokemmoItemsPrices };