local ClassTalents =
{
	Name = "ClassTalents",
	Type = "System",
	Namespace = "C_ClassTalents",
	Environment = "All",

	Functions =
	{
		{
			Name = "CanChangeTalents",
			Type = "Function",
			Documentation = { "Returns true only if the player has staged changes and can commit their talents in their current state." },

			Returns =
			{
				{ Name = "canChange", Type = "bool", Nilable = false },
				{ Name = "canAdd", Type = "bool", Nilable = false },
				{ Name = "changeError", Type = "string", Nilable = true },
			},
		},
		{
			Name = "CanCreateNewConfig",
			Type = "Function",

			Returns =
			{
				{ Name = "canCreate", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "CanEditTalents",
			Type = "Function",
			Documentation = { "Returns true if the player could switch talents if they staged a proper loadout." },

			Returns =
			{
				{ Name = "canEdit", Type = "bool", Nilable = false },
				{ Name = "changeError", Type = "cstring", Nilable = false },
			},
		},
		{
			Name = "CommitConfig",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "savedConfigID", Type = "number", Nilable = true },
			},

			Returns =
			{
				{ Name = "success", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "DeleteConfig",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "configID", Type = "number", Nilable = false },
			},

			Returns =
			{
				{ Name = "success", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "GetActiveConfigID",
			Type = "Function",

			Returns =
			{
				{ Name = "activeConfigID", Type = "number", Nilable = true },
			},
		},
		{
			Name = "GetActiveHeroTalentSpec",
			Type = "Function",
			Documentation = { "Returns the SubTreeID of the player's active Hero Talent Specialization SubTree." },

			Returns =
			{
				{ Name = "heroSpecID", Type = "number", Nilable = true, Documentation = { "SubTreeID of the player's active Hero Talent Specialization or nil if no Specialization is active." } },
			},
		},
		{
			Name = "GetConfigIDsBySpecID",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "specID", Type = "number", Nilable = true },
			},

			Returns =
			{
				{ Name = "configIDs", Type = "table", InnerType = "number", Nilable = false },
			},
		},
		{
			Name = "GetHasStarterBuild",
			Type = "Function",

			Returns =
			{
				{ Name = "hasStarterBuild", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "GetHeroTalentSpecsForClassSpec",
			Type = "Function",
			MayReturnNothing = true,
			SecretArguments = "AllowedWhenUntainted",
			Documentation = { "Returns the SubTreeIDs of the Hero Talent Specializations available to a Class Specialization and config; Returns nothing if none available" },

			Arguments =
			{
				{ Name = "configID", Type = "number", Nilable = true, Documentation = { "If not supplied, defaults to the player's active config" } },
				{ Name = "classSpecID", Type = "number", Nilable = true, Documentation = { "If not supplied, defaults to the player's active spec" } },
			},

			Returns =
			{
				{ Name = "subTreeIDs", Type = "table", InnerType = "number", Nilable = true, Documentation = { "SubTreeIDs of each Hero Talent Specialization" } },
				{ Name = "requiredPlayerLevel", Type = "number", Nilable = true, Documentation = { "The player level at which one of the Hero Talent Specializations can be activated" } },
			},
		},
		{
			Name = "GetLastSelectedSavedConfigID",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "specID", Type = "number", Nilable = false },
			},

			Returns =
			{
				{ Name = "configID", Type = "number", Nilable = true },
			},
		},
		{
			Name = "GetNextStarterBuildPurchase",
			Type = "Function",

			Returns =
			{
				{ Name = "nodeID", Type = "number", Nilable = true },
				{ Name = "entryID", Type = "number", Nilable = true },
			},
		},
		{
			Name = "GetStarterBuildActive",
			Type = "Function",

			Returns =
			{
				{ Name = "isActive", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "GetTraitTreeForSpec",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "specID", Type = "number", Nilable = false },
			},

			Returns =
			{
				{ Name = "treeID", Type = "number", Nilable = true },
			},
		},
		{
			Name = "HasUnspentHeroTalentPoints",
			Type = "Function",
			Documentation = { "Returns whether the player has any unspent talent points in their active hero talent tree. If hasUnspentPoints is true, numHeroPoints will be greater than zero." },

			Returns =
			{
				{ Name = "hasUnspentPoints", Type = "bool", Nilable = false },
				{ Name = "numHeroPoints", Type = "number", Nilable = false },
			},
		},
		{
			Name = "HasUnspentTalentPoints",
			Type = "Function",
			Documentation = { "Returns whether the player has any unspent talent points in their class or spec talent trees. If hasUnspentPoints is true, the number of unspent points for at least one of the trees will be greater than zero. Hero talent points are not included by this function." },

			Returns =
			{
				{ Name = "hasUnspentPoints", Type = "bool", Nilable = false },
				{ Name = "numClassPoints", Type = "number", Nilable = false },
				{ Name = "numSpecPoints", Type = "number", Nilable = false },
			},
		},
		{
			Name = "ImportLoadout",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "configID", Type = "number", Nilable = false },
				{ Name = "entries", Type = "table", InnerType = "ImportLoadoutEntryInfo", Nilable = false },
				{ Name = "name", Type = "string", Nilable = false },
				{ Name = "importString", Type = "string", Nilable = true },
			},

			Returns =
			{
				{ Name = "success", Type = "bool", Nilable = false },
				{ Name = "importError", Type = "cstring", Nilable = false },
			},
		},
		{
			Name = "InitializeViewLoadout",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "specID", Type = "number", Nilable = false },
				{ Name = "level", Type = "number", Nilable = false },
			},
		},
		{
			Name = "IsConfigPopulated",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",
			Documentation = { "New configs may or may not be populated and ready to load immediately after creation. Avoid calling for configs intentionally created empty." },

			Arguments =
			{
				{ Name = "configID", Type = "number", Nilable = false },
			},

			Returns =
			{
				{ Name = "isPopulated", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "LoadConfig",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "configID", Type = "number", Nilable = false },
				{ Name = "autoApply", Type = "bool", Nilable = false },
			},

			Returns =
			{
				{ Name = "result", Type = "LoadConfigResult", Nilable = false },
				{ Name = "changeError", Type = "string", Nilable = true },
				{ Name = "newLearnedNodeIDs", Type = "table", InnerType = "number", Nilable = false },
			},
		},
		{
			Name = "RenameConfig",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "configID", Type = "number", Nilable = false },
				{ Name = "name", Type = "string", Nilable = false },
			},

			Returns =
			{
				{ Name = "success", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "RequestNewConfig",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "name", Type = "string", Nilable = false },
			},

			Returns =
			{
				{ Name = "success", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "SaveConfig",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "configID", Type = "number", Nilable = false },
			},

			Returns =
			{
				{ Name = "success", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "SetStarterBuildActive",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "active", Type = "bool", Nilable = false },
			},

			Returns =
			{
				{ Name = "result", Type = "LoadConfigResult", Nilable = false },
			},
		},
		{
			Name = "SetUsesSharedActionBars",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "configID", Type = "number", Nilable = false },
				{ Name = "usesShared", Type = "bool", Nilable = false },
			},
		},
		{
			Name = "SwitchToLoadoutByIndex",
			Type = "Function",
			HasRestrictions = true,
			SecretArguments = "AllowedWhenUntainted",
			Documentation = { "Loads loadout for the current specialization by dropdown index. Indices start at 1." },

			Arguments =
			{
				{ Name = "loadoutIndex", Type = "number", Nilable = false },
			},
		},
		{
			Name = "SwitchToLoadoutByName",
			Type = "Function",
			HasRestrictions = true,
			SecretArguments = "AllowedWhenUntainted",
			Documentation = { "Loads loadout for the current specialization by name. Loads the first one found in the case of duplicate names." },

			Arguments =
			{
				{ Name = "loadoutName", Type = "cstring", Nilable = false },
			},
		},
		{
			Name = "SwitchToSpecializationByIndex",
			Type = "Function",
			HasRestrictions = true,
			SecretArguments = "AllowedWhenUntainted",
			Documentation = { "Activates specialization for the current class by index in the order within the Specializations tab. Indices start at 1." },

			Arguments =
			{
				{ Name = "specIndex", Type = "number", Nilable = false },
			},
		},
		{
			Name = "SwitchToSpecializationByName",
			Type = "Function",
			HasRestrictions = true,
			SecretArguments = "AllowedWhenUntainted",
			Documentation = { "Activates specialization for the current class by spec name." },

			Arguments =
			{
				{ Name = "specName", Type = "cstring", Nilable = false },
			},
		},
		{
			Name = "UpdateLastSelectedSavedConfigID",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "specID", Type = "number", Nilable = false },
				{ Name = "configID", Type = "number", Nilable = true },
			},
		},
		{
			Name = "ViewLoadout",
			Type = "Function",
			SecretArguments = "AllowedWhenUntainted",

			Arguments =
			{
				{ Name = "entries", Type = "table", InnerType = "ImportLoadoutEntryInfo", Nilable = false },
				{ Name = "importString", Type = "string", Nilable = true },
			},

			Returns =
			{
				{ Name = "success", Type = "bool", Nilable = false },
			},
		},
	},

	Events =
	{
		{
			Name = "ActiveCombatConfigChanged",
			Type = "Event",
			LiteralName = "ACTIVE_COMBAT_CONFIG_CHANGED",
			SynchronousEvent = true,
			Payload =
			{
				{ Name = "configID", Type = "number", Nilable = false },
			},
		},
		{
			Name = "ClassTalentsSwitchToLoadoutByIndex",
			Type = "Event",
			LiteralName = "CLASS_TALENTS_SWITCH_TO_LOADOUT_BY_INDEX",
			CallbackEvent = true,
			Payload =
			{
				{ Name = "loadoutIndex", Type = "number", Nilable = false },
			},
		},
		{
			Name = "ClassTalentsSwitchToLoadoutByName",
			Type = "Event",
			LiteralName = "CLASS_TALENTS_SWITCH_TO_LOADOUT_BY_NAME",
			CallbackEvent = true,
			Payload =
			{
				{ Name = "loadoutName", Type = "cstring", Nilable = false },
			},
		},
		{
			Name = "ClassTalentsSwitchToSpecializationByIndex",
			Type = "Event",
			LiteralName = "CLASS_TALENTS_SWITCH_TO_SPECIALIZATION_BY_INDEX",
			CallbackEvent = true,
			Payload =
			{
				{ Name = "specIndex", Type = "number", Nilable = false },
			},
		},
		{
			Name = "ClassTalentsSwitchToSpecializationByName",
			Type = "Event",
			LiteralName = "CLASS_TALENTS_SWITCH_TO_SPECIALIZATION_BY_NAME",
			CallbackEvent = true,
			Payload =
			{
				{ Name = "specName", Type = "cstring", Nilable = false },
			},
		},
		{
			Name = "SelectedLoadoutChanged",
			Type = "Event",
			LiteralName = "SELECTED_LOADOUT_CHANGED",
			SynchronousEvent = true,
		},
		{
			Name = "SpecializationChangeCastFailed",
			Type = "Event",
			LiteralName = "SPECIALIZATION_CHANGE_CAST_FAILED",
			SynchronousEvent = true,
		},
		{
			Name = "StarterBuildActivationFailed",
			Type = "Event",
			LiteralName = "STARTER_BUILD_ACTIVATION_FAILED",
			SynchronousEvent = true,
		},
	},

	Tables =
	{
		{
			Name = "LoadConfigResult",
			Type = "Enumeration",
			NumValues = 4,
			MinValue = 0,
			MaxValue = 3,
			Fields =
			{
				{ Name = "Error", Type = "LoadConfigResult", EnumValue = 0 },
				{ Name = "NoChangesNecessary", Type = "LoadConfigResult", EnumValue = 1 },
				{ Name = "LoadInProgress", Type = "LoadConfigResult", EnumValue = 2 },
				{ Name = "Ready", Type = "LoadConfigResult", EnumValue = 3 },
			},
		},
		{
			Name = "ImportLoadoutEntryInfo",
			Type = "Structure",
			Fields =
			{
				{ Name = "nodeID", Type = "number", Nilable = false },
				{ Name = "ranksGranted", Type = "number", Nilable = false },
				{ Name = "ranksPurchased", Type = "number", Nilable = false },
				{ Name = "selectionEntryID", Type = "number", Nilable = false },
			},
		},
	},
	Predicates =
	{
	},
};

APIDocumentation:AddDocumentationTable(ClassTalents);