ItemManager class
An item manager - to fetch and manage all item data. Does not require an API Key.
Signature:
export declare class ItemManager implements BaseManager<Item>
Implements: BaseManager<Item>
References: BaseManager, Item
Constructor
new ItemManager (client: Client)
Constructs a new instance of the ItemManager
class.
Parameters:
Parameter | Type | Description |
---|---|---|
client | Client | The client this item manager belongs to. |
Properties
client
The client this item manager belongs to.
Type: Client
Methods
.fetch ()
Fetch an item by its 4-digit ID. The ID must be a string of 4 digits (not a number)
Signature:
fetch(key: string, options?: FetchOptions): Promise<Item>;
Parameters:
Parameter | Type | Description |
---|---|---|
key | String | The ID of the item to fetch. |
options | FetchOptions | The basic fetching options. |
.fetchAll ()
Fetch all items.
Signature:
fetchAll(options?: FetchOptions): Promise<Collection<string, Item>>;
Parameters:
Parameter | Type | Description |
---|---|---|
options | FetchOptions | The basic fetching options. |
Return type: Promise < Collection < String, Item > >
.fetchByName ()
Fetch an item by its name. The search is case-insensitive. The special characters are NOT ignored.
Signature:
fetchByName(name: string, options?: FetchOptions): Promise<Item | undefined>;
Parameters:
Parameter | Type | Description |
---|---|---|
name | String | The name of the item to look for. |
options | FetchOptions | The basic fetching options. |
Return type: Promise < Item | Undefined >
.fetchMany ()
Fetch multiple items at once.
Signature:
fetchMany(keys: string[], options?: FetchOptions): Promise<Collection<string, Item>>;
Parameters:
Parameter | Type | Description |
---|---|---|
keys | String | The keys of the items to fetch. |
options | FetchOptions | The basic fetching options. |
Return type: Promise < Collection < String, Item > >
Table of Contents