diff --git a/docs/wowapi/classes/C_AuctionHouse.md b/docs/wowapi/classes/C_AuctionHouse.md new file mode 100644 index 0000000..137553a --- /dev/null +++ b/docs/wowapi/classes/C_AuctionHouse.md @@ -0,0 +1,3509 @@ +To create a comprehensive and useful documentation guide for the `C_AuctionHouse.CalculateCommodityDeposit` method, you would follow the format and detail provided in the TypeScript class example. This involves a detailed description of the method, parameters, return values, and a practical usage example. Below is a structured documentation to match your requirements: + +--- + +## C_AuctionHouse.CalculateCommodityDeposit + +Calculates the deposit required to post a commodity item at the auction house. This method is particularly useful for players and add-ons to estimate the cost associated with auctioning commodities. + +### Parameters + +- **`itemId`** `number`: The unique identifier for the item. This ID corresponds to the specific commodity you wish to auction. +- **`duration`** `AUCTION_RUNTIME`: The duration for which the item will be up for auction. This value must be one of the predefined `AUCTION_RUNTIME` constants (`AUCTION_RUNTIME_TWELVE_HOURS`, `AUCTION_RUNTIME_TWENTY_FOUR_HOURS`, or `AUCTION_RUNTIME_FORTY_EIGHT_HOURS`). +- **`quantity`** `number`: The amount of the commodity to be auctioned. This must be a positive integer. + +### Returns + +- `number | null`: Returns the deposit amount required for the specified auction parameters. If unable to calculate (e.g., invalid itemId or parameters), it returns `null`. + +### Usage Example + +In this example, we calculate the deposit required to auction 10 units of a commodity with the `itemId` of 12345 for a 24-hour duration. + +```typescript +const itemId = 12345; // Example item ID for a commodity +const duration = AUCTION_RUNTIME.TWENTY_FOUR_HOURS; // Auction for 24 hours +const quantity = 10; // Quantity of the commodity to auction + +const deposit = C_AuctionHouse.CalculateCommodityDeposit(itemId, duration, quantity); + +if (deposit !== null) { + console.log(`The deposit required is ${deposit} gold.`); +} else { + console.error("Unable to calculate the deposit. Check the itemId, duration, and quantity."); +} +``` + +This example demonstrates how to use the `CalculateCommodityDeposit` method to determine the deposit necessary for auctioning a commodity. It also illustrates error handling through a check for a `null` return value, prompting the user to verify their input parameters. + +--- + +This documentation provides a concise yet informative guide for developers looking to integrate or utilize the `CalculateCommodityDeposit` method in their AIO plugins or World of Warcraft AddOns. By following the provided structure and detailing, users can effectively understand and implement this functionality in their projects. + +## CalculateItemDeposit + +This method calculates the deposit required to list an item in the auction house. + +### Parameters +- **table** `ItemLocationMixin` - The item for which to calculate the deposit. +- **duration** `AUCTION_RUNTIME` - The duration for which you are planning to list the item. This parameter uses predefined constants that represent the auction duration. +- **quantity** `number` - The number of items of the specified type to auction. + +### Returns +- **number | null** - The calculated deposit amount for the specified item and duration, or null if the calculation fails for any reason. + +### Example Usage +This example demonstrates how to calculate the deposit for listing a particular item in the auction house for a specified duration and quantity. +```typescript +// Assuming you have an item location mixin for the item you're interested in +let myItemLocation: ItemLocationMixin = ...; +// Define the auction duration using pre-defined constants, e.g., AUCTION_RUNTIME.FORTY_EIGHT_HOURS +let auctionDuration: AUCTION_RUNTIME = AUCTION_RUNTIME.FORTY_EIGHT_HOURS; +// Define the quantity of the item you wish to auction +let quantity: number = 5; + +// Call the CalculateItemDeposit function with the necessary parameters +let depositAmount: number | null = C_AuctionHouse.CalculateItemDeposit(myItemLocation, auctionDuration, quantity); + +if(depositAmount !== null) { + console.log(`The deposit amount for your item is: ${depositAmount}`); +} else { + console.log("Failed to calculate the deposit amount."); +} +``` +In this example, you first need to have an `ItemLocationMixin` instance that represents the item you want to list in the auction house. You also need to define the auction duration using one of the `AUCTION_RUNTIME` constants (`TWELVE_HOURS`, `TWENTY_FOUR_HOURS`, `FORTY_EIGHT_HOURS`). After specifying the quantity of the item, you call `C_AuctionHouse.CalculateItemDeposit` with these parameters to get the deposit amount needed. If the calculation is successful, it returns the amount; otherwise, it returns null, indicating a failure in the calculation. + +Creating Markdown documentation for the class method `CanCancelAuction` in `C_AuctionHouse`, which references the World of Warcraft API similar to the provided examples: + +--- + +# C_AuctionHouse + +`C_AuctionHouse` provides methods for interacting with the auction house functionality in World of Warcraft. Below is the method documentation for `CanCancelAuction`. + +## CanCancelAuction + +Determines whether the player can cancel a specified auction. + +### Parameters + +**ownedAuctionId** `number` - The unique identifier for the auction you want to check. This ID is unique to the player's auctions and is not shared with auctions from other players. + +### Returns + +**boolean** - `true` if the auction can be canceled; otherwise, `false`. + +### Example Usage + +The following example shows how you can use `CanCancelAuction` to check if a specific auction, identified by its `ownedAuctionId`, can be canceled. If the auction can be canceled, a message is printed to the default chat window. + +```typescript +// Assume we have an auction ID that we've obtained from somewhere else in our code +const ownedAuctionId = 123456; + +// Check if this auction can be canceled +const canCancel = C_AuctionHouse.CanCancelAuction(ownedAuctionId); + +// Inform the player whether the auction can be canceled +if (canCancel) { + print("You can cancel this auction."); +} else { + print("This auction cannot be canceled."); +} +``` + +### Notes + +- To obtain the `ownedAuctionId` for auctions you've listed, you'll need to use other methods provided by `C_AuctionHouse` to query your current auctions. +- This method is particularly useful for managing auctions programmatically, allowing for scripts or addons to automate certain aspects of auction house management within the limits established by the game's API. + +### See Also + +- [`C_AuctionHouse.GetOwnedAuctions`](https://wow.gamepedia.com/API_C_AuctionHouse.GetOwnedAuctions) for retrieving a list of auctions you currently have listed. +- [`C_AuctionHouse.CancelAuction`](https://wow.gamepedia.com/API_C_AuctionHouse.CancelAuction) for the method used to cancel an auction if `CanCancelAuction` returns `true`. + +--- + +This Markdown document provides a structured and detailed outline for the `CanCancelAuction` method in `C_AuctionHouse`, following the example given and applying it to the context of World of Warcraft's API for auction house management. + +Given the structure and format demonstrated in the previous examples, here is how you can create markdown documentation for the `C_AuctionHouse.CancelAuction` method. + +--- + +## C_AuctionHouse.CancelAuction +This method cancels an auction that you currently have posted, identified by the unique owned auction ID. + +### Parameters +- **ownedAuctionId** `number` - The unique identifier for the auction you want to cancel. + +### Returns +`void` - This method does not return a value. + +### Example Usage +To cancel an auction, you first need the owned auction ID. This ID is usually obtained when you list an item on the auction house or through other auction house querying methods. Once you have the ID, you can use the `CancelAuction` method to cancel it. + +Below is an example of how you might cancel an auction with an owned auction ID of 12345: + +```typescript +const ownedAuctionId = 12345; // Example owned auction ID + +// Cancel the auction +C_AuctionHouse.CancelAuction(ownedAuctionId); + +console.log(`Auction with ID ${ownedAuctionId} has been cancelled.`); +``` + +### Notes +- You can only cancel auctions that you own. +- Once an auction is cancelled, it cannot be reversed. Ensure you truly want to cancel an auction before doing so. +- Depending on the game's current rules and settings, there might be a cooldown or a fee associated with cancelling auctions. Check the current World of Warcraft policies for more information. + +### References +- [C_AuctionHouse.CancelAuction WoW API Documentation](https://wow.gamepedia.com/API_C_AuctionHouse.CancelAuction) + +--- + +This markdown document follows the established format, providing a clear description, parameter details, a concise return explanation, an illustrative example of how to use the method, additional notes for the users of the API, and references to official documentation. + +Certainly! Below is an example of how to document the `CancelCommoditiesPurchase` method for `C_AuctionHouse` class in markdown format, leveraging your provided structure and aiming for clarity and thoroughness. + +--- + +## C_AuctionHouse + +### CancelCommoditiesPurchase + +This method cancels the current commodities purchase in the Auction House. + +#### Signature +```typescript +CancelCommoditiesPurchase(): void; +``` + +#### Description +When a player initiates a commodities purchase in the World of Warcraft Auction House (AH), this method can be used to cancel the purchase before it is finalized. This action is applicable to commodities, which are items that can be bought in quantities greater than one, such as crafting materials. + +This method is a part of the `C_AuctionHouse` namespace, which encapsulates functionalities related to WoW's in-game Auction House. It ensures that players have control over their purchase actions by allowing them to retract a buying decision promptly. + +#### Parameters +None. + +#### Returns +Void. There is no return value, as the method's primary function is to send a command to the game client to cancel a commodities purchase. + +#### Usage Example +In this scenario, a player may have initiated a purchase for a large quantity of a specific commodity, such as "Monelite Ore," but decides to cancel this purchase. The following example demonstrates how to call `CancelCommoditiesPurchase`: + +```typescript +// Assume a commodities purchase for "Monelite Ore" was previously initiated. +// To cancel this purchase, simply call the method without any parameters. +C_AuctionHouse.CancelCommoditiesPurchase(); + +console.log("Commodities purchase cancelled successfully."); +``` + +#### Notes +- Make sure to invoke this method before the purchase is finalized by the game client. Once a purchase is complete, it cannot be reversed through this API. +- This method does not require any parameters, as it acts on the most recent or ongoing commodities purchase. +- As with any in-game actions invoked through the API, players should exercise caution and ensure they really wish to cancel the purchase to avoid unintended gameplay disruptions. + +#### See Also +- [C_AuctionHouse.MakeCommodityPurchase](https://wow.gamepedia.com/API_C_AuctionHouse.MakeCommodityPurchase) for initiating a commodities purchase. +- [C_AuctionHouse.GetCommoditySearchResults](https://wow.gamepedia.com/API_C_AuctionHouse.GetCommoditySearchResults) for retrieving the current commodities available in the AH. + +--- + +This example aims to give a comprehensive understanding of the `CancelCommoditiesPurchase` method while incorporating the guidelines and format you've provided. + +### CancelSell + +Cancels the current player's auction. + +#### Usage +```typescript +C_AuctionHouse.CancelSell(); +``` + +#### Parameters +None. + +#### Returns +Void. This method does not return any value. + +#### Details +- This method allows you to cancel an auction that you have listed in the Auction House. +- **Important:** Use this method with caution as it might have implications such as losing the deposit placed on the auction. +- This method can be used to manage auctions programmatically, offering flexibility in auction strategies. +- Note: To identify which auction to cancel, you may need to retrieve auction information using other Auction House APIs. + +#### Example Usage: + +```typescript +// Assuming you have identified the auction you want to cancel +// This action might require a confirmation or additional steps to select the specific auction. +C_AuctionHouse.CancelSell(); + +// It's a good practice to provide feedback to the user or log the action +console.log("Auction has been canceled successfully."); +``` + +#### Additional Notes: +- Ensure you are aware of the current UI and game state to avoid calling this method inappropriately. +- Handling the response and updating the UI accordingly is necessary to reflect the changes made by canceling an auction. +- The operation of this method can be subject to game rules and policies about auction operations. +- This method's function is closely tied to the player's interaction with the Auction House and should be part of a broader strategy for auction management in addons. + +By following the above documentation format, you can ensure consistency and clarity when creating readme documentation for TypeScript Class definitions aimed at building AIO plugins or addons for World of Warcraft, leveraging the World of Warcraft API. + +Creating markdown documentation for the `CloseAuctionHouse` method in the `C_AuctionHouse` class can be broken down into several parts. We'll include a description, parameters (if any), returns, and an example usage section. Given the simplicity of this method, the example will be crucial to give users an idea of where and how it might be used. Note that even when methods are simple, proper documentation ensures clarity and ease of use for developers unfamiliar with the specific API or framework. + +--- + +## CloseAuctionHouse + +Closes the currently open Auction House UI in the game. It's an instantaneous action that requires the Auction House window to be open. If it's not open, calling this method won't have any effect but will fail silently without causing any errors. + +### Parameters + +None + +### Returns + +Void - There is no return value. + +### Example Usage + +```typescript +/** + * This example demonstrates how to ensure the Auction House UI is closed after + * performing certain actions. For simplicity, let's say a player runs a command + * to check for specific auctions, and whether or not the operation is successful, + * we ensure to close the Auction House UI. + */ + +// Function that simulates checking auctions +const checkAuctions = () => { + // Imagine here you perform operations related to auction checking + console.log("Checking auctions..."); + + // After operations, ensure to close the Auction House UI + C_AuctionHouse.CloseAuctionHouse(); +} + +// Simulating a player action that needs the Auction House to be closed afterward +const playerAction = () => { + console.log("Player initiated an auction check..."); + + checkAuctions(); + + // After the checking process, the Auction House UI will be closed + console.log("Auction check concluded. Auction House UI closed if it was open."); +} + +// Invoking the simulated player action +playerAction(); +``` + +### Notes + +- Utilize this method with caution, especially in game add-ons or scripts that might disrupt the player's natural gameplay interaction. +- It's good practice to ensure that your add-on or script does not unexpectedly close the Auction House UI for the player unless it's intended and clear to the user. + +Following this structured approach ensures your documentation is not only helpful but also aligns well with standards that promote clarity, conciseness, and usefulness, especially when dealing with APIs or frameworks like the World of Warcraft API. + +To create comprehensive documentation for the `C_AuctionHouse.ConfirmCommoditiesPurchase` method similar to the provided examples, follow the structure below. This documentation is designed to offer a thorough understanding of what the method does, its parameters, and how to use it. + +--- + +## ConfirmCommoditiesPurchase +This method is used to confirm the purchase of commodities from the Auction House. Commodities in World of Warcraft are stackable items that players can buy in any quantity. This method finalizes the purchase of such items in the quantity desired. + +### Parameters +- **itemId** (number): The ID of the item you wish to purchase. Item IDs can be found in game files or on various WoW databases online. +- **quantity** (number): The number of units of the item you wish to purchase. + +### Returns +- **void**: This method does not return any value but confirms the purchase of commodities on the WoW Auction House. + +### Example Usage +The example below showcases how to use `ConfirmCommoditiesPurchase` to buy a commodity from the Auction House. Before calling this method, you should ensure that you have enough in-game currency (gold) to cover the purchase and that the item is available in the quantity you desire. +```typescript +class AuctionHouseManager { + private itemId: number; + private quantity: number; + + constructor(itemId: number, quantity: number) { + this.itemId = itemId; + this.quantity = quantity; + } + + /** + * This method confirms the purchase of a given quantity of an item from the Auction House. + */ + confirmPurchase() { + // Assuming C_AuctionHouse is already defined and accessible within the game's API scope. + try { + C_AuctionHouse.ConfirmCommoditiesPurchase(this.itemId, this.quantity); + console.log(`Purchase confirmed for ${this.quantity} units of item ID ${this.itemId}.`); + } catch (error) { + console.error("Failed to confirm purchase due to an error: ", error); + } + } +} + +// Example usage +const itemId = 12345; // Example item ID; in a real scenario, this would be the actual item ID you want to buy. +const quantity = 10; // The quantity of the item you're looking to purchase. + +const auctionHouseManager = new AuctionHouseManager(itemId, quantity); +auctionHouseManager.confirmPurchase(); +``` +In this example, `AuctionHouseManager` is a hypothetical class utilized to manage auction house transactions. The `confirmPurchase` method within it is specifically used to confirm the purchase of a particular commodity by calling the `C_AuctionHouse.ConfirmCommoditiesPurchase` method with the desired `itemId` and `quantity`. + +Remember, this is an illustrative example; actual implementation details might vary based on the overall structure of your addon or script. + +### See Also +- [Auction House API Documentation](https://wow.gamepedia.com/API_C_AuctionHouse) for more information on other Auction House related methods. +- [Item ID Database](https://www.wowhead.com/items) on Wowhead for finding item IDs. + +When documenting a method from a class intended for use in building AIO plugins or similar applications, it's crucial to provide a clear, comprehensive, and structured overview that includes details like the method's purpose, parameters, return types, and an example of how to use it. Below is a meticulously crafted documentation for the `FavoritesAreAvailable` method from the class `C_AuctionHouse`, fashioned after the provided examples. + +--- + +## C_AuctionHouse.FavoritesAreAvailable + +Determines whether the favorites feature is available in the Auction House interface. + +### Description + +The Auction House interface in World of Warcraft allows players to keep track of specific items by marking them as favorites. The `FavoritesAreAvailable` method checks if this functionality is enabled and available to the user. This can be particularly useful for addons that aim to enhance the Auction House experience by offering additional layers of notification or tracking for favorite items. + +### Syntax + +```typescript +FavoritesAreAvailable(): boolean; +``` + +### Parameters + +None. + +### Returns + +**boolean** - Returns `true` if the favorites feature is available in the Auction House; otherwise, returns `false`. + +### Example Usage + +The following example demonstrates how to check if the favorites feature is available in the Auction House. This can be used to conditionally enable or disable addon features related to Auction House favorites. + +```typescript +const auctionHouseAvailable = C_AuctionHouse.FavoritesAreAvailable(); + +if (auctionHouseAvailable) { + console.log("The Auction House favorites feature is available."); + // Additional logic to handle favorites can go here. +} else { + console.log("The Auction House favorites feature is not available."); + // Handle the absence of this feature or disable related functionality. +} +``` + +### Remarks + +It's important to note that the availability of Auction House features, including favorites, can be subject to change based on the player's current subscription status, the game version, or server-specific features. Therefore, ensuring your addon gracefully handles the scenarios where certain features are unavailable is advisable. + +--- + +When writing documentation in this style, it's crucial to maintain clarity and brevity while providing all necessary information. This includes a clear example that not only demonstrates how to use the method but also how to handle its return value appropriately. + +# C_AuctionHouse.GetAuctionItemSubClasses + +Retrieves the sub-classes for a given item class from the Auction House. This method is useful for narrowing down search results or categorizing items more specifically within the Auction House UI. + +### Parameters + +- **classId** (`number`): The ID of the item class. Item classes are broad categories under which items are grouped, such as Weapon, Armor, etc. + +### Returns + +- **number[]**: An array of numbers, each representing a sub-class ID within the given item class. These sub-class IDs further categorize items under their respective item class. + +### Example Usage + +The following example demonstrates how to use `C_AuctionHouse.GetAuctionItemSubClasses` to obtain the sub-classes of the item class 'Armor' (assuming 'Armor' has a classId of 4). It prints the sub-class IDs to the console, which can then be used for more specific queries or to inform the user about the types of Armor available in the Auction House. + +```typescript +// Assume '4' is the classId for 'Armor' +const armorClassId: number = 4; + +// Fetch the sub-class IDs for Armor +const armorSubClasses: number[] = C_AuctionHouse.GetAuctionItemSubClasses(armorClassId); + +// Log the array of sub-class IDs to the console +console.log("Armor Sub-Classes:", armorSubClasses); + +// Example output (the actual values depend on the game data): +// Armor Sub-Classes: [1, 2, 3, 4, 5] +``` + +In this example, the `C_AuctionHouse.GetAuctionItemSubClasses` method is used to query the Auction House API for sub-classes under the 'Armor' class. This can be particularly useful for UIs or AddOns aimed at providing users with detailed search capabilities, allowing them to filter auction items not just by class but by sub-class as well. + +**Note:** The actual `classId` for 'Armor' and the sub-class IDs in World of Warcraft may differ from the given example. Always refer to the latest game documentation or data-mined information for accurate IDs. + +Given the format and style provided in the examples above, here is how you would document the `GetAvailablePostCount` method of the `C_AuctionHouse` class using markdown, mimicking a similar approach to how plugin documentation is usually done for World of Warcraft (WoW) addons. The provided style emulates documentation that is comprehensive, including a description, parameters, and example usage. + +--- + +# C_AuctionHouse.GetAvailablePostCount + +Retrieves the number of times an item can currently be posted on the Auction House. + +This method is used to check how many of a particular item you are able to list on the Auction House based on current inventory including stack size settings. This can be useful for addons aiming to simplify bulk actions or manage Auction House listings effectively. + + +### Parameters + +- **item**: `ItemLocationMixin` - The item for which to check the available post count. + +### Returns + +- **number** - The number of times the item can be posted on the Auction House. + + +### Example Usage + +This example demonstrates how to use `GetAvailablePostCount` to find out how many more times an item can be listed on the Auction House. It assumes you have an item of interest, referenced by `itemLocation`, and it outputs the result in a chat message. + +```typescript +const itemLocation: ItemLocationMixin = C_Item.GetItemLocation(containerID, slotIndex); + +// Assuming 'containerID' and 'slotIndex' define the location of your item + +const availablePostCount: number = C_AuctionHouse.GetAvailablePostCount(itemLocation); + +console.log(`You can post this item ${availablePostCount} more times.`); +``` + +This code snippet makes use of `C_Item.GetItemLocation(containerID, slotIndex)` to obtain an `ItemLocationMixin` instance representing the item's location, which is then passed to `GetAvailablePostCount`. The result is printed to the console, letting the user know how many more times the item can be posted. + +It's important to remember that for this to work, `containerID` and `slotIndex` should be valid identifiers for a container (bag) and a slot within that container that holds the item you are interested in. + +--- + +Note: Ensure to replace `containerID` and `slotIndex` with actual values representing the location of the item you wish to check. Additionally, handle the scenario where the item might not be eligible for auctioning, which could be the case for bound items or non-tradable items. + +Creating comprehensive and clear documentation for methods within classes or interfaces is crucial for developers to understand and utilize the functionalities provided. Following the structure demonstrated above for the `FontInstance` interface, here is how to document the `C_AuctionHouse.GetBidInfo` method in a similar detailed README format. + +```markdown +# C_AuctionHouse.GetBidInfo + +This method retrieves information about a specific bid that the player has placed in the auction house. + +## Parameters +**bidIndex** number - The index of the bid to get information for. Bid indices start at 1 and go up to `C_AuctionHouse.GetNumBids()`. + +## Returns +**BidInfo** object or `null` if the bid index is invalid. The `BidInfo` object contains the following properties: +- **itemLink**: string - A link to the auctioned item. +- **bidAmount**: number - The amount of money bid on the item. +- **bidder**: string - The name of the character who placed the bid. +- **timeLeft**: number - The time left before the auction ends, in seconds. + +## Example Usage +The following example shows how to use `GetBidInfo` to retrieve information about the first bid in the player's list of current bids. + +```typescript +const bidIndex = 1; // Example: Get the first bid. +const bidInfo = C_AuctionHouse.GetBidInfo(bidIndex); + +if (bidInfo !== null) { + console.log(`Item Link: ${bidInfo.itemLink}`); + console.log(`Bid Amount: ${bidInfo.bidAmount}`); + console.log(`Bidder: ${bidInfo.bidder}`); + console.log(`Time Left: ${bidInfo.timeLeft} seconds`); +} else { + console.error(`No bid found at index ${bidIndex}.`); +} +``` + +In this code snippet, `C_AuctionHouse.GetBidInfo` is called with a `bidIndex` of `1` to retrieve the first bid's information. It logs the bid information to the console if the bid exists or an error message if no bid is found at the specified index. + +## See Also +For more information on interacting with the Auction House API, refer to the following: + +- [C_AuctionHouse.GetNumBids](https://wow.gamepedia.com/API_C_AuctionHouse.GetNumBids) - Retrieves the total number of bids placed by the player. +- [C_AuctionHouse.GetAuctionInfo](https://wow.gamepedia.com/API_C_AuctionHouse.GetAuctionInfo) - Retrieves information about a specific auction item. + +This documentation style provides the function's purpose, parameters it accepts, what it returns, how to use it with an example, and links to related functions or methods. +``` + +This documentation example follows the structure of explaining what the method does, detailing its parameters and return values with types and explanations, providing a practical usage example to demonstrate how to call the method, and listing related methods or links for further reading. This format ensures clarity and provides a thorough understanding of the method's functionality and implementation. + +To document the `C_AuctionHouse.GetBidType` method in a markdown format, based on the structure of the examples given above, we might format it like this: + +## C_AuctionHouse.GetBidType + +This method retrieves information about the type of bid made on an auction in the Auction House. + +### Parameters +**bidTypeIndex** number - The index of the bid type you want to query. + +### Returns +**ItemKey** | **null** - Returns an `ItemKey` object containing details about the item type if the bid type index is valid; otherwise, it returns `null`. + +### Example Usage: + +The following example demonstrates how to use the `GetBidType` method to retrieve the item type of the first bid made in the Auction House. It assumes that there is at least one bid made. + +```typescript +// Assume you are interested in the first bid type index +const bidTypeIndex = 1; + +// Attempt to retrieve the ItemKey for a bid type index in the Auction House +const itemKey = C_AuctionHouse.GetBidType(bidTypeIndex); + +if (itemKey !== null) { + console.log("Item Type Retrieved"); + console.log(`Item ID: ${item.key.itemID}`); + console.log(`Item Type: ${item.key.itemType}`); + // Process the itemKey information as needed +} else { + console.log("No item found for this bid type index."); +} +``` + +### Remarks + +- The `GetBidType` method is useful for addons that need to track or report on the types of items being bid on in the Auction House. +- Ensure you handle the `null` case to avoid runtime errors in your addon when querying non-existent bid type indexes. + +By using the `ItemKey` object returned by `GetBidType`, addon developers can access detailed information about the item, such as its ID and type, enabling them to provide more context or functionality around auction house bids within their addons. + +Based on the provided template and requirement for documenting a class method in markdown format, here's how you could document the `C_AuctionHouse.GetBrowseResults` method for an AIO plugin that interfaces with the World of Warcraft API. + +--- + +# C_AuctionHouse.GetBrowseResults + +Retrieves a list of items currently available in the Auction House browse tab. This method is useful for addons that need to display or analyze the current listings without having to manually parse each page of the Auction House. + +### Method Signature +```typescript +GetBrowseResults(): BrowseResultInfo[]; +``` + +### Returns +- **BrowseResultInfo[]**: An array of `BrowseResultInfo` objects, each representing an item in the Auction House browse tab. + +### BrowseResultInfo Object +Each `BrowseResultInfo` in the returned array contains the following properties: +- **itemID**: The unique identifier for the item. +- **itemName**: The name of the item. +- **count**: The number of items. +- **minBid**: The minimum bid price for the item. +- **bidAmount**: Current bid amount on the item, if any. +- **buyoutPrice**: The buyout price for the item. +- **timeLeft**: An enumeration indicating how much time is left in the auction. + +### Example Usage +This example demonstrates how to use `GetBrowseResults` to fetch and log the name and buyout price of each listed item in the Auction House. It is crucial to handle this data appropriately, considering the potentially large amount of information returned. + +```typescript +declare class AuctionHousePlugin { + private processAuctionHouseListings() { + const results = C_AuctionHouse.GetBrowseResults(); + for(const listing of results) { + console.log(`${listing.itemName}: ${listing.buyoutPrice}`); + } + } +} +``` + +### Notes +- The Auction House API's availability may depend on the player's current location in the game world and their interaction with Auction House NPCs. +- The information fetched by `GetBrowseResults()` is a snapshot and may change rapidly as players buy and sell items. +- Consider implementing caching or throttling when calling this method to minimize performance impact on both the client and the game server. + +--- + +This example focuses on delivering a comprehensive understanding of how to use the `C_AuctionHouse.GetBrowseResults()` method, including the method's signature, return type, an example of how to use the information it provides, and practical notes to guide developers in integrating this functionality into their addons effectively. + +## GetCancelCost +Cancels a posted auction at a specific cost. + +### Parameters +**ownedAuctionId**: `number` - The ID of the auction you wish to cancel. + +### Returns +**cancelCost**: `number` - The cost to cancel this auction. + +### Example Usage: +```typescript +interface C_AuctionHouse { + /** + * Returns the cost to cancel an auction. + * @param ownedAuctionId The unique identifier for the auction. + * @returns The gold cost to cancel the auction. + * @see https://wow.gamepedia.com/API_C_AuctionHouse.GetCancelCost + */ + GetCancelCost(ownedAuctionId: number): number; +} + +// Assuming 'AuctionHouseAPI' is an instance of 'C_AuctionHouse' +const ownedAuctionId = 12345; // The ID of the auction you wish to cancel +const cancelCost = AuctionHouseAPI.GetCancelCost(ownedAuctionId); + +console.log(`The cost to cancel your auction is: ${cancelCost} gold.`); +``` + +This method is handy for managing your auctions, especially when you've posted items and wish to retract them. Remember, retrieving the cost does not cancel the auction; it only informs you of the potential cost required to do so. Your next step after fetching this price would be to decide whether or not you want to proceed with the cancellation, potentially using another API method to perform the actual cancellation if you choose to proceed. + +### Additional Notes: +- The returned `cancelCost` is typically a fraction of the original posting cost but can vary based on auction house dynamics and specific item categories. +- Ensure you have sufficient gold to cover the cost of cancellation to avoid any unexpected issues. +- Utilizing this API method could be part of a more extensive script or add-on dedicated to auction house management, giving users better insight into their cancelation options and costs. + +Creating documentation for the method `GetCommoditySearchResultInfo` of class `C_AuctionHouse` can be approached by clearly detailing its purpose, parameters, return value, and providing a practical example of usage. Below is a markdown styled documentation that aligns with the examples provided earlier. + +--- + +## GetCommoditySearchResultInfo +Retrieve specific information about a commodity's auction search result by item ID and index. + +### Parameters +- **itemId** number - The unique identifier for the item commodity. +- **commoditySearchIndex** number - The index of the search result to retrieve details for. This is not the item's ID but the position in the list of search results. + +### Returns +**CommoditySearchResultInfo** | **null** - An object containing details about the search result at the specified index, or `null` if the index is invalid. + +### Example Usage: +To obtain information about a specific auction search result for a commodity (for instance, "Tidespray Linen"), first, initiate a commodity search. Then, you can use the `GetCommoditySearchResultInfo` method to retrieve details about a specific search result, such as its price, quantity, and seller. + +```typescript +// Assume itemId for "Tidespray Linen" is 152576 and we want to look at the first result +const itemId = 152576; +const commoditySearchIndex = 0; // Indexing begins at 0, so this would be the first result + +// Fetch the information of the first search result for "Tidespray Linen" +const resultInfo = C_AuctionHouse.GetCommoditySearchResultInfo(itemId, commoditySearchIndex); + +if (resultInfo !== null) { + console.log(`Seller: ${resultInfo.owner}`); + console.log(`Quantity: ${resultInfo.quantity}`); + console.log(`Unit Price: ${resultInfo.unitPrice}`); +} else { + console.log("No information found for the specified index."); +} +``` +This example demonstrates how to retrieve and log details about the first auction search result for a commodity specified by `itemId`. The information output includes the seller's name, the quantity of the item, and its unit price. + +> Note: Before using `GetCommoditySearchResultInfo`, ensure you have initiated a commodity search and that the index you are querying exists within the search results. + +Given the format you've shared, here is how you can document the `C_AuctionHouse.GetCommoditySearchResultsQuantity` method in a similar style. + +--- + +# C_AuctionHouse.GetCommoditySearchResultsQuantity + +This method retrieves the total quantity of a specific commodity available in the auction house listings. + +## Parameters +- **itemID** `number` - The unique identifier for the commodity item. + +## Returns +- `number` - The total quantity of the specified commodity item available in the auction house. + +## Example Usage +The following example demonstrates how to query the auction house for the total quantity of a commodity with a specific Item ID. This can be particularly useful for understanding the market availability of common crafting materials or other trade goods. + +```typescript +// Assume 12345 is the Item ID for a specific commodity, such as cloth or ore. +const itemID = 12345; + +// Get the total quantity of this commodity currently listed in the Auction House. +const quantity = C_AuctionHouse.GetCommoditySearchResultsQuantity(itemID); + +console.log(`There are currently ${quantity} units of the specified commodity (Item ID: ${itemID}) available in the Auction House.`); +``` + +This example could be used within a larger script or addon for World of Warcraft, providing valuable information to players about the availability of commodities in the auction house. The method helps in making informed decisions on buying or selling strategies based on the current market supply. + +### See Also +- For more information on interacting with the Auction House API, you can visit the WoW Gamepedia documentation: [C_AuctionHouse](https://wow.gamepedia.com/API_C_AuctionHouse) + +Note: The URL provided is based on the cut-off knowledge date, and the documentation at the provided link may have been updated. + +Based on the given examples and instructions, I'll document the `C_AuctionHouse.GetExtraBrowseInfo` method in a similar markdown format: + +## GetExtraBrowseInfo + +This method retrieves extra information available for an item in the Auction House. This can include additional flags or identifiers that provide more context or details about the item outside of its basic description. + +### Parameters +**itemKey** `ItemKey` - An object representing the key of the item. This typically includes the item's ID and possibly other identifying information specific to the context in which the item exists. + +### Returns +**number** - Returns a numeric value representing the extra information about the item. The meaning of this number can vary depending on the item and the context within the Auction House. + +### Example Usage: +To use `GetExtraBrowseInfo`, you first need an `ItemKey`. An `ItemKey` typically is constructed with the item's ID and other optional parameters that uniquely identify the item in the Auction House. Once you have an `ItemKey`, you can call `GetExtraBrowseInfo` to obtain additional details about the item. + +```typescript +// Assume we have an item with ID 12345 +const itemId = 12345; + +// Create an ItemKey for this item. Additional fields are omitted for simplicity +const itemKey = { itemID: itemId }; + +// Fetch extra browse information for the item +const extraInfo = C_AuctionHouse.GetExtraBrowseInfo(itemKey); + +console.log(`Extra information for item ID ${itemId}: ${extraInfo}`); +``` + +In this example, we're directly utilizing an item's ID to create an `ItemKey`, which is then passed to `GetExtraBrowseInfo` to fetch additional details. In a more complex application, the `ItemKey` might include more information to precisely identify items, especially those that can have varying characteristics such as armor or weapons with different enchantments, levels, or states. + +Keep in mind that the interpretation of the returned number from `GetExtraBrowseInfo` depends on the specific item and context. Further documentation or experimentation may be required to fully understand the meaning of the returned value for particular items in the Auction House. + +Certainly! Below is an example of how to document the `GetFilterGroups` method of the `C_AuctionHouse` class following the style and detail provided in the example TypeScript class documentation. + +--- + +# GetFilterGroups +Retrieves the current filter groups used by the Auction House UI. Each filter group represents a category or criteria used to organize auctionable items, making it easier for users to find what they're looking for. This method is crucial for addon developers aiming to integrate or enhance Auction House functionalities within their addons. + +### Parameters +None + +### Returns +An array of `AuctionHouseFilterGroup` objects. Each `AuctionHouseFilterGroup` contains: +- **groupName** (string): The name of the filter group, corresponding to a category or type of item (e.g., "Weapons", "Armor"). +- **filters** (array): An array of sub-filter objects that further categorize items within the group, potentially including specifications like item level, item type, etc. + +### Example Usage: +This example demonstrates how to retrieve and display the current Auction House filter groups and their respective filters. It is useful for developing UI elements that require Auction House data. + +```typescript +class AuctionHouseHelper { + /** + * Fetches and logs the current filter groups from the Auction House. + */ + static displayAuctionHouseFilters(): void { + // Retrieve filter groups from the Auction House API + const filterGroups = C_AuctionHouse.GetFilterGroups(); + + // Iterate through each group and log its name and filters + filterGroups.forEach((group) => { + console.log(`Group Name: ${group.groupName}`); + + group.filters.forEach((filter) => { + console.log(`- Filter: ${filter.filterName}`); + }); + }); + } +} + +// Usage of the AuctionHouseHelper to display Auction House filters +AuctionHouseHelper.displayAuctionHouseFilters(); +``` + +This example utilizes the `GetFilterGroups` method from the `C_AuctionHouse` class to fetch all current filter groups from the Auction House. Each group and its filters are then logged to the console, demonstrating a basic way to interact with and visualize Auction House data within an addon. This method is particularly useful for developers looking to create or customize Auction House interfaces or functionalities in their addons. + + +Based on the provided TypeScript interface documentation guidelines and the source code fragment for a class `C_AuctionHouse`, here is how you can structure the markdown documentation for the `GetItemCommodityStatus` method in a consistent format. + +--- + +# C_AuctionHouse + +The `C_AuctionHouse` class provides methods to interact with the Auction House system provided by the game API. This includes querying item statuses, posting auctions, and more. + +## Methods + +### GetItemCommodityStatus + +Provides the commodity status of a given item within the Auction House. + +#### Parameters + +- **item**: `ItemLocationMixin` - An item location mix-in that identifies the specific item in the player's inventory or bags. + +#### Returns + +- `ITEM_COMMODITY_STATUS` - Enum representing the commodity status of the item. Possible values indicate whether the item is a commodity, a non-commodity, or if there was an error determining the status. + +#### Usage Example + +To use the `GetItemCommodityStatus` method, you first need an `ItemLocationMixin` that points to the item you're interested in querying within the Auction House. Here is a basic example of retrieving the commodity status of an item: + +```typescript +// Assume `itemLocation` is a valid ItemLocationMixin previously obtained that represents an item within the player's inventory. +let commodityStatus = C_AuctionHouse.GetItemCommodityStatus(itemLocation); + +switch (commodityStatus) { + case ITEM_COMMODITY_STATUS.Commodity: + console.log("The item is a commodity."); + break; + case ITEM_COMMODITY_STATUS.NonCommodity: + console.log("The item is not a commodity."); + break; + case ITEM_COMMODITY_STATUS.Unknown: + default: + console.log("Could not determine the item's commodity status."); + break; +} + +``` + +This method is crucial for addons and scripts that interact with the Auction House, as it determines how an item will be listed and handled within the Auction House system. + +### See Also + +- [`ItemLocationMixin`](https://wowpedia.fandom.com/wiki/ItemLocationMixin) documentation for more details on how to work with item locations. +- [Auction House API](https://wowpedia.fandom.com/wiki/World_of_Warcraft_API#Auction) for more methods and details regarding interacting with the Auction House. + +--- + +This template keeps the documentation clear and concise, providing not just the method signatures but also practical usage examples to help users quickly understand how to apply the methods in their own projects or addons. + +Based on the provided example of how to document methods and classes for a TypeScript definition of World of Warcraft APIs or similar structures, here is how you would document the `C_AuctionHouse.GetItemKeyFromItem` method: + +## C_AuctionHouse.GetItemKeyFromItem + +Retrieves an item key from an item, allowing further operations or queries within the Auction House system. An item key uniquely identifies the type of an item, disregarding individual item properties like item level or enchantments. + +### Parameters + +- **item** `ItemLocationMixin` - The item's location mixin, identifying where the item is stored (e.g., bags, bank). + +### Returns + +`ItemKey` - An object containing identifying information about the item type including item ID and other relevant keys. + +### Example Usage: + +To use `GetItemKeyFromItem`, you first need an instance of `ItemLocationMixin`, which could be obtained through various gameplay interactions, such as selecting an item in your bag. Assuming you have obtained the item location mixin, you can then call the method like so: + +```typescript +const itemLocation = GetItemLocationMixinFromPlayerBag(1, 1); // Assuming the item is in the first slot of the player's first bag +const itemKey = C_AuctionHouse.GetItemKeyFromItem(itemLocation); + +if (itemKey) { + console.log(`Item ID: ${itemKey.itemID}`); + // Further actions can be taken using the item key, such as querying auction house listings. +} else { + console.error("Unable to retrieve item key."); +} +``` + +In the above example, `GetItemLocationMixinFromPlayerBag` is a fictional function that represents the action of obtaining an `ItemLocationMixin` for an item located in the player's bags. The exact way to obtain an `ItemLocationMixin` will depend on your specific implementation and what APIs or methods are available in your environment. + +### See Also + +- [World of Warcraft API: GetItemKeyFromItem](https://wow.gamepedia.com/API_C_AuctionHouse.GetItemKeyFromItem) for more details on this method. +- [ItemLocationMixin documentation](https://wow.gamepedia.com/ItemLocationMixin) for understanding how to work with item locations. + +This markdown documentation provides a structured way to understand the use, parameters, and possible integration of the `GetItemKeyFromItem` method within the context of interacting with the Auction House system in a World of Warcraft-like environment. + +# C_AuctionHouse.GetItemKeyInfo + +This method retrieves information about a specific item key in World of Warcraft's Auction House interface. + +### Parameters + +- **itemKey**: *ItemKey* - An object representing the item key. +- **restrictQualityToFilter**: *boolean?* (optional) - When set to `true`, restricts the quality to the filter provided. + +### Returns + +- Returns *ItemKeyInfo* | *null* - An object containing information about the item key if successful, or `null` if the item key is not found or an error occurs. + +### Example Usage + +In this example, we obtain information about a specific item key in the Auction House. We're looking at a particular item and optionally deciding to restrict our query based on item quality. + +```typescript +// Assuming we have defined an ItemKey object elsewhere, +// representing the specific item we're interested in. +let myItemKey: ItemKey = { + itemID: 12345, // Example item ID + battlePetSpeciesID: 0, + itemLevel: 0, + itemSuffix: 0, + itemQuality: 0, + battlePetBreedID: 0 +}; + +// Optionally, we restrict our query to items of a particular quality. +// Set to true if you wish to apply this restriction, or omit if not. +let restrictQuality: boolean = true; + +// Call the GetItemKeyInfo method to retrieve information about the item. +let itemKeyInfo = C_AuctionHouse.GetItemKeyInfo(myItemKey, restrictQuality); + +if (itemKeyInfo !== null) { + // If the call was successful and we obtained the item key info, + // you can then proceed to use this information as needed. + console.log("Item Key Information:", itemKeyInfo); +} else { + // Handle the case where the item key info could not be obtained. + console.error("Failed to obtain item key information."); +} +``` + +### Notes + +When dealing with the Auction House API, it's crucial to understand that certain operations might be restricted based on the game's state or the player's access at the time of the call. Therefore, always check for null responses and handle errors graciously. + +This method is particularly useful for addon developers who need to fetch details about items listed in the Auction House, allowing for detailed queries and operations based on item specifics. + +Given the structure and format from your provided examples, I've created a markdown documentation for the `C_AuctionHouse.GetItemSearchResultInfo` method. Below is a designed markdown document that adheres to the guidelines and formatting you supplied: + +--- + +# C_AuctionHouse.GetItemSearchResultInfo + +This method retrieves detailed information about a specific auction item based on its `ItemKey` and its index in the search results. The method is particularly useful when working with the Auction House API to access data about items that have been searched. + +## Parameters + +- **itemKey**: `ItemKey` + - An `ItemKey` object representing the unique identifier for the item type, including its ID, battle pet species ID (if applicable), and item suffix (if applicable). + +- **itemSearchResultIndex**: `number` + - The index of the item in the search results. This index is based on the order of items returned by the search query initiated by `C_AuctionHouse.Search()`. + +## Returns + +- `ItemSearchResultInfo | null` + - An `ItemSearchResultInfo` object containing detailed information about the auction item if available; otherwise, `null` if the information cannot be retrieved. + +## Example Usage + +This example demonstrates how to use `GetItemSearchResultInfo` to obtain and display details about the first search result of a specific item in the Auction House. + +```typescript +// Define the item key for the item of interest +const myItemKey = { + itemID: 12345, // Example item ID + itemLevel: 0, + itemSuffix: 0, + battlePetSpeciesID: 0, +}; + +// Assume a search has already been performed using C_AuctionHouse.Search +// Now, we retrieve information about the first search result of the specified item +const itemSearchResultIndex = 0; // Index of desired search result +const itemInfo = C_AuctionHouse.GetItemSearchResultInfo(myItemKey, itemSearchResultIndex); + +if (itemInfo) { + console.log(`Item Name: ${itemInfo.itemName}`); + console.log(`Current Bid: ${itemInfo.bidAmount}`); + console.log(`Buyout Price: ${itemInfo.buyoutAmount}`); + // Further processing can be done here as needed +} else { + console.log(`Information for the specified item could not be retrieved.`); +} +``` + +In this example, we create an `ItemKey` representing the unique ID of an item. After performing a search with `C_AuctionHouse.Search()`, we use `GetItemSearchResultInfo` to fetch details about the first result for this item key. Finally, the script logs information about the item, such as its name, current bid amount, and buyout price, to the console. + +--- + +### Additional Notes + +- Make sure that a search has been performed using `C_AuctionHouse.Search()` prior to calling `GetItemSearchResultInfo`, otherwise, the result index will not correlate to any item. +- The index provided to `GetItemSearchResultInfo` should be within the bounds of the number of results returned by the last search operation for the given item key. + +Given the structure and style shown for documenting TypeScript class methods for use with AIO plugins similar to World of Warcraft AddOns, let's document the `C_AuctionHouse.GetItemSearchResultsQuantity` method in a similar fashion. + +```markdown +# C_AuctionHouse.GetItemSearchResultsQuantity + +This method returns the quantity of items found in the auction house for the specified item key. + +## Parameters + +**itemKey** `ItemKey` - An object representing the key of the item to search for in the Auction House. The `ItemKey` object typically includes properties that uniquely identify an item, such as `itemID`, `itemLevel`, and other relevant identifiers. + +## Returns + +**number** - The number of items found in the Auction House search results that match the given item key. + +## Example Usage: + +```typescript +import { C_AuctionHouse, ItemKey } from 'wow-addon-framework'; + +// Define the item key for the item you want to search in the Auction House +const itemToSearch: ItemKey = { + itemID: 12345, // Example itemID + // Add other identifying properties as needed +}; + +// Fetch the quantity of search results for the specified item key +const quantity = C_AuctionHouse.GetItemSearchResultsQuantity(itemToSearch); + +console.log(`${quantity} items found in the Auction House.`); +``` + +This example details how to use `C_AuctionHouse.GetItemSearchResultsQuantity` to determine the quantity of a specific item in the Auction House. The `itemKey` object is constructed with the necessary identifiers for the item in question, which is then passed to the `GetItemSearchResultsQuantity` method to retrieve the number of items found in the search results. + +### See Also + +- [API C_AuctionHouse.GetItemSearchResults](https://wow.gamepedia.com/API_C_AuctionHouse.GetItemSearchResults) for fetching the list of items matching the search criteria. +- [Creating and Using ItemKeys](https://wow.gamepedia.com/ItemKey) for more information on identifying items in World of Warcraft API. +``` + +This documentation follows the provided example, detailing the parameters, return types, and providing a sample code snippet for practical application. The inclusion of "See Also" links helps developers find related information, enhancing the usability of the documentation. + +Based on the structured documentation format provided in your examples, here's how you could document the `C_AuctionHouse.GetMaxBidItemBid` method in markdown for AIO plugin or WoW AddOn development, referencing the World of Warcraft API as per the guidelines: + +--- + +## GetMaxBidItemBid + +This method retrieves the maximum bid amount that the player has placed on an item in the Auction House. If the player has not placed any bids, the method returns `null`. + +### Returns +- **number** - The highest bid amount placed by the player on an item in the Auction House. +- **null** - If the player has not placed a bid on any item. + +### Usage Example + +To check for the player's highest bid on an auctioned item and inform them via a UI element or chat message, you can use the `GetMaxBidItemBid` method as follows: + +```typescript +// Assume you have a class or functionality to interact with WoW's UI or Chat +class AuctionHelper { + informPlayerOfMaxBid() { + const maxBid = C_AuctionHouse.GetMaxBidItemBid(); + + // Check if the player has placed any bids yet + if(maxBid === null) { + this.showMessage("You have not placed a bid on any auctioned items."); + } else { + this.showMessage(`Your maximum bid on an item is: ${maxBid} gold.`); + } + } + + // Dummy method to showcase message display (this could be an actual implementation detailing how messages are shown in-game) + showMessage(message: string) { + console.log(message); // For the sake of the example, we are just logging to the console. + } +} + +// Usage +const auctionHelper = new AuctionHelper(); +auctionHelper.informPlayerOfMaxBid(); +``` +This example assumes the existence of a `AuctionHelper` class that could be part of an Auction-related addon. It showcases how to utilize the `GetMaxBidItemBid` method to obtain the player's highest bid amount. It then displays this information, aiding in scenarios where players may want to track their auction activities or be reminded of their current financial commitments in the WoW Auction House. + +--- + +This documentation format not only provides a clear understanding of what the method does but also offers a practical example of how it could be utilized within an addon, enhancing the user's ability to engage effectively with the Auction House system in World of Warcraft. + +Certainly! To convert the method information for `C_AuctionHouse.GetMaxBidItemBuyout` into markdown documentation similar to the examples above, we can follow this structure: + +# C_AuctionHouse.GetMaxBidItemBuyout + +Retrieves the maximum bid item buyout at the auction house. This method checks the currently listed items and figures out the highest buyout price among them. Useful for addon developers looking to analyze the auction house economy or implement features based upon the fluctuating market values. + +### Returns +**number | null** - The highest buyout price for an item. If there are no items with a buyout price available, returns `null`. + +### Example Usage: + +This example demonstrates how to get the maximum buyout price of the currently listed items in the auction house. It showcases a basic usage where the retrieved value could be used for displaying or further calculations within an AddOn. + +```typescript +// Assuming the C_AuctionHouse API is accessible + +// Function to fetch and display the highest buyout price +function displayMaxBidItemBuyout() { + const maxBuyout = C_AuctionHouse.GetMaxBidItemBuyout(); + + if(maxBuyout !== null) { + console.log("The highest buyout price in the Auction House is: " + maxBuyout + " gold."); + } else { + console.log("There are currently no items with a buyout price."); + } +} + +// Call the function to display the max buyout price +displayMaxBidItemBuyout(); +``` + +This code snippet will output to the console the highest buyout price if available, or a message indicating that no items have a buyout price currently. + +**Note**: It is always important to consider server refresh rates and auction house data latency when using such methods, as in-game market data can change rapidly. + +### Additional Notes + +- This method is particularly useful for economic analysis or addon features that rely on auction house data. +- Remember, the returned value is in the in-game currency's smallest unit (copper), even though the example console logs it as "gold" for simplicity. +- Due to the nature of WoW's dynamically changing economy, repeated calls to this method could yield different results based on current auction house listings. + +## Inline Code Comment +[See WoW Gamepedia for more details](https://wow.gamepedia.com/API_C_AuctionHouse.GetMaxBidItemBuyout) + +To document the method `GetMaxCommoditySearchResultPrice` of the class `C_AuctionHouse`, following the style provided, you could structure the documentation in this way: + +```markdown +# C_AuctionHouse.GetMaxCommoditySearchResultPrice +Retrieves the maximum commodity price for a given item in the auction house. This is essential for addons that seek to provide players with insights on market trends or for those looking to automate auction house trading strategies. + +## Parameters +- **itemID** _number_ - The unique identifier for the item whose maximum commodity search result price is to be retrieved. + +## Returns +**number | null** - The maximum price of the listed item in the auction house. Returns `null` if the item is not found or if there's an error in fetching the price information. + +### Example Usage: +To utilize `GetMaxCommoditySearchResultPrice`, you might write a function within your addon that alerts you if a particular commodity's maximum price drops below a certain threshold. Below is an example implementation: +```typescript +const itemId = 12345; // Example Item ID for which the max price is checked +const priceThreshold = 100000; // Set a threshold price + +function checkCommodityPriceThreshold() { + const maxPrice = C_AuctionHouse.GetMaxCommoditySearchResultPrice(itemId); + + if (maxPrice === null) { + console.error(`Could not retrieve price for item ID: ${itemId}`); + return; + } + + if (maxPrice < priceThreshold) { + console.log(`Alert: The max price of item ID ${itemId} has dropped below ${priceThreshold}! Current max price: ${maxPrice}`); + } else { + console.log(`The max price of item ID ${itemId} is above your threshold. Current max price: ${maxPrice}`); + } +} + +// Execute the function to check the price +checkCommodityPriceThreshold(); +``` +This script checks the current maximum price for a specified item ID against your set threshold and logs a message accordingly. It's a straightforward yet powerful way to keep track of commodity prices that matter to your game strategy or economic endeavors within WoW. + +[See more about this API](https://wow.gamepedia.com/API_C_AuctionHouse.GetMaxCommoditySearchResultPrice) +``` + +This markdown documentation provides a clear description of the method, its parameters, return type, and a practical example illustrating how it might be used within an addon context. The link at the end ensures that users can find more detailed information on the official WoW API page if needed. + +# GetMaxItemSearchResultBid + +This method retrieves the maximum bid amount for an item in the auction house search results. + +## Parameters + +- **itemKey**: `ItemKey` - The unique identifier for the item in question. + +## Returns + +- `number | null` - The maximum bid amount for the item, or `null` if no bids are found. + +## Usage Example + +In this example, we're querying the auction house for the maximum bid on a specific item. To use this method, first, we need to construct an `ItemKey` object, which uniquely identifies the item in the auction house. After obtaining the `ItemKey`, we call `GetMaxItemSearchResultBid` to find out the highest bid made for this item. + +### Step 1: Constructing an ItemKey + +The `ItemKey` object typically includes the `itemID`, `itemLevel`, and other properties that uniquely identify an item. In this example, we'll focus on the `itemID`. + +```typescript +// Assuming an itemID for the example +const exampleItemID = 12345; // Example itemID for demonstration + +// Constructing an ItemKey object +let itemKey: ItemKey = { + itemID: exampleItemID, + itemLevel: 0, // Using 0 for simplicity, real usage may vary + // Additional properties can be added as necessary +}; +``` + +### Step 2: Using GetMaxItemSearchResultBid + +Once we have our `ItemKey`, we can use it to query the maximum bid for this item in the auction house. + +```typescript +// Assuming C_AuctionHouse is available and initialized +const maxBid = C_AuctionHouse.GetMaxItemSearchResultBid(itemKey); + +if (maxBid !== null) { + console.log(`The maximum bid for itemID ${itemKey.itemID} is: ${maxBid}`); +} else { + console.log(`No bids found for itemID ${itemKey.itemID}.`); +} +``` + +In this example, we're directly querying the maximum bid amount using `GetMaxItemSearchResultBid` and logging the result. If a bid exists, it will print the maximum bid amount; otherwise, it will indicate that no bids were found. Remember to handle the possibility of `null` for items without any bids. + +This method is helpful for addons focusing on auction house data, allowing developers to track item popularity, investment opportunities, or simply to inform players of the current market status for specific items. + +Based on the example provided for documenting TypeScript class methods, here is how you can document the `C_AuctionHouse.GetMaxItemSearchResultBuyout` method in Markdown format: + +```markdown +# GetMaxItemSearchResultBuyout + +This method retrieves the maximum buyout price for all search results matching a specific item. + +### Parameters +- **itemKey**: `ItemKey` - The key representing the item for which to find the maximum buyout price in the Auction House. + +### Returns +- `number` | `null` - The maximum buyout price of the item if available, otherwise `null` if there's no such item or error. + +### Example Usage +The following example demonstrates how to use the `GetMaxItemSearchResultBuyout` method to retrieve the maximum buyout price for a specified item in the auction house and handle the result appropriately. + +```typescript +// Assume we have an item key representing the item of interest +const myItemKey = { + itemID: 12345, // Example Item ID + itemLevel: 0, + itemSuffix: 0, + battlePetSpeciesID: 0 +}; + +// Retrieve the maximum buyout price for the specified item +// It's important to handle the possibility of a null return, indicating no buyout price was found +const maxBuyoutPrice = C_AuctionHouse.GetMaxItemSearchResultBuyout(myItemKey); + +if (maxBuyoutPrice !== null) { + console.log(`The maximum buyout price for the item is: ${maxBuyoutPrice}`); +} else { + console.error('No maximum buyout price found for the specified item.'); +} +``` + +The example uses a fictional API to demonstrate handling of both successful retrieval of the buyout price and cases where no price is found (`null` is returned). Make sure to adapt the item key structure and method call as per the actual usage in your project. + +### Documentation Notes +- This method is part of the `C_AuctionHouse` class which interacts with the in-game Auction House feature. +- Care should be taken to handle `null` scenarios where the item might not be present in the Auction House at the moment of inquiry. +- The `ItemKey` structure used as an input should be properly constructed to match the specific item in question. Incorrect item keys will likely result in a `null` return value. + +For further details, refer to the [official documentation](https://wow.gamepedia.com/API_C_AuctionHouse.GetMaxItemSearchResultBuyout). +``` + +When documenting APIs or methods such as this, it's crucial to clearly describe the method's purpose, parameters, return type, and provide an example usage to help users understand how to use it effectively. Additionally, linking to official documentation or further resources when available is a good practice for comprehensive understanding. + +Certainly! Here is a structured documentation format for the `C_AuctionHouse.GetMaxOwnedAuctionBid` method based on the provided TypeScript class method example, tailored for an AIO plugin development readme documentation. + +--- + +# C_AuctionHouse.GetMaxOwnedAuctionBid + +Returns the highest bid amount on auctions you currently have. + +## Parameters + +None + +## Returns + +- **highestBid** `number | null` - The highest bid amount on player's auctions or `null` if the player has no bids. + +## Example Usage + +Below is an example of how to use `GetMaxOwnedAuctionBid` to check the highest bid the player has on their auctions. This can be useful for monitoring auction activity programmatically within an addon. + +```typescript +// Initialize the Auction House system +C_AuctionHouse.Init(); + +// Function to fetch and display the highest bid on player's auctions +function showMaxOwnedAuctionBid() { + const maxBid = C_AuctionHouse.GetMaxOwnedAuctionBid(); + + if (maxBid !== null) { + // If there is at least one bid on player's auctions, display it + console.log(`The highest bid on your auctions is: ${maxBid} gold.`); + } else { + // When there are no bids on player's auctions + console.log("You currently have no bids on your auctions."); + } +} + +// Call the function to display the highest auction bid +showMaxOwnedAuctionBid(); +``` + +This simple example demonstrates how to interact with the `C_AuctionHouse.GetMaxOwnedAuctionBid` API to retrieve and use auction data within an addon. It's crafted for easy integration into any larger addon system that aims to leverage auction house data for various features. + +--- + +Following this format ensures that each method documentation within your readme is consistent, straightforward, and provides utilized information not just for developers but also for users who may be interested in the technical workings of an addon. This way, the method's purpose, usage, and return values are clearly outlined, accompanied by a practical example that showcases the method in action. + +To document the `C_AuctionHouse.GetMaxOwnedAuctionBuyout` method from World of Warcraft API in a way that is coherent with the style you provided, here's a markdown documentation example that captures the essence of the method based on its functionality, parameters, and return values: + +```markdown +# C_AuctionHouse.GetMaxOwnedAuctionBuyout + +Returns the highest buyout price for auctions currently owned by the player. If the player does not own any auctions, or none have a buyout price, returns null. This is useful for addon developers when implementing features related to the Auction House, particularly for those focused on tracking auction statistics or optimizing auction listings. + +## Returns + +**Type**: number | null + +- **number**: The highest buyout price among all auctions owned by the player. +- **null**: Returned if the player owns no auctions with a buyout price. + +## Example Usage + +The following example demonstrates how to retrieve the maximum owned auction buyout and handle the case where it might be `null`. This is particularly useful for addons that need to display or analyze the player's auction data. + +```typescript +// Attempt to retrieve the highest buyout price of the player's auctions. +const maxBuyout = C_AuctionHouse.GetMaxOwnedAuctionBuyout(); + +// Check if the player has auctions with a buyout price. +if(maxBuyout !== null) { + // Player has auctions with a buyout price, process or display the amount. + console.log(`The highest buyout price for your auctions is: ${maxBuyout}`); +} else { + // Player does not own any auctions with a buyout price. + console.log("You do not own any auctions with a buyout price."); +} +``` + +This method does not take any parameters and returns either a number representing the highest buyout price of the player's auctions or `null` if no auctions have a buyout price or if the player does not own any auctions. + +## Note + +This method is useful for addon developers focusing on creating features for the Auction House. It provides a straightforward approach to retrieving the maximum buyout price without needing to manually iterate through all owned auctions. It's important to handle the `null` return case to avoid errors in addons when the player has no relevant auctions. + +--- +For more information on the Auction House API, you can refer to the official World of Warcraft API documentation at [https://wow.gamepedia.com/API_C_AuctionHouse.GetMaxOwnedAuctionBuyout](https://wow.gamepedia.com/API_C_AuctionHouse.GetMaxOwnedAuctionBuyout). +``` + +This template provides a concise yet detailed documentation format that captures the important aspects of the method, its usage, and handling of its return values, fitting well into a broader documentation collection for World of Warcraft addon development. + +### C_AuctionHouse.GetNumBidTypes + +This method retrieves the number of different bid types available in the Auction House at the current moment. + +#### Returns +**number** - The number of bid types currently available. + +#### Example Usage: +This example demonstrates how to fetch the total number of bid types from the Auction House and log this number. This can be useful in scripts or addons that need to iterate through bid types or conditions when dealing with Auction House data. + +```typescript +// Assuming 'C_AuctionHouse' is properly instantiated or available within your addon environment. + +const numBidTypes = C_AuctionHouse.GetNumBidTypes(); + +// Logging the count of bid types to the console. +console.log(`There are ${numBidTypes} bid types available in the Auction House.`); +``` + +The above example utilizes the `C_AuctionHouse.GetNumBidTypes()` method to fetch the current number of bid types that can be made in the Auction House. This information can be crucial for addons that interact with Auction House data, particularly those that may analyze or manipulate bids in any capacity. Obtaining such counts enables developers to loop through bids of various types or to provide informative statistics to the user about the current state of the Auction House. + +### Documentation Notes + +When documenting a method like `C_AuctionHouse.GetNumBidTypes`, it's essential to provide a clear and concise description of what the method does, including any direct effects or return values it may have. In addition to this, providing an example usage snippet can significantly enhance understandability, allowing users or other developers to grasp the method's application more rapidly. The example should be practical and close to real-world use cases to make it as beneficial as possible. + +## C_AuctionHouse + +This section covers the `C_AuctionHouse` class within the World of Warcraft API, focused specifically on the `GetNumBids` method which is a part of AIO plugins similar to World of Warcraft AddOns. + +### `GetNumBids` + +Retrieves the number of bids that the player has placed in the Auction House. + +#### Syntax: + +```typescript +GetNumBids(): number; +``` + +#### Returns + +`number` - The number of bids the player has made. + +#### Example Usage: + +This example showcases how to utilize the `GetNumBids` method to check the number of bids a player has made in the Auction House. This could be useful for creating AddOns that help with auction management or just generally keeping track of one's bidding activity without needing to manually count or check each bid. + +```typescript +// Assume this is within the context of an AddOn or a script where you're interacting with the WoW API. + +// Call the GetNumBids method from the C_AuctionHouse class. +const numberOfBids = C_AuctionHouse.GetNumBids(); + +// Log the number of bids to the console or display it in the game UI. +console.log(`You have currently made ${numberOfBids} bids in the Auction House.`); + +// Alternatively, you can use this information to display a message in-game, +// or to decide on further actions based on the number of current bids. +if (numberOfBids > 0) { + // Functionality that alerts the user or takes some action based on the bids. + alertPlayerAboutBids(numberOfBids); +} else { + // Maybe notify the player that they have no current bids, or encourage more auction activity. + encourageMoreBidding(); +} +``` + +In the example above, `C_AuctionHouse.GetNumBids()` is used to retrieve the total number of bids the player has made at the Auction House. This can aid in creating a more interactive and informed experience for users, making it easier to track and manage their auction activities directly from their UI without needing to navigate through multiple Auction House screens. + +# C_AuctionHouse.GetNumCommoditySearchResults + +This method is part of the World of Warcraft API for interacting with the Auction House within the game. + +## Description + +`GetNumCommoditySearchResults` retrieves the number of search results for a specific commodity item in the Auction House. A commodity in World of Warcraft (WoW) refers to consumable items or materials that players can buy and sell. This function is designed to assist in getting the available quantity of a particular item, simplifying the process of deciding whether to list a similar item or purchase available ones for crafting or resale. + +## Parameters + +- **itemID**: `number` - The unique identifier for the item. Each item in World of Warcraft has an ID assigned that can be used to reference it. + +## Returns + +- `number`: Returns the number of search results found for the specified `itemID` in the Auction House. + +## Example Usage + +In this example, we're checking the quantity of a popular commodity, such as Sumptuous Fur (item ID: 111557), available in the Auction House. This would be useful for crafters who need this material for creating items, or for players who are considering listing their own stock of Sumptuous Fur for sale. + +```typescript +// Assuming the item ID for Sumptuous Fur is 111557. +const itemID = 111557; + +// Retrieve the number of Sumptuous Fur available in the Auction House. +const numResults = C_AuctionHouse.GetNumCommoditySearchResults(itemID); + +console.log(`There are currently ${numResults} Sumptuous Fur available in the Auction House.`); + +// Based on the number of results, one might decide to buy Sumptuous Fur for crafting or list their own based on supply. +if (numResults > 100) { + console.log("There's plenty of Sumptuous Fur in the Auction House. Prices might be low."); +} else { + console.log("Sumptuous Fur seems to be in short supply. It could be a good time to sell."); +} +``` +This script could be used within an add-on or a macro to help players make more informed decisions about buying and selling commodities in World of Warcraft's Auction House. It utilizes the `C_AuctionHouse.GetNumCommoditySearchResults` method to fetch real-time data regarding specific items' availability. + +Below, I'm providing a markdown example for the documentation of the `GetNumItemSearchResults` method from the `C_AuctionHouse` class, correlating to your guidelines and the template used in the previous examples: + +--- + +## GetNumItemSearchResults + +This method retrieves the number of search results for a particular item in the Auction House. + +### Parameters +- **itemKey**: `ItemKey` - A key representing the item to search for in the Auction House. + +### Returns +- **number** - The number of available auction listings for the specified item. + +### Example Usage + +The following example demonstrates how to use the `GetNumItemSearchResults` method to find out how many auctions are currently listed for a particular item. This could be useful for addons that track the availability and pricing of items in the Auction House. + +```typescript +// Declare an example item key +const exampleItemKey = { + itemID: 12345, // An example Item ID, replace with a real one + itemLevel: 0, + itemSuffix: 0, + battlePetSpeciesID: 0 +}; + +// Use the C_AuctionHouse class to query the number of auction search results +const numResults = C_AuctionHouse.GetNumItemSearchResults(exampleItemKey); + +console.log(`There are ${numResults} auction(s) for the specified item.`); + +// Additional logic could be added here to handle the results, such as analyzing the market or alerting the user +``` + +### Notes +- It is important to correctly define the `itemKey` parameter, as it determines which item's auction listings are counted. +- This method is part of the Auction House system and only works when the Auction House UI is open, or you have accessed it recently. Otherwise, it might return incorrect data or need a UI refresh. +- Handle the returned number carefully, especially if making decisions based on the availability of items in the auction house. + +### See Also +- [C_AuctionHouse.SearchForItem](https://wowpedia.fandom.com/wiki/API_C_AuctionHouse.SearchForItem) - For initiating a search for an item in the Auction House. +- [ItemKey structure](https://wowpedia.fandom.com/wiki/ItemKey) - For understanding the structure of the `itemKey` parameter used in auction house APIs. + +--- + +This template establishes a consistent approach to documenting World of Warcraft addon APIs and functions akin to the examples provided, facilitating clarity and ease of reference for developers engaged in addon development. + +### GetNumOwnedAuctionTypes +This method returns the number of auction types that the player currently has active in the Auction House. + +#### Parameters +None + +#### Returns +**number** - The number of auction types owned by the player. + +#### Example Usage: +```typescript +/** + * Fetch the total number of auction types owned by the player. + * This can include different item categories or auction durations. + */ +function fetchOwnedAuctionTypesCount() { + const count = C_AuctionHouse.GetNumOwnedAuctionTypes(); + console.log(`You currently have ${count} different types of auctions posted.`); +} + +// Execute the function to fetch and log the count. +fetchOwnedAuctionTypesCount(); +``` + +In this example, `fetchOwnedAuctionTypesCount` is a function that calls the `C_AuctionHouse.GetNumOwnedAuctionTypes` method to get the number of auction types a player has active. It then logs this information to the console. This could be useful for players or addons focusing on tracking auction activity without needing to manually count different auction types through the UI. + +Based on the provided examples and formatting style, here is how you might document the `C_AuctionHouse.GetNumOwnedAuctions` method in markdown format for creating comprehensive readme documentation for a plugin or addon in the context of AzerothCore, Eluna, or similar systems. + +--- + +## C_AuctionHouse.GetNumOwnedAuctions + +This method retrieves the total number of auctions currently owned by the player in the Auction House interface. + +### Usage + +```typescript +/** + * Retrieves the count of auctions currently owned by the player. + * + * @see https://wow.gamepedia.com/API_C_AuctionHouse.GetNumOwnedAuctions + * + * @returns number The number of auctions currently owned by the player. + */ +function GetNumOwnedAuctions(): number; +``` + +### Returns + +- **number**: Returns the total number of auctions owned by the player at the Auction House. + +### Example Usage + +This small snippet demonstrates how to use the `GetNumOwnedAuctions` method to get the number of auctions owned by the player and display it in the game's chat window. + +```typescript +// Assuming C_AuctionHouse is already available in the current scripting context + +// Fetch the number of auctions owned by the player +const ownedAuctionsCount = C_AuctionHouse.GetNumOwnedAuctions(); + +// Display the count in the default chat frame +print("You currently own " + ownedAuctionsCount + " auctions in the Auction House."); + +``` + +In this example, the `print` function is used to output the result directly into the default chat frame of the game's UI. It allows the player to see how many auctions they currently have active without needing to manually check the Auction House interface. + +### Notes + +- This method is particularly useful for addon developers looking to provide players with quick insights or alerts related to their Auction House activities. +- Keep in mind the game's API documentation can undergo changes, and it's good practice to check the official or fan-maintained WoW API documentation for the most up-to-date information. + +To create a markdown documentation for the `C_AuctionHouse.GetNumReplicateItems` method based on the given instructions and examples, here’s a formatted documentation snippet: + +--- + +## C_AuctionHouse.GetNumReplicateItems + +This method retrieves the total number of items that have been replicated from the server's auction house to the client, for the current search query or filter. It is typically used after sending a query to the auction house to understand how many items are available to be iterated over or displayed. + +### Parameters +None + +### Returns +**number** - The total number of items available from the last auction house query made. + +### Example Usage: + +In this example, we will make a query to the auction house to search for items and then use the `GetNumReplicateItems` method to find out how many items are available. + +```typescript +// Assuming 'QueryAuctionItems' is a method that sends a query to the auction house +// and we're inside an async function since auction house operations could be asynchronous. + +// Send a query to the auction house for all items with the word "Potion" in their name +await QueryAuctionItems("Potion"); + +// Once the query is complete, get the number of items available +let numItems = C_AuctionHouse.GetNumReplicateItems(); + +console.log(`Total items found: ${numItems}`); +``` + +In this example, the `QueryAuctionItems` is a hypothetical method used to query the auction house. In a real scenario, you would use the appropriate World of Warcraft API method to query the auction house. After querying, `GetNumReplicateItems` retrieves the number of items matching the query, allowing you to process or display them accordingly. + +### Notes + +- Make sure that your query to the auction house has completed before calling `GetNumReplicateItems`. In a synchronous flow, you might need to wait for an event indicating the completion of the auction house data replication to the client. +- The number of items returned by `GetNumReplicateItems` reflects the total count available in the client's current auction house snapshot, which is affected by the filters and search terms applied. + +### See Also + +- [C_AuctionHouse.QueryAuctionItems](https://wow.gamepedia.com/API_C_AuctionHouse.QueryAuctionItems) for querying the auction house. + +--- + +This documentation snippet provides a detailed description of the `GetNumReplicateItems` method, including an example of how to use it in a practical scenario, which can be helpful for developers working on addons similar to World of Warcraft AddOns. + +Certainly! Here's how you would document the `C_AuctionHouse.GetOwnedAuctionInfo` method for an addon or plugin readme documentation, following the format and styles from the previous example: + +## GetOwnedAuctionInfo + +This method retrieves details about an auction owned by the player in the Auction House. + +### Parameters + +**ownedAuctionIndex** `number` - The index of the auction in the list of player-owned auctions. This index ranges from 1 to the total number of owned auctions, as returned by some other Auction House API function. + +### Returns + +`OwnedAuctionInfo | null` - Returns an object containing details about the auction if successful, `null` otherwise. + +**OwnedAuctionInfo** includes: +- **itemID**: `number` - The ID of the item being auctioned. +- **bidAmount**: `number` - The current bid amount on the auction. +- **buyoutAmount**: `number` - The buyout price of the auction. +- **quantity**: `number` - The quantity of the item being auctioned. +(Additional fields can be documented based on actual API response) + +### Example Usage: + +Using this method, you can obtain information about an auction item that you have listed in the Auction House. For example, checking details of the first listed item: + +```typescript +const ownedAuctionIndex = 1; // Example index +const auctionInfo = C_AuctionHouse.GetOwnedAuctionInfo(ownedAuctionIndex); + +if (auctionInfo) { + console.log(`Item ID: ${auctionInfo.itemID}`); + console.log(`Current Bid: ${auctionInfo.bidAmount}`); + console.log(`Buyout Amount: ${auctionInfo.buyoutAmount}`); + console.log(`Quantity: ${auctionInfo.quantity}`); + + // Additional processing based on the auction info +} else { + console.log(`No information found for auction at index ${ownedAuctionIndex}`); +} +``` + +This example will log the details of the player's first auction (if any) to the console. It demonstrates how to safely check for null responses and access the properties of the `OwnedAuctionInfo` object. + +**Note**: Always ensure to handle the possibility of a `null` return value to avoid runtime errors in your addon, particularly in scenarios where the specified auction might no longer exist or the index provided is invalid. + +To create a markdown documentation for the `C_AuctionHouse.GetOwnedAuctionType` method based on the given instructions and examples, and taking inspiration from World of Warcraft API documentation as well as TypeScript class conversion to documentation, the resulting documentation might look like this: + +--- + +# C_AuctionHouse.GetOwnedAuctionType + +Retrieves the type of auction owned by the player based on the provided index. + +## Parameters + +- **ownedAuctionTypeIndex** number - The index of the owned auction to query. + +## Returns + +**ItemKey** or **null** - Returns an `ItemKey` object if an auction is found at the specified index; otherwise, it returns `null`. + +## Example Usage + +To use the `C_AuctionHouse.GetOwnedAuctionType` method, you first need to determine the index of the owned auction you're interested in. This example demonstrates how to query the type of the first owned auction (if any) and then use the returned `ItemKey` to do further operations or checks. + +```typescript +// Assume we're interested in the first owned auction. +const ownedAuctionTypeIndex = 0; + +// Attempt to get the auction type for the first owned auction. +const auctionType = C_AuctionHouse.GetOwnedAuctionType(ownedAuctionTypeIndex); + +if (auctionType !== null) { + console.log("Auction Type Found:"); + console.log(`Item ID: ${auctionType.itemID}`); + console.log(`Item Type: ${auctionType.itemType}`); +} else { + console.log("No owned auction found at the specified index."); +} +``` + +### Note + +Ensure you're familiar with the structure and properties of the `ItemKey` object to effectively use the information returned by the `GetOwnedAuctionType` method. This method is particularly useful for addons that interact with the auction house, enabling developers to query and interact with auctions owned by the player. + +For more detailed information on other auction house operations, refer to the World of Warcraft API documentation. + +--- + +This style maintains consistency with documentation practices observed in World of Warcraft's API documentation, providing clear and succinct information on usage, parameters, return values, and an example to illustrate practical application. + +Based on the provided guidelines and example formats, here's how you would document the `C_AuctionHouse.GetQuoteDurationRemaining` method in markdown format suitable for readme documentation: + +--- + +## C_AuctionHouse.GetQuoteDurationRemaining + +This method returns the remaining duration (in seconds) for the current auction house price quote. This is particularly useful for determining how much time is left before the quote expires and a new quote must be fetched to ensure accurate auction house operations. + +### Parameters +None + +### Returns +**number** - The number of seconds remaining before the current auction house price quote expires. + +### Example Usage: +```typescript +// Assuming there's an existing auction house quote, fetch the remaining duration for it. +const remainingDuration = C_AuctionHouse.GetQuoteDurationRemaining(); + +// Output the remaining time in a human-readable format. +console.log(`Quote's remaining duration: ${remainingDuration} seconds`); + +// Conditional logic based on the remaining duration. +if(remainingDuration <= 0) { + console.log("The quote has expired. Fetching a new quote..."); + // Implement the logic to fetch a new quote here. +} +else { + console.log("The quote is still valid."); +} +``` + +### Note: +- It's important to continuously monitor the quote duration if your addon involves real-time auction house operations. +- The auction house API, including quote durations, can be affected by server latency and auction house activity, so it's recommended to fetch new quotes well before the previous one expires. + +### See Also +- [C_AuctionHouse.RequestNewQuote](https://wow.gamepedia.com/API_C_AuctionHouse.RequestNewQuote) for fetching new price quotes for auction house operations. + +--- + +This template follows the structure provided in the examples, offering a clear and informative description, parameters section (if needed), the datatype of the return value, an example usage to demonstrate how the method could be utilized practically, and when possible, references to related methods or important notes to bear in mind when using it. + +Creating well-organized documentation for your TypeScript class methods is essential for clear communication with developers who may use your classes. Here's a structured way to document the `C_AuctionHouse.GetReplicateItemBattlePetInfo` method, including the use of Markdown for readability. This documentation style is aimed at ensuring clarity and ease of understanding for anyone who wants to utilize this method within the context of building AIO plugins, similar to World of Warcraft AddOns. + +--- + +## GetReplicateItemBattlePetInfo + +This method retrieves the creature ID and display ID for a battle pet from the auction house's replicated data. + +### Parameters + +- **index** `number`: The index of the item in the auction house listing. + +### Returns + +- **creatureID** `number`: The unique identifier for the creature type of the battle pet. +- **displayID** `number`: The ID used to determine how the battle pet is displayed in-game. + +### Example Usage + +The following example demonstrates how to use the `GetReplicateItemBattlePetInfo` method to retrieve information about a battle pet posted in the auction house. It assumes you are working within the context of an environment where you have access to auction house data, such as an AIO plugin development for World of Warcraft. + +```typescript +class AuctionHouseUtil { + constructor(private auctionHouse: C_AuctionHouse) {} + + public logBattlePetInfo(index: number): void { + // Retrieve the battle pet information + const [creatureID, displayID] = this.auctionHouse.GetReplicateItemBattlePetInfo(index); + + // Log the retrieved information + console.log(`Battle Pet at index ${index} has Creature ID: ${creatureID} and Display ID: ${displayID}`); + } +} + +// Example usage +const auctionHouse = new C_AuctionHouse(); +const util = new AuctionHouseUtil(auctionHouse); +util.logBattlePetInfo(0); // Example: Retrieve information of the first battle pet in the auction house list. +``` + +### See Also + +- [C_AuctionHouse.GetReplicateItemBattlePetInfo API](https://wow.gamepedia.com/API_C_AuctionHouse.GetReplicateItemBattlePetInfo) + +--- + +When documenting your methods, providing a clear description, listing parameters with types, specifying return types, and including a practical example can significantly improve the understanding and usability of your documentation. This approach ensures that other developers can quickly grasp how to use your methods without having to deep dive into the source code. + +Certainly! Here is a detailed documentation for the `GetReplicateItemInfo` method of the `C_AuctionHouse` class tailored to emulate the structure provided in your examples. This method retrieves details about a specific item in the auction house's replicated data. + +## GetReplicateItemInfo + +This method fetches detailed information about an item available in the auction house. It's useful for addon developers who wish to analyze or display auction house data without requiring the user to visit the auction house physically. + +### Parameters + +**index** number - The index of the item in the auction house listing from which to retrieve information. + +### Returns + +The method returns a tuple containing the following information: + +- **name** string|null - The name of the item. +- **texture** number|null - The ID of the item texture. +- **count** number - The stack count of the item. +- **qualityID** number - The quality ID of the item. +- **usable** boolean|null - Indicates if the item is usable. +- **level** number - The required level to use the item. +- **levelType** string|null - The type of level requirement (e.g., character level, item level). +- **minBid** number - The minimum bid for the item. +- **minIncrement** number - The minimum bid increment for the item. +- **buyoutPrice** number - The buyout price of the item. +- **bidAmount** number - The current bid amount on the item. +- **highBidder** string|null - The name of the highest bidder. +- **bidderFullName** string|null - The full name of the highest bidder (with server name, if applicable). +- **owner** string|null - The name of the item's owner. +- **ownerFullName** string|null - The full name of the item's owner (with server name, if applicable). +- **saleStatus** number - The status of the sale (e.g., active, sold). +- **itemID** number - The ID of the item. +- **hasAllInfo** boolean|null - Indicates if all information about the item is available. + +### Example Usage + +Suppose you wish to display information about the first item found in the auction house's replicated data. Here's how you might use the `GetReplicateItemInfo` method: + +```typescript +class C_AuctionHouseExampleUsage { + displayFirstItemInfo() { + const index = 0; // First item in the auction house listing + const itemInfo = C_AuctionHouse.GetReplicateItemInfo(index); + + if (itemInfo) { + const [name, , count, qualityID, , level] = itemInfo; + + console.log(`Item Name: ${name}`); + console.log(`Count: ${count}`); + console.log(`Quality ID: ${qualityID}`); + console.log(`Required Level: ${level}`); + } else { + console.log("Unable to fetch item information."); + } + } +} + +const example = new C_AuctionHouseExampleUsage(); +example.displayFirstItemInfo(); +``` + +This example demonstrates a basic usage scenario where you fetch and log specific details about an item. It is kept reasonably straightforward to focus on the method usage while also covering enough use cases to illustrate its potential applications. + +```markdown +# C_AuctionHouse + +The `C_AuctionHouse` class provides a variety of methods to interact with the auction house functionality in World of Warcraft. Here we document one of its methods, `GetReplicateItemLink`. + +## GetReplicateItemLink + +Retrieves the item link of a replicated auction house item by its index. This can be particularly useful when working with the data returned by a query to the auction house's replicated listings, as it allows the addon to present item links directly to the player. + +### Parameters + +- **index**: `number` - The index of the item in the replicated list whose link is being retrieved. + +### Returns + +- A `string` representing the item link if successful, otherwise `null`. + +### Example Usage + +To use `GetReplicateItemLink`, we first might query the auction house for its replicated items, and then use the index of an item of interest to obtain its link. Although the initial query part is not shown here, the use of `GetReplicateItemLink` is straightforward once you have an item index. + +Consider we have an item index `5`, and we want to get the link for this item to display it in a chat frame or use it in some other UI element. + +```typescript +// Assuming '5' is the index of the item in the replicated auction data +const itemIndex = 5; + +const itemLink = C_AuctionHouse.GetReplicateItemLink(itemIndex); + +if (itemLink) { + // If the item link was successfully retrieved, we can now use it + // For demonstration, we print it to the default chat frame + console.log(`Item link: ${itemLink}`); +} else { + // Handle the situation where no link could be retrieved, + // which might happen if the index is invalid or other reasons. + console.error("Could not retrieve item link from the auction house."); +} +``` + +In this example, if the item link is successfully retrieved, it will be output to the console (or alternatively, it could be displayed to the player in the game UI). If the retrieval fails, an error message is logged to the console. + +### See Also + +For more information on working with the auction house and its API, refer to the official [World of Warcraft API documentation](https://wowpedia.fandom.com/wiki/World_of_Warcraft_API). + +``` + +In creating this documentation snippet, the goal was to illustrate how the `GetReplicateItemLink` method of the `C_AuctionHouse` class can be used, providing clear explanation on its parameter, return value, and a practical example that demonstrates its use in a typical scenario an addon developer might encounter. + +Based on your request, here's a markdown documentation for the `C_AuctionHouse` class with a focus on the `GetReplicateItemTimeLeft` method, tailored similarly to the provided example. + +```markdown +# C_AuctionHouse + +`C_AuctionHouse` provides functions related to the Auction House functionality in World of Warcraft. It is a part of the game's API that allows addon developers to interact with the auction house feature, retrieve item details, and much more. + +## Methods + +### GetReplicateItemTimeLeft + +Retrieves the remaining time left for an auction item on the auction house's current viewing page. This method is particularly useful when iterating through items on the auction house to understand their time left before the auction ends. + +#### Parameters + +- `index` **number** - The index of the auction item in the current auction house listing view. Indexes start at 1 and can go up to the number of items currently listed on the page. + +#### Returns + +- `number` - The time left for the auction in hours. It corresponds to the constants: `1` for "Short", `2` for "Medium", `3` for "Long", and `4` for "Very Long", which represent the time brackets Blizzard has defined for auction durations. + +#### Example Usage: + +In this example, we query the first item in the auction house listing to find out its time left. + +```typescript +// Ensure to call this function after the AUCTION_HOUSE_SHOW event has fired +// and you've initiated a query that populates the listing. + +const index = 1; // First item in the listing +const timeLeft = C_AuctionHouse.GetReplicateItemTimeLeft(index); + +// Convert time left into a human-readable format +let timeLeftString; +switch (timeLeft) { + case 1: + timeLeftString = "Short (< 2 hours)"; + break; + case 2: + timeLeftString = "Medium (2 - 12 hours)"; + break; + case 3: + timeLeftString = "Long (12 - 48 hours)"; + break; + case 4: + timeLeftString = "Very Long (> 48 hours)"; + break; + default: + timeLeftString = "Unknown"; +} + +console.log(`Time left for item at index ${index}: ${timeLeftString}`); +``` + +This example highlights a basic usage of `GetReplicateItemTimeLeft` method to determine the auction time left for the first item in the auction list. Note that due to gameplay mechanics and API constraints, ensuring the auction listing is populated prior to using this method is crucial for receiving accurate data. +``` + +Note: Remember that actual usage and interaction with the game's API can vary based on game updates, and the provided example might need adjustments based on the current API version and functionality. + + +```markdown +# C_AuctionHouse + +The `C_AuctionHouse` class provides methods related to the auction house functionality in World of Warcraft. One of such methods is `GetTimeLeftBandInfo`, which helps in understanding time-related details for auction items. + +## GetTimeLeftBandInfo + +Retrieve time left information based on the predefined time left bands for auction items. + +### Parameters + +**timeLeftBand** (`AUCTION_TIMELEFT`) - The specific time left band for which you want to retrieve information. Possible values include `SHORT`, `MEDIUM`, `LONG`, `VERY_LONG`, corresponding to the predefined time bands. + +### Returns + +- **timeLeftMinSeconds** (`number`) - The minimum amount of time (in seconds) left for this band. +- **timeLeftMaxSeconds** (`number`) - The maximum amount of time (in seconds) left for this band. + +See the official World of Warcraft API documentation for more details: [API C_AuctionHouse.GetTimeLeftBandInfo](https://wow.gamepedia.com/API_C_AuctionHouse.GetTimeLeftBandInfo) + +### Example Usage + +```typescript +// Assuming you're interested in auctions that are about to end soon (SHORT time band). +const AUCTION_TIMELEFT = { + SHORT: 1, // Example Enum value for 'SHORT' + // Other bands could be defined here... +}; + +// Call the method with the 'SHORT' time band. +const [timeLeftMinSeconds, timeLeftMaxSeconds] = C_AuctionHouse.GetTimeLeftBandInfo(AUCTION_TIMELEFT.SHORT); + +// Log the result to see the minimum and maximum seconds an auction item will remain listed in this band. +console.log(`Minimum Seconds: ${timeLeftMinSeconds}, Maximum Seconds: ${timeLeftMaxSeconds}`); +``` + +This method provides a way to understand the range of time an auction item has before it expires based on predefined bands. This can be particularly useful for add-ons focusing on auction house trading, allowing users to make informed decisions based on time left for auctions. +``` + +This formatted documentation provides a clear, informative, and example-inclusive way to understand how to use the `GetTimeLeftBandInfo` method within the `C_AuctionHouse` class for developers interacting with the World of Warcraft auction house through add-ons, similar to the documentation approach for TypeScript class definitions as requested. + +Creating comprehensive and detailed documentation for API methods is essential for developers to effectively utilize and understand them. Following the example provided for the `FontInstance` interface, here's how you could document the `C_AuctionHouse.HasFavorites` method, considering it's a method part of the World of Warcraft API utilized in creating AddOns: + +--- + +## C_AuctionHouse.HasFavorites +This method checks if there are any favorite auctions set in the Auction House. Favorites are specific auctions that the player has marked to easily keep track of certain items or sales. This can be particularly useful for players frequently trading on the Auction House to quickly access their most watched or interesting auctions. + +### Syntax +```typescript +HasFavorites(): boolean; +``` + +### Parameters +None + +### Returns +- **boolean** - Returns `true` if there are favorite auctions set, otherwise returns `false`. + +### Details +- Favoriting auctions is a feature allowing players to mark certain auctions they are interested in. +- This feature is accessible through the Auction House UI in-game but can also be interacted with through the API for more customized control. +- Knowing whether there are favorites can be useful for AddOns that manage auction data, notify the player about specific auction events, or for adding UI elements related to auction management. + +### Example Usage: +Check if the player has set any favorite auctions, and if so, perform an action such as alerting the player or logging for reference. + +```typescript +const hasFavorites = C_AuctionHouse.HasFavorites(); + +if (hasFavorites) { + console.log("You have favorite auctions set."); + // Additional actions can be taken here, such as fetching those favorites + // or alerting the player through the UI. +} else { + console.log("You have no favorite auctions. Consider adding some to quickly access your most watched items."); +} +``` + +### Related Methods +- `SetFavorite`: Marks an auction as a favorite. Requires additional parameters such as the auction ID. +- `RemoveFavorite`: Removes an auction from the favorites. This also requires the auction ID. + +### See Also +- [Auction House Guide](https://wow.gamepedia.com/Auction_House_guide) on Wowpedia + +--- + +In the documentation, it's important to include all relevant sections such as syntax, parameters, returns, details on what the method does, example usages, related methods, and external links for further reading if applicable. This provides a comprehensive overview for developers to effectively understand and use the `C_AuctionHouse.HasFavorites` method in their AddOns or applications. + +Based on your request to document a method from the `C_AuctionHouse` class in a similar manner to the given example for the `FontInstance` interface, here's a documentation snippet that could be used in a README or other markdown documentation: + +# C_AuctionHouse + +The `C_AuctionHouse` class encapsulates a variety of methods related to the auction house functionality within the World of Warcraft UI. + +## HasFullBidResults + +Checks if the auction house has received full bid results from the server. + +### Parameters +None + +### Returns +**boolean** - Returns `true` if full bid results are available, otherwise returns `false`. + +### Example Usage: +This method can be used to determine whether the bid results have been fully loaded by the auction house, which is crucial for addons that manage or display auction house data. + +```typescript +if (C_AuctionHouse.HasFullBidResults()) { + console.log("Full bid results are available."); + // Further actions to process or display the bid results +} else { + console.log("Waiting for full bid results..."); + // Additional logic to handle incomplete data or retry fetching +} +``` + +### Notes: +- It's important to check if full bid results are available before attempting to access or manipulate them to avoid errors or incomplete data handling. +- This method can be particularly useful after placing a bid or when first opening the auction house to ensure the data integrity. + +### Additional Details: +This method corresponds with the Auction House API within World of Warcraft and is essential for addons that interact with or provide enhancements to the Auction House UI. + +#### Related API: +- [`C_AuctionHouse.GetBidResults`](https://wow.gamepedia.com/API_C_AuctionHouse.GetBidResults) - Retrieves a list of current bids. +- [`C_AuctionHouse.QueryBids`](https://wow.gamepedia.com/API_C_AuctionHouse.QueryBids) - Requests bid data from the server. + +--- + +This documentation format provides clear and concise information on the `HasFullBidResults` method within the `C_AuctionHouse` class, including its purpose, usage, and related functionalities. The structured approach with specific sections for parameters, returns, example usage, notes, and related API ensures readability and easy navigation for developers. + +To document the `HasFullBrowseResults` method from the `C_AuctionHouse` class for AIO plugin development similar to World of Warcraft AddOns, you would follow a format like this: + +# C_AuctionHouse.HasFullBrowseResults + +This method checks if the current browse result set from the Auction House is complete. + +## Syntax + +```typescript +function HasFullBrowseResults(): boolean; +``` + +### Returns + +- **boolean** - Returns `true` if the Auction House has full browse results available, otherwise returns `false`. + +## Description + +In the World of Warcraft API, the `C_AuctionHouse.HasFullBrowseResults` method is used by addons to determine whether the current set of browse results is complete. This can be particularly useful when implementing functionality that requires a full dataset to work correctly, such as data analysis, comprehensive searches, or UI enhancements. Generally, this method is called after initiating a search to verify that all items that meet the search criteria have been returned. + +### Usage + +In practical terms, you might check if the Auction House has full browse results after performing a search query. This ensures that your addon only processes or displays data when it's certain that a complete dataset has been received. Here is an example of how it could be used: + +```typescript +// Assume there's a function to search Auction House listings +function searchAuctionHouse(criteria: SearchCriteria): void { + // Code to initiate the search + // ... + + // Check if the search returns full results + if (C_AuctionHouse.HasFullBrowseResults()) { + console.log("Full browse results are available."); + // Proceed with processing or displaying the search results + // ... + } else { + console.log("Browse results are incomplete."); + // Handle incomplete results, e.g., by informing the user + // or retrying the search + } +} + +interface SearchCriteria { + // Define search criteria structure + // ... +} +``` + +### Notes + +- Calling this method before invoking a search or while a search is in progress may yield incorrect results. +- The completeness of browse results can depend on several factors, including server load and the specificity of search criteria. + +### See Also + +- [C_AuctionHouse.Search](https://wow.gamepedia.com/API_C_AuctionHouse.Search) - Function to initiate a search in the Auction House. +- World of Warcraft API documentation on [Wowpedia](https://wowpedia.fandom.com/wiki/World_of_Warcraft_API) for more information on interacting with game elements through scripts. + +This documentation style mirrors the approach taken to describe classes, methods, and their usage as seen in standard programming documentation, tailored to AIO plugins development and the unique context of World of Warcraft AddOns. + +# C_AuctionHouse + +The `C_AuctionHouse` class provides functionality for interacting with the World of Warcraft auction house, allowing players and addons to query and manipulate auction information programmatically. + +## HasFullCommoditySearchResults + +Checks whether the game client currently has full search results for a specific commodity in the auction house. This method can be useful for determining whether to perform a new search or to use the existing data. + +### Parameters + +- **itemID** `number` - The unique identifier for the item (commodity) of interest. + +### Returns + +`boolean` - Returns `true` if the game client has full search results for the specified commodity, otherwise returns `false`. + +### Example Usage + +```typescript +const itemID = 12345; // Example item ID for a commodity + +let hasFullResults = C_AuctionHouse.HasFullCommoditySearchResults(itemID); + +if (hasFullResults) { + console.log("Full commodity search results are available for item ID: " + itemID); +} else { + console.log("Full commodity search results are NOT available for item ID: " + itemID + ". Consider triggering a new search."); +} +``` + +This method is particularly helpful for addons related to the auction house, allowing for efficient data handling and reducing unnecessary search requests by checking the availability of complete search results before initiating a new search query. This can enhance performance and user experience by utilizing available data and avoiding redundant actions. + +For further details about using the auction house API, consult the [official World of Warcraft API documentation](https://wow.gamepedia.com/API_C_AuctionHouse.HasFullCommoditySearchResults). + +## C_AuctionHouse.HasFullItemSearchResults + +This method checks if the Auction House has full item search results available for the queried item. This is valuable for addons that need to know whether all possible auction data for a specific item has been loaded and can be accessed. + +### Parameters + +- **`itemKey`**: `ItemKey` - An object representing the specific item to check search results for. + +### Returns + +- **boolean** - Returns `true` if full item search results are available, otherwise returns `false`. + +### Usage Example + +In this example, we are querying the Auction House to see if full search results are available for a specific item. The `itemKey` object uniquely identifies the item we're interested in. + +```typescript +// First, you need to define or obtain an ItemKey object for the item you're interested in. +// Here, an example ItemKey object is created for illustration purposes. +// Note: Constructing a real ItemKey object will depend on the specific item data you have. + +let itemKey: ItemKey = { + itemID: 12345, // The unique ID of the item + itemType: "Weapon", // The type of the item, e.g., "Weapon", "Armor", etc. + itemSubType: "Sword", // A more specific type of the item, if applicable + itemLevel: 100, // The level of the item + itemQuality: "Epic" // The quality of the item, e.g., "Common", "Uncommon", "Epic", etc. +}; + +// Assuming `C_AuctionHouse` is available and initialized, we can check for full search results. +let hasFullResults = C_AuctionHouse.HasFullItemSearchResults(itemKey); + +if (hasFullResults) { + console.log("Full item search results are available for the queried item."); +} else { + console.log("Full item search results are NOT available yet. Try refreshing or querying later."); +} + +``` + +In this usage example, we demonstrate how to check if full search results for a specific item are available in the Auction House. This can be particularly useful for addons that interact with the Auction House and need to display comprehensive auction data for items. + +### Additional Information + +- The `ItemKey` object is essential for specifying which item you're querying about. This object should include the item's ID, type, subtype, level, and quality at minimum. +- Keep in mind that search results availability can depend on the game's current state, network latency, and the specifics of how Auction House data is loaded and updated. +- Refer to the World of Warcraft API documentation for more details on interacting with the Auction House and understanding the limitations and expectations around auction data retrieval. + +### C_AuctionHouse.HasFullOwnedAuctionResults + +Determines if the Auction House has received the full results for the auctions owned by the player. This is particularly important for checking after querying the Auction House to ensure all data pertaining to the player's auctions has been fully loaded and is ready for processing or display. + +### Returns +**boolean** - Returns `true` if the full results of owned auctions have been received, otherwise `false`. + +### Example Usage: +This example demonstrates how to check if the Auction House has the full results for the player's owned auctions. Upon receiving full results, it proceeds with further operations like listing those auctions with details or performing analysis based on the received data. This is crucial for addon developers who need accurate and complete data to work with. + +```typescript +// Check if we have full auction results for owned auctions +const hasFullResults = C_AuctionHouse.HasFullOwnedAuctionResults(); + +if (hasFullResults) { + // Code to handle the full auction results + console.log("Full owned auction results are available."); + // Fetch the auctions or process them according to your addon's functionality + // For example, an addon might now list these auctions in a custom UI or perform statistical analysis +} else { + console.log("Waiting for full owned auction results..."); + // You might want to set up a retry mechanism or event listener for when the data does become available +} +``` + +In the above example, we first check the availability of the full auction results through `C_AuctionHouse.HasFullOwnedAuctionResults()`. Based on the boolean value returned, we either proceed with further processing - which could include displaying data on a custom UI, fetching detailed auction information, or performing analysis - or log a message indicating the data is not yet ready, where you might consider implementing a retry mechanism or an event listener to notify when the full results are available for processing. + +### Notes: +This method is especially useful after initiating a query to the Auction House for owned auctions, as it ensures that any operation dependent on this data is only executed after all the necessary information has been fully loaded. This helps in avoiding partial data issues and ensures that the addon's functionality related to auction handling is accurate and reliable. + +# C_AuctionHouse Documentation + +The `C_AuctionHouse` class provides various methods to interact with the World of Warcraft Auction House. Below is the detailed documentation of the `HasMaxFavorites` method. + +## HasMaxFavorites + +Checks if the player has reached the maximum number of favorite auctions. + +### Method Signature + +```typescript +HasMaxFavorites(): boolean; +``` + +### Parameters + +None + +### Returns + +- **boolean** - Returns `true` if the player has reached the maximum number of favorite auctions, otherwise `false`. + +### Example Usage: + +This example demonstrates how to use the `HasMaxFavorites` method to check if the player can add more auctions to their favorites. If the maximum is not reached, the script could proceed to add another auction to the favorites. Otherwise, it will alert the player that they have reached the maximum. + +```typescript +class AuctionHouseExample { + /** + * Checks if the player can add more favorite auctions. + */ + public canAddToFavorites(): void { + // Check if the player has reached the max number of favorite auctions + if (C_AuctionHouse.HasMaxFavorites()) { + console.log("You have reached the maximum number of favorite auctions."); + } else { + console.log("You can add more auctions to your favorites."); + // Add logic to add an auction to favorites + } + } +} + +// Example usage +const auctionHouseExample = new AuctionHouseExample(); +auctionHouseExample.canAddToFavorites(); +``` + +This method is useful for UI elements or addons that manage a player's favorite auctions, providing a check to avoid errors or user frustration from trying to add more favorites than allowed. + +Certainly! Let's create detailed documentation for the `HasSearchResults` method within the `C_AuctionHouse` class, based on the template and instructions provided. + +## C_AuctionHouse.HasSearchResults + +Determines if there are search results for a specified item in the Auction House. This method is essential for addons or scripts that interact with the World of Warcraft Auction House, programmatically checking if items are available without manually searching through the Auction House UI. + +### Parameters + +- **itemKey**: `ItemKey` - A structured object that represents the key of the item you are searching for in the Auction House. The `ItemKey` object typically includes fields like `itemID`, `itemLevel`, and `itemSuffix`, among others, depending on the specific item. + +### Returns + +- **boolean** - Returns `true` if the Auction House has search results for the specified item, otherwise `false`. + +### Usage Example + +The following TypeScript code demonstrates how to use the `HasSearchResults` method to check if there are any postings for a specific item in the Auction House. We'll assume `CreateItemKey` is a fictional helper function that simplifies creating `ItemKey` objects based on an item's properties. + +```typescript +import { C_AuctionHouse, ItemKey } from 'some-wow-addon-api'; + +// Example item properties for demonstration +const itemId = 12345; // Unique ID for the item +const itemLevel = 100; // Level of the item +const itemSuffix = 0; // Suffix, if any, for the item + +// Creating an ItemKey for the item we're interested in +const myItemKey: ItemKey = CreateItemKey(itemId, itemLevel, itemSuffix); + +// Checking if there are auction listings for our item +const hasListings = C_AuctionHouse.HasSearchResults(myItemKey); + +if (hasListings) { + console.log("Listings for the specified item exist in the Auction House."); +} else { + console.log("No listings found for the specified item in the Auction House."); +} +``` + +In this example, `CreateItemKey` is a fictional function assumed to exist for the purpose of this illustration; in actual implementation, you would use the specific API provided by the game or addon library to create the `ItemKey` object appropriate for the `HasSearchResults` method. + +### API Reference + +For more detailed information about the `ItemKey` object and other related Auction House APIs, please refer to the [official World of Warcraft API documentation](https://wow.gamepedia.com/API_C_AuctionHouse.HasSearchResults). + +### See Also + +- `[C_AuctionHouse.SearchItems](Link_To_SearchItems_Documentation)` - Initiates a search for items in the Auction House based on specified criteria. +- `[ItemKey](Link_To_ItemKey_Documentation)` - Detailed documentation on the `ItemKey` structure and its uses. + +--- + +The use of types, structured parameters, and clear examples makes it easier for developers to understand how to interact with the method. The reference to fictional utilities or helper functions like `CreateItemKey` is a common practice when exact implementations differ based on the addon or script's broader context. + +# C_AuctionHouse Documentation + +## IsFavoriteItem + +Determines if an item is marked as a favorite in the Auction House. + +### Parameters + +- **itemKey**: `ItemKey` - The unique key of the item. + +### Returns + +- `boolean` - Returns `true` if the item is a favorite, `false` otherwise. + +### WoW API Reference + +- This method makes use of the World of Warcraft API. For more information, refer to [C_AuctionHouse.IsFavoriteItem](https://wow.gamepedia.com/API_C_AuctionHouse.IsFavoriteItem). + +### Example Usage + +```typescript +// Import relevant definitions, presuming a TypeScript setup where these are available +import { C_AuctionHouse, ItemKey } from 'your-wow-addons-library'; + +// Example scenario: checking if an item is a favorite in Auction House +function checkIfFavorite(itemKeyId: number): void { + + // Example of creating a simple ItemKey. Actual implementations might vary. + const itemKey: ItemKey = { + itemID: itemKeyId, + // Depending on the item, other properties like `battlePetSpeciesID` might be necessary + }; + + // Using the C_AuctionHouse class method to check if the item is marked as favorite. + const isFavorite: boolean = C_AuctionHouse.IsFavoriteItem(itemKey); + + if(isFavorite) { + console.log(`Item ID ${itemKeyId} is marked as a favorite in the Auction House.`); + } else { + console.log(`Item ID ${itemKeyId} is not a favorite in the Auction House.`); + } +} + +// Executing the function with a hypothetical Item ID +checkIfFavorite(12345); +``` + +This example provides a basic structure for checking an item's favorite status in the Auction House using the `IsFavoriteItem` method from the `C_AuctionHouse` class. It's a practical use case especially for addons that need to track or manage favorite items within the Auction House interface of World of Warcraft. Remember to replace `"your-wow-addons-library"` with the actual import path relevant to your setup, and the implementation details such as creating an `ItemKey` may vary based on the specific requirements and context of your addon. + +## IsSellItemValid + +This method checks if the item specified can be sold at the Auction House. + +### Parameters + +- **item** `ItemLocationMixin` - The item's location you want to check for Auction House eligibility. +- **displayError** `boolean` (optional) - Specifies whether an error message should be displayed if the item is not valid for sale at the Auction House. + +### Returns + +`boolean` - Returns `true` if the item can be sold at the Auction House, otherwise returns `false`. + +### Example Usage: + +This example demonstrates checking if an item is valid for sale at the Auction House. If the item is valid, it will print "Item can be sold." Otherwise, "Item cannot be sold." is printed. Errors will be displayed based on the `displayError` parameter. + +```typescript +declare const C_AuctionHouse: { + IsSellItemValid(item: ItemLocationMixin, displayError?: boolean): boolean; +}; + +// Function to mimic the process of getting an item's location +function getItemLocation(): ItemLocationMixin { + // This is a placeholder function. In actual implementation, it will return the location of the item. + // For the sake of this example, we assume the function successfully returns a valid `ItemLocationMixin` object. + return {} as ItemLocationMixin; +} + +// Trying to check if an item can be sold at the Auction House +const itemLocation = getItemLocation(); +const canBeSold = C_AuctionHouse.IsSellItemValid(itemLocation, true); + +if (canBeSold) { + console.log("Item can be sold."); +} else { + console.log("Item cannot be sold."); +} +``` + +This method provides a way to verify the eligibility of an item for the Auction House sale process programmatically. Ensuring that an item can be sold before attempting to list it can save time and improve the user experience by preventing unnecessary errors. + +### API Reference + +For more details, visit the World of Warcraft API documentation: [C_AuctionHouse.IsSellItemValid](https://wow.gamepedia.com/API_C_AuctionHouse.IsSellItemValid) + +Based on the given guidelines and structure, here is a markdown documentation for the `C_AuctionHouse.IsThrottledMessageSystemReady` method: + +# C_AuctionHouse.IsThrottledMessageSystemReady + +Determines if the throttled message system of the Auction House is ready to process a new specific search. This method is particularly useful when performing operations that require checking the Auction House's capacity to handle requests, especially to avoid surpassing the limit and thus ensuring smoother interactions. + +## Parameters + +- **specificSearch** (optional): boolean - Specifies whether the readiness check is for a specific search. This parameter allows the method to be used more flexibly depending on the type of operation being performed. + +## Returns + +- **boolean**: Indicates if the throttled message system is ready. A return value of `true` means the system can process a new search or operation, whereas `false` suggests that it is currently not ready and subsequent requests should be delayed or postponed. + +## Example Usage + +The following example demonstrates how to use `C_AuctionHouse.IsThrottledMessageSystemReady` to check the Auction House message system's readiness before performing a specific search. This approach helps to manage the frequency of requests and ensures compliance with the system's throttling mechanism. + +```typescript +function performAuctionHouseSearch() { + // Check if the Auction House's throttled message system is ready for a specific search + if (C_AuctionHouse.IsThrottledMessageSystemReady(true)) { + console.log("The Auction House system is ready for a specific search."); + // Proceed with the specific search or operation + // For example, searching for specific items or posting auctions + // [Your specific search or operation logic here] + } else { + console.log("The Auction House system is not ready yet. Please try again later."); + // Delay or postpone the operation + // Optionally, implement a retry mechanism based on timers or events + } +} + +// Example call to the performAuctionHouseSearch function +performAuctionHouseSearch(); +``` + +In this example, `performAuctionHouseSearch` is a function that first checks whether the Auction House's message system is ready to handle a specific search. It uses `C_AuctionHouse.IsThrottledMessageSystemReady(true)` to perform this check. If the system is ready (`true` is returned), the function logs a message and the specific search or operation can safely proceed. Otherwise (`false` is returned), it logs a different message indicating that the system is not ready, and the operation should be delayed or postponed. + +This approach helps in maintaining the efficiency of interactions with the Auction House and avoiding potential issues related to system throttling. + +## MakeItemKey +Create a structured key for querying the Auction House for items matching the provided item attributes. This method effectively simplifies item lookups by standardizing the approach to generating item keys based on various parameters. + +### Parameters + +- **itemID** `number` - The unique identifier for the item. +- **itemLevel** `number` (Optional) - The level of the item. Default is `undefined` if not specified. +- **itemSuffix** `number` (Optional) - The suffix of the item, which often indicates stat modifications or variations. Default is `undefined` if not specified. +- **battlePetSpeciesID** `number` (Optional) - The unique identifier for the battle pet species, which is only applicable for battle pet items. Default is `undefined` if not specified. + +### Returns +**ItemKey** - An object containing the structured key that can be used for Auction House queries. + +### Example Usage: + +```typescript +// Import the C_AuctionHouse class to use its methods +declare const C_AuctionHouse: C_AuctionHouse; + +// Create an item key for a regular item with just an item ID +const basicItemKey = C_AuctionHouse.MakeItemKey(168487); // Anchor Weed +console.log(basicItemKey); + +// Create an item key for an item with both item ID and item level +const leveledItemKey = C_AuctionHouse.MakeItemKey(172232, 475); // Shrouded Cloth with specific item level +console.log(leveledItemKey); + +// Create an item key for an item with ID, level, and a suffix +const suffixedItemKey = C_AuctionHouse.MakeItemKey(163956, 415, 6432); // Randomly rolled stat item +console.log(suffixedItemKey); + +// Create an item key for a battle pet item +const battlePetItemKey = C_AuctionHouse.MakeItemKey(163955, undefined, undefined, 242); // Specific Battle Pet Species +console.log(battlePetItemKey); +``` + +### Note: +This method is part of the Auction House API and its ability to easily manage and perform searches for various items, regardless of their variations, enriches the user experience within the Auction House UI. By standardizing the way items are queried, it allows for more efficient data retrieval and manipulation. + +Given the provided instructions and referencing the example documentation style, here is how you would document the `C_AuctionHouse.PlaceBid` method in markdown format for readme documentation dedicated to AIO plugin development, similar to World of Warcraft AddOns. + +--- + +## C_AuctionHouse.PlaceBid + +Places a bid on an auction in the Auction House. + +### Parameters +- **auctionID** `number` - The unique identifier of the auction on which to place a bid. +- **bidAmount** `number` - The amount of the bid. This must be greater than or equal to the auction's minimum bid and must beat the current highest bid if there is one. + +### Returns +None. + +### Usage Example: +```typescript +// Assuming 'C_AuctionHouse' is an available object as per the AIO plugin environment setup. +// This example demonstrates placing a bid of 1500 (currency unit not specified, but traditionally in gold) on an auction with the ID of 12345. + +const auctionID = 12345; +const bidAmount = 1500; + +C_AuctionHouse.PlaceBid(auctionID, bidAmount); + +console.log(`Bid of ${bidAmount} placed on auction ${auctionID}.`); +``` +This code snippet places a bid and logs a confirmation message to the console. Ensure you handle the potential for the bid to not meet the auction requirements or to be outbid by another player in a real-world scenario. + +### Notes: +- You cannot bid on your own auctions. +- Ensure you have enough currency available to cover the bid amount. +- This method does not return a success or failure state. Listen for the appropriate game events or check your current bids to confirm the bid placement was successful. + +### See Also +- [C_AuctionHouse.CancelBid](https://wow.gamepedia.com/API_C_AuctionHouse.CancelBid) - For canceling a bid on an auction. +- [C_AuctionHouse.GetAuctionInfo](https://wow.gamepedia.com/API_C_AuctionHouse.GetAuctionInfo) - To retrieve information about auctions, useful for determining current bids. + +--- + +This documentation maintains consistency with the example provided, focusing on explaining the method, its parameters, usage with a code snippet, and supplemental information for potential users of the API component within an AIO plugin development context similar to World of Warcraft AddOns. + +# C_AuctionHouse.PostCommodity + +The `PostCommodity` function is a method provided by the `C_AuctionHouse` interface for posting commodity items (such as crafting materials) to the auction house. Commodities differ from regular items in that they are sold in quantities, with buyers able to purchase any quantity of the commodity up to the amount listed. + +## Parameters +- **item**: `ItemLocationMixin` - The location of the item in the player's inventory. +- **duration**: `AUCTION_RUNTIME` - The length of time for the auction. This is an enumerated value that specifies whether the auction will last for 12, 24, or 48 hours. +- **quantity**: `number` - The number of items to sell. +- **unitPrice**: `number` - The price per item. + +## Usage + +To use the `PostCommodity` method to auction a commodity, the player must first locate the item in their inventory and decide on the duration, quantity, and price. This method does not return a value, but successfully calling it will list the commodity on the auction house. + +### Example + +The following example illustrates posting a commodity to the auction house. Assume the player wishes to sell 10 units of a crafting material for 50 gold per unit, for a duration of 24 hours. +```typescript +// Requires the ItemLocationMixin to locate the item in inventory +import { ItemLocationMixin } from 'path/to/ItemLocationMixin'; + +// AUCTION_RUNTIME enumeration for specifying auction duration +enum AUCTION_RUNTIME { + TWELVE_HOURS = 12, + TWENTY_FOUR_HOURS = 24, + FORTY_EIGHT_HOURS = 48, +} + +class C_AuctionHouse { + /** + * Posts a commodity to the auction house. + * @param item The inventory location of the item to auction. + * @param duration The auction duration, one of the values from AUCTION_RUNTIME. + * @param quantity The number of items to sell. + * @param unitPrice The price per unit. + */ + public static PostCommodity(item: ItemLocationMixin, duration: AUCTION_RUNTIME, quantity: number, unitPrice: number): void {} +} + +// Example of posting a commodity +// Define your item's location in your inventory +const itemLocation = new ItemLocationMixin(...); // Code specific to finding your item +const auctionDuration = AUCTION_RUNTIME.TWENTY_FOUR_HOURS; +const quantity = 10; +const unitPrice = 5000; // Copper units, so this is 50 gold + +// Call PostCommodity to list the item +C_AuctionHouse.PostCommodity(itemLocation, auctionDuration, quantity, unitPrice); +``` +This script demonstrates how to invoke `PostCommodity` to list a commodity on the auction house. Make sure that the item location correctly identifies the commodity you wish to sell, and note that the unit price is in copper (so 50 gold is represented as 5000 copper). + +Here's an example of how to document the `PostItem` method of the `C_AuctionHouse` class, following the template provided in the question. + +```markdown +# C_AuctionHouse + +`C_AuctionHouse` provides functionality related to the in-game Auction House, allowing players to programmatically post items for sale among other auction-related actions. + +## PostItem + +Posts an item for auction at the specified bid and buyout price. + +### Parameters + +- **item** `ItemLocationMixin` - The item you wish to post on the auction house. This includes information about the item's location in the player's inventory or bags. +- **duration** `AUCTION_RUNTIME` - The duration for which the item should be listed. This is typically expressed in constants representing predetermined lengths such as 12, 24, or 48 hours. +- **quantity** `number` - The number of items from the stack you want to post. For items that cannot stack, this should be 1. +- **bid** `number` (Optional) - The starting bid price for the item in copper. If not specified, a default value determined by the auction house will be used. +- **buyout** `number` (Optional) - The buyout price for the item in copper. If not specified, there will be no buyout price for this auction. + +### Returns + +- `void` - This method does not return any value. + +### Example Usage + +Below is an example of utilizing `C_AuctionHouse.PostItem` to post a single stack of items for a 24-hour duration with both a starting bid and a buyout price. + +```typescript +// First, we need to acquire an item location mixin. Assume `itemLocation` is this mixin for the desired item. +let itemLocation = getItemLocationMixinFromPlayerBag(0, 1); // Example function to get an item from bag 0, slot 1. + +// Define the auction parameters. +const duration = AUCTION_RUNTIME.TWENTY_FOUR_HOURS; +const quantity = 1; +const bid = 50000; // 5 gold in copper. +const buyout = 100000; // 10 gold in copper. + +// Post the item to the auction house. +C_AuctionHouse.PostItem(itemLocation, duration, quantity, bid, buyout); + +// Note: Make sure to handle cases where the item cannot be posted, e.g., due to lacking the required item or not being at an auction house. +``` + +### Remarks + +Using `C_AuctionHouse.PostItem` requires the player to be at an Auction House in the game world, and it consumes the item, removing it from the player’s inventory upon successful posting. Always ensure the player has the item and meets any other prerequisites before attempting to post an auction. + +For more detailed information, please refer to the [World of Warcraft API documentation](https://wow.gamepedia.com/API_C_AuctionHouse.PostItem). +``` + +Remember to adjust the example usage to match realistic scenarios and API usage, ensuring that the generic function `getItemLocationMixinFromPlayerBag` is defined in your code base or replace it with an appropriate method to retrieve an `ItemLocationMixin`. + +Based on the given examples and format specifications, here is how you could structure the `C_AuctionHouse.QueryBids` API documentation in markdown for a readme document tailored to World of Warcraft addons or AIO plugins: + +## C_AuctionHouse.QueryBids + +Submits a query for bids based on specified sorting criteria and auction IDs. It’s designed to fetch data from the Auction House based on the player’s current bids, enabling the addon to sort or filter these auctions effectively. + +### Parameters + +- **sorts**: `AuctionHouseSortType[]` - An array of sorting criteria to apply to the query result. These criteria determine the order in which the queried bid items are returned. +- **auctionIDs**: `number[]` - An array of auction IDs for which bids information is requested. + +### Example Usage + +```typescript +// Assuming this method is part of an AIO plugin for Auction House management. + +// Define sorting criteria: Sort by 'timeRemaining', ascending +const sortingCriteria: AuctionHouseSortType[] = [ + { sortOrder: "ASCENDING", sortType: "timeRemaining" } +]; + +// Define a list of auction IDs interested in +const auctionIDs: number[] = [1234, 5678, 91011]; + +// Fetch bids based on the criteria and auction IDs +C_AuctionHouse.QueryBids(sortingCriteria, auctionIDs); + +// Handle the results through an event or a callback after querying +const handleBidsResponse = (bidsInfo) => { + // Process and display fetched bids information +}; +``` + +This function, `QueryBids`, allows addons to fetch detailed information on items that the player has bid on in the Auction House. Utilizing this API enables developers to create more interactive and informed UIs that can help players manage their bids more efficiently. + +### Notes + +- The Auction House must be open to use this function, as it interacts directly with the Auction House UI’s server queries. +- The effectiveness of sorting and filtering depends on providing valid `AuctionHouseSortType` criteria. +- This function does not return bid information directly; listen for the appropriate event or callback in your addon to fetch the query results. + +### Related Links + +- [AuctionHouseSortType documentation](https://wow.gamepedia.com/API_C_AuctionHouse.AuctionHouseSortType) +- [Working with Auction House APIs](https://wow.gamepedia.com/API_C_AuctionHouse) + +This markup provides a detailed explanation of the `QueryBids` function, including how and when to use it, and gives a code example to illustrate its practical application within an addon. + +Creating clear and informative documentation is crucial for understanding and utilizing APIs effectively. Below, we translate the TypeScript class definition of `C_AuctionHouse` and its method `QueryOwnedAuctions` into markdown documentation that follows the structure demonstrated for `FontInstance`. This format provides straightforward information on usage, parameters, and example implementation. + +--- + +# C_AuctionHouse + +`C_AuctionHouse` provides functions for interacting with the game's auction house, allowing for queries and manipulations of auction items specific to the player. + +## Methods + +### QueryOwnedAuctions + +This method requests a list of auctions owned by the player. The auctions can be sorted based on the criteria provided. + +#### Parameters + +- **sorts**: `AuctionHouseSortType[]` - An array of sorting types to apply to the auction house query. These can influence the order in which auctions are returned. See `AuctionHouseSortType` for valid sorting options. + +#### Returns + +- `void` - This method does not return any value. + +#### Example Usage: + +This example demonstrates how to query the auctions owned by the player, sorted first by time remaining and then by bid amount. + +```typescript +// Assuming C_AuctionHouse and AuctionHouseSortType are imported appropriately + +// Define the sorting criteria +const sorts: AuctionHouseSortType[] = [ + { sortType: "timeRemaining", reverseSort: false }, + { sortType: "bid", reverseSort: true } +]; + +// Query the player's owned auctions with the defined sorting +C_AuctionHouse.QueryOwnedAuctions(sorts); + +// At this point, you'd typically set up additional steps to handle or display +// the queried auction data once it's asynchronously returned. +``` + +This method does not directly return the queried auction data. After calling `QueryOwnedAuctions`, you would generally listen for a game event or employ a callback mechanism to receive and handle the auction information asynchronously. + +--- + +When converting TypeScript definitions to markdown documentation, it's important to clearly state the purpose of each class or method, provide detailed parameter descriptions, specify any return values or side effects, and give practical example usage to help consumers understand how to implement the functionalities in their project. + +To create markdown documentation for the `RefreshCommoditySearchResults` method in the `C_AuctionHouse` class for your AIO plugin, reminiscent of World of Warcraft AddOn documentation, you would structure it as follows: + +# C_AuctionHouse + +`C_AuctionHouse` is a part of the World of Warcraft API that handles auction house functionalities. + +## RefreshCommoditySearchResults + +This method refreshes the search results for a specific commodity in the auction house. + +### Parameters + +- **itemID** `number`: The unique identifier for the commodity item. + +### Returns + +`void` - This method does not return a value. + +### Overview + +When you want to update the search results for a commodity in the Auction House, you use `RefreshCommoditySearchResults`. This is particularly useful when you're dealing with items that have fluctuating prices and availability, as it allows your plugin to fetch the most up-to-date information directly from the server. + +### Example Usage + +```typescript +// Assume you have an itemID for Linen Cloth, which is a commonly traded commodity. +const linenClothItemID = 2589; // This ID is purely illustrative. Use actual item IDs from the game. + +// Create an instance of the C_AuctionHouse class +// Note: The actual process to instantiate or access this class will depend on your plugin's architecture and Blizzard's API constraints. +const auctionHouse = new C_AuctionHouse(); + +// Refresh the commodity search results for Linen Cloth to ensure you have the latest data. +auctionHouse.RefreshCommoditySearchResults(linenClothItemID); + +// After refreshing, you can proceed to fetch and process the updated auction data for Linen Cloth. +// Example: auctionHouse.GetCommoditySearchResults(linenClothItemID); (Assuming such a method exists, for illustration purposes) +``` + +### Additional Notes + +- Always ensure you have the correct `itemID` for the commodity you wish to search for. `itemID` can usually be found through various WoW databases or by querying the game's API directly. +- Keep in mind that excessive use of the Auction House API (including this method) in a short period might be restricted by Blizzard to ensure server stability and fair use policies. + +For more detailed information on using the Auction House API, refer to the [official World of Warcraft API documentation](https://wow.gamepedia.com/API_C_AuctionHouse.RefreshCommoditySearchResults). + +--- + +This example demonstrates how to document a method belonging to a class within the World of Warcraft API for an AIO plugin, following conventions suitable for addon developers and users. + +## RefreshItemSearchResults + +This method is utilized to refresh the auction search results for a specific item in World of Warcraft's Auction House. It allows addons and plugins developed using AIO plugins framework to interact dynamically with the Auction House UI by updating the display of search results based on the specified item key. + +### Parameters +**itemKey** `ItemKey` - An object that uniquely identifies an item in the game. This key is used to query the Auction House for the specific item's current listings. + +### Example Usage: +Consider a scenario where you're building an addon to help players find the best deals for crafting materials in the Auction House. You would use the `RefreshItemSearchResults` method to update the search results for a specific material. + +```typescript +// Assume `ItemKey` for a popular crafting material, "Monelite Ore" is available. +const moneliteOreKey = { + itemID: 152512, // ItemID for Monelite Ore + // Additional properties to uniquely identify the item... +}; + +// Instance of the AuctionHouse class +let auctionHouse = new C_AuctionHouse(); + +// Function to refresh search results for Monelite Ore +function refreshMoneliteOreListings() { + auctionHouse.RefreshItemSearchResults(moneliteOreKey); + console.log("Search results for Monelite Ore have been refreshed."); +} + +// Invoke the function to refresh the listings +refreshMoneliteOreListings(); +``` + +In this example, an `ItemKey` object representing "Monelite Ore" is passed to the `RefreshItemSearchResults` method of an `C_AuctionHouse` class instance. This refreshes the auction listings displayed for "Monelite Ore". It's a straightforward way to ensure players are looking at the most current information as they make purchasing decisions based on market fluctuations. + +### Remarks +- The actual updating of the UI with the refreshed data is handled internally by the game's Auction House system. This method primarily informs the system to fetch and display the latest data. +- Considering rate limits and server load, it's advisable to use this function judiciously to avoid potential throttling of your addon's functionality. +- The `ItemKey` structure can involve additional parameters such as item level, enchantments, and other specifics that define a unique item exactly. Understanding how to construct an `ItemKey` is crucial for accurate item querying. + +For more details on the `ItemKey` structure and other Auction House related APIs, see the WoW API documentation: [https://wow.gamepedia.com/API_C_AuctionHouse.RefreshItemSearchResults](https://wow.gamepedia.com/API_C_AuctionHouse.RefreshItemSearchResults) + +To document the `C_AuctionHouse.ReplicateItems` method in a way that matches the examples provided, it's important to first understand the functionality and context of the method itself. The `ReplicateItems` method for the `C_AuctionHouse` class is used to replicate auction items, which is a process relevant to the World of Warcraft API. While the specific function's details and parameters are abstract in this context, the following template aims to capture the essence of documenting this method consistently. + +--- + +## ReplicateItems + +This method is used to replicate auction house items, obtaining a snapshot of items currently up for auction. This is particularly useful for addons analyzing auction house data. + +### Parameters + +None + +### Returns + +Void - No return value. + +### Example Usage + +The `ReplicateItems` method would be used in a context where an addon needs to fetch the current list of items in the auction house. The method does not directly return data but triggers the Auction House data replication process. Observers of the game's events would listen for an update event to process the replicated data. + +```typescript +class MyAuctionHouseAddon extends C_AuctionHouse { + + // Constructor + constructor() { + super(); + // Starting the replication process + this.InitializeReplication(); + } + + // Initializes the replication of Auction House items + InitializeReplication() { + this.ReplicateItems(); // Triggering the replication + + // Event listener for when the replication is complete (hypothetical scenario) + gameEvent.on('AUCTION_HOUSE_REPLICATION_COMPLETE', this.HandleReplicationComplete); + } + + // Handle the completion of AH replication + HandleReplicationComplete() { + // Code to handle the replicated data + console.log('Auction House Replication Complete. Data is now available for processing.'); + } +} + +// Example usage +const myAHAddon = new MyAuctionHouseAddon(); +``` + +In this example, `MyAuctionHouseAddon` extends `C_AuctionHouse`, and upon instantiation, it starts the item replication process by calling `ReplicateItems()`. This hypothetical example assumes that the game would fire an event (`AUCTION_HOUSE_REPLICATION_COMPLETE`) when the replication process is complete, allowing the addon to then process the replicated data. + +The use of this particular API (`C_AuctionHouse.ReplicateItems`) is entirely fictional in this explanation as the method's direct impact and parameters are not specified in the World of Warcraft API documentation link provided. However, this example aims to give a comprehensive guide on how such a method could potentially be documented and utilized within a TypeScript context for addon development similar to World of Warcraft addons. + +--- + +# RequestMoreBrowseResults + +This method queries additional browse results from the game's Auction House. When browsing the Auction House items, this function can be called to load more items beyond the initial set retrieved. It is particularly useful for addons that aim to enhance Auction House browsing by fetching and displaying a large number of items. + +### Notice +*Before invoking this method, ensure that an initial browse request (e.g., `C_AuctionHouse.SendBrowseQuery()`) has been made. This function fetches additional items based on the last browse query.* + +## Syntax + +```typescript +C_AuctionHouse.RequestMoreBrowseResults(): void; +``` + +### Parameters +None + +### Returns +**void** - This method does not return any value. + +## Example Usage + +In the example below, we initially send a browse query to fetch the first batch of items based on specific criteria (e.g., searching for all available weapons). After the initial fetch, `RequestMoreBrowseResults` is called to load more items that match the initial search criteria. + +### Step 1: Define the browse query + +First, we define our search criteria. For the sake of this example, let's consider we're looking for Shields. + +```typescript +const browseQuery = { + searchString: "Shield", + minLevel: 0, + maxLevel: 60, + itemClassFilters: [ + { + classID: 4, // Armor + subclassID: 6 // Shield + } + ] +}; +``` + +### Step 2: Send the browse query + +Next, we send our query to fetch the initial set of results. `C_AuctionHouse.SendBrowseQuery()` is used for this purpose. + +```typescript +C_AuctionHouse.SendBrowseQuery(browseQuery); +``` + +### Step 3: Request more browse results + +After retrieving and possibly displaying the initial set of items, we want to load more items that fit our criteria. This is where `RequestMoreBrowseResults` comes in handy. + +```typescript +C_AuctionHouse.RequestMoreBrowseResults(); +``` + +### Handling the response + +The results from the auction house including those fetched with `RequestMoreBrowseResults` are typically handled via event listeners. For instance, the `AUCTION_HOUSE_BROWSE_RESULTS_UPDATED` event is triggered when new browse results are available. + +```typescript +// Example event listener for new browse results +const onBrowseResultsUpdated = () => { + // Handle the updated browse results + // This could involve updating the UI with the newly fetched items, for example. +}; + +// Register the event listener +document.addEventListener("AUCTION_HOUSE_BROWSE_RESULTS_UPDATED", onBrowseResultsUpdated); +``` + +## Notes +- This method is part of the `C_AuctionHouse` namespace which encapsulates functionalities related to the Auction House. +- Consider server limitations and user experience before making repeated calls to `RequestMoreBrowseResults`, to avoid potential issues like rate limiting or UI freezes. + +Creating README Documentation for `C_AuctionHouse` Methods + +### C_AuctionHouse.RequestMoreCommoditySearchResults + +Requests more search results for a specific commodity from the Auction House, which is useful when the initial query does not return all possible listings due to quantity or other API-imposed limitations. + +#### Parameters + +**itemID** `number` - The unique identifier for the commodity item for which additional search results are requested. + +#### Returns + +**hasFullResults** `boolean` - Indicates whether all possible listings for the specified commodity have been retrieved. A value of `true` means there are no more results to fetch, while `false` indicates that more results can be obtained by further invoking this method. + +#### Usage + +Suppose you've performed an initial search for a commodity (e.g., a stack of herbs) in the Auction House and you wish to load more results beyond the initial batch (if available). The use of `RequestMoreCommoditySearchResults` can help fetch additional entries. + +```typescript +const itemId = 168487; // Just an example item ID for Zin'anthid, a Battle for Azeroth herb. +let hasMoreResults = true; + +// Initial search is performed elsewhere + +// Attempt to fetch more results if there are any +while (hasMoreResults) { + hasMoreResults = C_AuctionHouse.RequestMoreCommoditySearchResults(itemId); + if (hasMoreResults) { + console.log("More results fetched for item ID:", itemId); + } else { + console.log("All results have been fetched for item ID:", itemId); + } +} +``` + +#### Note + +This method is particularly useful in scenarios where large quantities of a commodity are being traded, and complete market visibility is desired. Remember, too many rapid requests might strain the game client or API, so use judiciously and respect rate limits where applicable. + +#### See Also + +- [World of Warcraft API](https://wowpedia.fandom.com/wiki/World_of_Warcraft_API) +- [C_AuctionHouse API methods](https://wowpedia.fandom.com/wiki/API_C_AuctionHouse) + +This template showcases how to document a method from the World of Warcraft API, focusing on presenting clear, concise information regarding parameters, return values, use cases, and additional contextual details. Adjust the template as needed to fit the specifics of other methods or class functions. + +Creating documentation for the `C_AuctionHouse.RequestMoreItemSearchResults` method within a TypeScript class definition that could be used in an AIO plugin similar to a World of Warcraft AddOn can follow the structured approach exemplified previously. Below is how to document this method based on the given specifications and the World of Warcraft API reference: + +### C_AuctionHouse.RequestMoreItemSearchResults +This method is used to request more item search results from the Auction House. It's particularly useful when the initial query does not return all the available items due to the limit on the number of items retrieved in a single query. + +#### Parameters +- **itemKey**: `ItemKey` - A structure containing item identification information. It includes item ID, item level, and optionally, the item's battle pet species ID. + +#### Returns +- **hasFullResults**: `boolean` - Returns `true` if there are no more results to fetch, indicating you have received all available data. Returns `false` if more results can be fetched with subsequent calls. + +#### Usage +When using `C_AuctionHouse.RequestMoreItemSearchResults`, you might be implementing a feature to fetch and display all auction items for a specific item, potentially for an addon that tracks auction prices or availability. It is essential to check the return value to know whether to make additional requests for more data. + +#### Example Usage +Below is an illustrative example of how you might utilize the `RequestMoreItemSearchResults` method in a scenario where you're fetching all results for a given item in batches: + +```typescript +class AuctionHouseFetcher { + // Assuming `itemKey` has been defined and initialized elsewhere + public itemKey: ItemKey; + + constructor(itemKey: ItemKey) { + this.itemKey = itemKey; + } + + /** + * Fetches all auction house listings for the item corresponding to the `itemKey` + */ + public async fetchAllListings() { + let hasFullResults = false; + + while (!hasFullResults) { + hasFullResults = C_AuctionHouse.RequestMoreItemSearchResults(this.itemKey); + + if (!hasFullResults) { + console.log("Fetching more results..."); + // Simulate a delay for illustrative purposes + await this.delay(1000); + } + } + + console.log("All results fetched for the item."); + } + + /** + * A utility method to simulate asynchronous delays + */ + private delay(ms: number): Promise { + return new Promise(resolve => setTimeout(resolve, ms)); + } +} + +// Example usage +const itemKey: ItemKey = { + itemID: 12345, + itemLevel: 0 +}; + +const fetcher = new AuctionHouseFetcher(itemKey); +fetcher.fetchAllListings().then(() => { + console.log("Finished fetching auction listings."); +}); +``` + +In this example, a class `AuctionHouseFetcher` is defined with a method to fetch all auction listings for a specified item. It continuously requests more results until `hasFullResults` is `true`. For demonstration, a delay is introduced to mimic API cooldowns or processing time. + +Given the example provided for documenting TypeScript Class methods and translating them into readme-style documentation, here's how the `C_AuctionHouse.SearchForFavorites` method could be documented. This approach aims to provide clarity on usage, parameters, and contextual information for the method within the World of Warcraft AddOn development ecosystem, specifically using references similar to the World of Warcraft API documentation available on sites like Wowpedia. + +--- + +## SearchForFavorites + +This method allows you to search for your favorite items within the Auction House. It utilizes predefined sort types to organize the results according to your preferences. + +### Parameters +- **sorts**: `AuctionHouseSortType[]` - An array of sorting types that dictate the organization of the search results. Each element of the array is an `AuctionHouseSortType`, which can include sort orders such as price, name, rarity, etc. + +### Returns +- This method does not return any value. + +### Usage Example + +Below is how you could use the `SearchForFavorites` method to search for your favorite items in the Auction House, sorted by your preferred criteria. In this example, we sort the items by their price and name, assuming that `AuctionHouseSortType.PRICE` and `AuctionHouseSortType.NAME` are valid sorting types within the `AuctionHouseSortType` enumeration. + +```typescript +declare const C_AuctionHouse: { + /** + * Searches for favorite items in the Auction House. + * @param sorts Array of sorting types to organize search results. + */ + SearchForFavorites(sorts: AuctionHouseSortType[]): void; +}; + +// Define sorting preferences. +const sorts: AuctionHouseSortType[] = [AuctionHouseSortType.PRICE, AuctionHouseSortType.NAME]; + +// Execute the search with the specified sorting. +C_AuctionHouse.SearchForFavorites(sorts); + +// Since there's no return value, subsequent actions might involve UI updates or other logic to display the search results to the user. +``` + +In this code snippet, we first define the sorting types that we prefer for organizing our search results in the Auction House. After that, we call `C_AuctionHouse.SearchForFavorites` with our sorting preferences. Since the method does not return any value, you would typically follow up this operation with additional code to handle the display of these results in your AddOn's UI, based on the asynchronous nature of Auction House data retrieval. + +### Note +Keep in mind that the actual sorting types and their implementation depend on the current World of Warcraft API and the data structure of the Auction House in the game. The example sorting types (`AuctionHouseSortType.PRICE` and `AuctionHouseSortType.NAME`) are used for illustrative purposes and may not directly reflect the API's current state. + +For the most accurate and up-to-date information regarding the `AuctionHouseSortType` and the Auction House API, consult the official World of Warcraft API documentation or community resources such as Wowpedia. + +--- + +This documentation format aims to provide clear, concise information on the method's purpose, parameters, usage, and any assumptions or dependencies. It mirrors a practical approach to documenting API functionalities tailored for developers engaging with World of Warcraft AddOn development. + +# C_AuctionHouse.SearchForItemKeys + +Searches the auction house for specified item keys and sorts the results according to given criteria. + +## Parameters + +- **itemKeys** - An array of `ItemKey` objects to search for. +- **sorts** - An array of `AuctionHouseSortType` enumerations that define how the search results should be sorted. + +## Example Usage: + +In this example, we search the auction house for two specific items, identified by their item keys, and order the results first by price (ascending) and then by quantity (descending). + +```typescript +// Import or define the necessary types and classes +// Usually, these would be provided by the API or a library +interface ItemKey { + itemID: number; + itemLevel?: number; + itemSuffix?: number; + battlePetSpeciesID?: number; +} + +enum AuctionHouseSortType { + Price, + Quantity +} + +declare class C_AuctionHouse { + SearchForItemKeys(itemKeys: ItemKey[], sorts: AuctionHouseSortType[]): void; +} + +// Example item keys for the items we're interested in +const itemKeys: ItemKey[] = [ + { + itemID: 12345, // The unique identifier for the first item + }, + { + itemID: 67890, // The unique identifier for the second item + }, +]; + +// Define the sorting criteria for our search results +const sorts: AuctionHouseSortType[] = [AuctionHouseSortType.Price, AuctionHouseSortType.Quantity]; + +// Instantiate C_AuctionHouse class and perform the search +const auctionHouse = new C_AuctionHouse(); +auctionHouse.SearchForItemKeys(itemKeys, sorts); + +// At this point, the API would process the search and return results according to the specified item keys and sorting criteria. +// Displaying or processing the results further would depend on additional API functions and callbacks not shown in this example. +``` + +In this example, we create an array of `ItemKey` objects, each representing one item we want to find in the auction house. We then define how we want our search results to be sorted by specifying an array of `AuctionHouseSortType` enumerations. After instantiating the `C_AuctionHouse` class, we call the `SearchForItemKeys` method with our item keys and sorting criteria. This method will search the auction house for the specified items and sort the results as requested. + +It's important to note that this example does not include handling of the search results, as this would depend on further details of the API and the overall application architecture. + +To document the `SendBrowseQuery` method from the `C_AuctionHouse` class, which is used in the context of World of Warcraft AddOns, you would want to follow a structured format that outlines its purpose, parameters, and provides an illustrative example. Below is an example of how such documentation might look when written in Markdown, adhering to a concise yet informative standard. + +--- + +## SendBrowseQuery + +Sends a query to the auction house to browse through current auctions based on a set of criteria. This method is useful for addons that need to retrieve auction items based on specific search parameters such as item name, item level, or rarity. + +### Parameters + +- **query**: `AuctionHouseBrowseQuery` - An object containing all the necessary search parameters for the query. + + The `AuctionHouseBrowseQuery` interface is structured as follows: + - **searchString**: `string` - The text to search for in item names. + - **minLevel**: `number` - The minimum item level. + - **maxLevel**: `number` - The maximum item level. + - **itemClassFilters**: `AuctionHouseItemClassFilter[]` - An array of item class filters to apply. + +### Returns + +- `void` - This method does not return a value. + +### Example Usage + +The following example demonstrates how to use the `SendBrowseQuery` method to search for all epic items within a specific item level range: + +```typescript +// Define search parameters +const query: AuctionHouseBrowseQuery = { + searchString: "", + minLevel: 50, + maxLevel: 60, + itemClassFilters: [ + { + classID: 2, // Weapon + subClassID: 1, // Bows + inventoryType: 15 // Ranged + } + ] +}; + +// Send the browse query to the auction house +C_AuctionHouse.SendBrowseQuery(query); + +// Event handling or additional logic to process the query results would go here +``` + +This example sends a query to the auction house looking for bows (a subclass of weapons) that are of item levels 50 to 60. Note that further implementation details, such as event handling to process the results of the query, would be necessary to fully utilize this method within an addon. + +### See Also + +- [AuctionHouseBrowseQuery](https://wow.gamepedia.com/AuctionHouseBrowseQuery) for more details on the query structure. +- [API C_AuctionHouse.SendBrowseQuery](https://wow.gamepedia.com/API_C_AuctionHouse.SendBrowseQuery) for additional technical details. + +--- + +This structured approach allows developers to quickly find the information they need to understand and implement the `SendBrowseQuery` method in their AddOns for World of Warcraft. + +# C_AuctionHouse.SendSearchQuery + +Sends a search query to the Auction House. This method allows you to specify the item key for which you are searching, how the results should be sorted, and whether items listed by the player should be separated in the results. + +### Parameters +- **itemKey**: `ItemKey` - The key that uniquely identifies the item. This includes the item ID and other identifying properties. +- **sorts**: `AuctionHouseSortType[]` - An array of sort criteria specifying how the results should be ordered. +- **separateOwnerItems**: `boolean` - Whether to separate the items listed by the player from the rest of the results. + +### Example Usage: +```typescript +// Define the item key for which we want to search in the Auction House. +// For example, searching for item ID 12345 +const myItemKey: ItemKey = { + itemID: 12345, + // Additional item key properties can go here. +}; + +// Define how we want the search results to be sorted. +// For example, sorting by price in ascending order. +const mySorts: AuctionHouseSortType[] = [{ + sortOrder: "ascending", + sortType: "price" +}]; + +// Whether to separate items listed by the player. +const separateOwnerItems = true; + +// Send the search query to the Auction House. +C_AuctionHouse.SendSearchQuery(myItemKey, mySorts, separateOwnerItems); + +// After this call, the Auction House will return the items matching the +// specified criteria, sorted accordingly, and potentially separated by +// ownership, depending on the value of `separateOwnerItems`. +``` + +This example demonstrates how to construct a search query for items on the Auction House. `myItemKey` defines the specific item or type of items you're interested in, `mySorts` defines how the search results should be sorted (in this case, by price in ascending order), and `separateOwnerItems` specifies whether to distinguish items listed by the player. + +### Note: +- After using `SendSearchQuery`, you may need to use other Auction House API functions to retrieve and display the search results. +- The Auction House API and its behavior can change with game updates, so it's a good practice to refer to the official API documentation for the most current information. + +### See Also +- [C_AuctionHouse.GetCommoditySearchResultsQuantity](https://wow.gamepedia.com/API_C_AuctionHouse.GetCommoditySearchResultsQuantity) +- [C_AuctionHouse.GetItemSearchResultsQuantity](https://wow.gamepedia.com/API_C_AuctionHouse.GetItemSearchResultsQuantity) + +This example and method signature demonstrates how to use the `C_AuctionHouse.SendSearchQuery` method to search for specific items in World of Warcraft's Auction House, showing how to define the search parameters and interpret the results. + +Given the provided guidelines and structure, the documentation for the `C_AuctionHouse.SendSellSearchQuery` method looks as follows: + +# C_AuctionHouse.SendSellSearchQuery + +The `SendSellSearchQuery` method queries the auction house for items similar to the one specified, optionally sorting the results and possibly separating items owned by the player. + +### Parameters + +- **itemKey** `(ItemKey)` - The key of the item for which to search. The item key generally includes the item's ID and possibly other identifying information. + +- **sorts** `(AuctionHouseSortType[])` - An array of sorting types to apply to the search results. Sorting types determine the order in which the results are returned. + +- **separateOwnerItems** `(boolean)` - If set to true, items owned by the player are separated from the other items in the search results. + +### Returns + +This method does not return any value. + +### Example Usage: + +The following example demonstrates how to use the `SendSellSearchQuery` method to search for auctions of a specific item, sorted by price, and separate the auctions owned by the player. + +```typescript +declare const C_AuctionHouse: { + SendSellSearchQuery(itemKey: ItemKey, sorts: AuctionHouseSortType[], separateOwnerItems: boolean): void; +}; + +// Sample item key for the item to search +const itemKey: ItemKey = { itemID: 12345 }; + +// Define the sorting criteria (e.g., sort by price) +const sorts: AuctionHouseSortType[] = [ + { sortOrder: "price", reverseSort: false } +]; + +// Set to true to separate player-owned items +const separateOwnerItems: boolean = true; + +// Perform the search query +C_AuctionHouse.SendSellSearchQuery(itemKey, sorts, separateOwnerItems); + +// After calling this function, you would typically listen for an event that indicates +// that the search results are ready and then retrieve and display those results. +``` + +### Additional Information +For more specific behavior and integration, refer to the official documentation and forums as the results and usage might vary based on the game's version and the community's mods or add-ons. Also, be aware of any potential changes in API endpoints or parameters by checking the official World of Warcraft API documentation at [World of Warcraft API](https://wowpedia.fandom.com/wiki/World_of_Warcraft_API). + +To document the `C_AuctionHouse.SetFavoriteItem` method in a README format that can be used for AIO plugin development, closely related to World of Warcraft AddOns, follow the example structure provided. The focus should be on clarity and comprehensiveness for the developers using this documentation as a guide for their plugin development. + +--- + +## SetFavoriteItem +Marks an item as a favorite or removes it from favorites in the Auction House interface. + +#### Parameters +- **itemKey**: `ItemKey` - The unique identifier for the item. This should include details such as item ID, item suffix, and battle pet species ID where applicable. +- **setFavorite**: `boolean` - A boolean flag indicating whether to mark the item as a favorite (`true`) or remove it from favorites (`false`). + +#### Returns +This method does not return any values. + +#### Usage Example: + +Before using `SetFavoriteItem`, you'll need an object that represents the item key. Item keys are typically obtained through Auction House search results or other related Auction House APIs. + +```typescript +// Example item key for a hypothetical item. Your item key structure might differ. +let exampleItemKey: ItemKey = { + itemID: 12345, + itemSuffix: 0, + battlePetSpeciesID: 0, +}; + +// Mark the item as a favorite in the Auction House +C_AuctionHouse.SetFavoriteItem(exampleItemKey, true); + +// Later, if you decide to remove the item from favorites +C_AuctionHouse.SetFavoriteItem(exampleItemKey, false); +``` + +#### Note: +- Favoriting items in the Auction House is a convenience feature that allows players to quickly access items they frequently buy or sell. This API enables developers to create AddOns that enhance the Auction House experience by automating certain preferences. +- Keep in mind that the actual structure of `ItemKey` might vary based on the specifics of the item. Always ensure you are using the correct identifiers to avoid unexpected behavior. + +#### References +For more information about working with Auction House APIs and understanding the `ItemKey` structure, visit the [World of Warcraft API documentation](https://wow.gamepedia.com/API_C_AuctionHouse.SetFavoriteItem). + +--- + +This template provides a detailed guide on documenting a single method from the World of Warcraft API for AIO plugin development. It includes sections for parameters, return values, usage examples, and additional notes to ensure the documentation is as helpful as possible to developers. + +``` +# C_AuctionHouse - StartCommoditiesPurchase + +This method initiates the purchase of a specified quantity of a commodity item in the auction house. + +## Method Signature +```typescript +StartCommoditiesPurchase(itemID: number, quantity: number): void; +``` + +## Parameters +- **itemID** `number` - The unique identifier for the commodity item you wish to purchase. +- **quantity** `number` - The amount of the commodity item to purchase. + +## Example Usage + +This example shows how to buy 10 units of a commodity with a specific item ID in the auction house. It assumes that you have already determined the item ID of the commodity you wish to purchase. + +```typescript +const itemID = 12345; // The item ID for the commodity you want to buy. +const quantity = 10; // The number of units you wish to purchase. + +C_AuctionHouse.StartCommoditiesPurchase(itemID, quantity); +``` + +In this case, `12345` is a placeholder for the actual item ID of the commodity. Replace it with the correct item ID for the commodity you wish to purchase. This method does not return any value, but it initiates the necessary actions on the client side to purchase the specified quantity of the commodity from the auction house, subject to availability and current auction house rules. + +### Additional Information + +Before calling `StartCommoditiesPurchase`, you might need to perform additional steps such as ensuring you have enough gold for the purchase and that the item is available in the desired quantity. This method is a part of the in-game Auction House API, and its usage is subject to the constraints and conditions governed by the World of Warcraft game mechanics. + +The purchase initiated by this method is not guaranteed to be successful as market conditions can change rapidly. It is advised to check the auction house for the current availability and prices of commodities. + +For more details, visit the World of Warcraft API documentation: [StartCommoditiesPurchase](https://wow.gamepedia.com/API_C_AuctionHouse.StartCommoditiesPurchase). +``` + +This documentation provides a detailed overview of how to use the `StartCommoditiesPurchase` method from the `C_AuctionHouse` class, including an explanation of its parameters, a practical example of its usage, and additional considerations for successfully integrating it into addon or script development within the context of World of Warcraft. +