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:

ParameterTypeDescription
clientClientThe 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:

ParameterTypeDescription
keyStringThe ID of the item to fetch.
optionsFetchOptionsThe basic fetching options.

Return type: Promise < Item >


.fetchAll ()

Fetch all items.

Signature:

fetchAll(options?: FetchOptions): Promise<Collection<string, Item>>;

Parameters:

ParameterTypeDescription
optionsFetchOptionsThe 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:

ParameterTypeDescription
nameStringThe name of the item to look for.
optionsFetchOptionsThe 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:

ParameterTypeDescription
keysStringThe keys of the items to fetch.
optionsFetchOptionsThe basic fetching options.

Return type: Promise < Collection < String, Item > >