API GetSpellBookItemInfo

Returns info for a spellbook item.
 spellType, id = GetSpellBookItemInfo(spellName)
 = GetSpellBookItemInfo(index, bookType)
==Arguments==
==Returns==
:;spellType: - The type of the spell: ["SPELL", "FUTURESPELL", "PETACTION", "FLYOUT"]
:;id:
::* For SPELL and FUTURESPELL, the SpellID used in ()
::* For PETACTION, the ActionID used in (); furthermore, the SpellID can be obtained by applying the bitmask 0xFFFFFF.
::* For FLYOUT, the FlyoutID used in ()
==Details==
==Example==
Prints all spells in the spellbook for the player, except the profession tab ones.
local spellFunc = {
	SPELL = GetSpellInfo,
	FUTURESPELL = GetSpellInfo,
	FLYOUT = GetFlyoutInfo,
}
for i = 1, GetNumSpellTabs() do
	local _, _, offset, numSlots = GetSpellTabInfo(i)
	for j = offset+1, offset+numSlots do
		local spellType, id = GetSpellBookItemInfo(j, BOOKTYPE_SPELL)
		local spellName = spellFunc[spellType](id)
		print(i, j, spellType, id, spellName)
	end
end
Prints all pet spells.
for i = 1, HasPetSpells() do
	local spellType, id = GetSpellBookItemInfo(i, BOOKTYPE_PET)
	local spellID = bit.band(0xFFFFFF, id)
	-- not sure what the non-spell IDs are
	local spellName = spellID > 100 and GetSpellInfo(spellID) or GetSpellBookItemName(i, BOOKTYPE_PET)
	local hasActionButton = C_ActionBar.HasPetActionButtons(id)
	print(i, spellType, id, spellID, spellName, hasActionButton)
end