Besides the standard Lua types (nil, boolean, number, string, table, function, thread, userdata), WoW uses several logical data types throughout the API. For instance, unit IDs are technically strings, but they follow a particular form as described below. The API documentation on this site refers to these logical types as follows:

Type Description
1nil This variable type indicates that a function returns a boolean result, by returning 1 for true, and nil for false. While in most cases these operate the same as boolean values, they aren’t the actual values true and false.
unitID

unitIDs are strings used throughout the API to provide an alias to certain units of interest. Valid base values are:

  • player - The character controlled by the player.
  • pet - The player's pet.
  • target - The player's target.
  • focus - The player's focus.
  • mouseover - The unit underneath the mouse cursor. Includes characters in the 3-D world and any protected frame with an applicable unit attribute.
  • partyn - The party member where n is a number from 1 to 4. None of the party unit IDs refer to the player.
  • partypetn - The nth party member's pet.
  • raidn - The raid member where n is a number from 1 to however many members there are in the raid. The highest n always refers to the player, and the lowest n always refers to the raid leader. There is no correlation between the n for raid units and the n for party units.
  • raidpetn - The nth raid member's pet.
  • none - Nothing. This unit ID allows activation of the target selection cursor (glowing blue glove) even when you are targeting something susceptible to the spell you are casting.

In addition, any unitID can have target added to the end of it to reference that unit’s target, such as partypet2target, which resolves to the second party member’s pet’s target. Longer values such as focustargettargettarget are also legal.

Functions that accept a unitID will also accept the name of a player in your party or raid instead of a unitID. For example UnitHealth ("Cladhaire") will return the same value as UnitHealth("party1") if the unit party1 is the player named Cladhaire. To access the target of a player in this format, simply add a hyphen between the name and target, for example UnitHealth("Cladhaire-target").

Team Arena teams are specified by the index in which they appear in the PvP tab of the character window. These teams are listed in increasing size order, so if the player is a member of a 3v3 and a 5v5 team, the index 1 will refer to 3v3, and 2 will refer to 5v5.
inventoryID The API functions that query the inventory take a number that identifies one of the queriable inventory slots. These numbers may be obtained using GetInventorySlotInfo.
bagID Functions that operate on containers take a numeric index that represents a specific bag. The player’s backpack has index 0, and the normal bags have indices 14. The player’s keyring is index -2. The bank itself has index -1, and the bank bags are indices 511.
itemID An item’s ID is the internal number used by the client to identify specific items. For the item Mantle of the Avatar, the ID is 30154.
itemString The itemString for a given item is the information portion of the itemLink without the color information or the item’s name. Partial strings are accepted so you can provide as much or as little information as you have. For the item Mantle of the Avatar, an example itemString could be "item:30154:2993:2741:2741". The extra numbers indicate the specific enchantments of gems that are included with this item.
itemLink The full hyperlink, including the color information, item name and the full itemString for the given item. For Mantle of the Avatar this might be "|cffa335ee|Hitem:30154:2993:2741:2741:0:0:0:0|h[Mantle of the Avatar]|h|r".