mirror of
https://github.com/araxiaonline/wow-wotlk-declarations.git
synced 2026-06-13 02:42:25 -04:00
initial
This commit is contained in:
3
a.ts
Normal file
3
a.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import "./declarations";
|
||||
|
||||
const a = GetArchaeologyRaceInfoByID(350);
|
||||
18
declarations/account.d.ts
vendored
Normal file
18
declarations/account.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
|
||||
/**
|
||||
* Returns the highest expansion id the current account has been flagged for.
|
||||
*/
|
||||
declare function GetAccountExpansionLevel(): EXPANSION_CLASSIC | EXPANSION_BURNING_CRUSADE | EXPANSION_WRATH_OF_THE_LICH_KING | EXPANSION_CATACLYSM |
|
||||
EXPANSION_MISTS_OF_PANDARIA | EXPANSION_WARLORDS_OF_DRAENOR | EXPANSION_LEGION | EXPANSION_BATTLE_FOR_AZEROTH;
|
||||
|
||||
/**
|
||||
* Returns the time spent logged in in current billing unit. This function is to limit players from playing the game for too long
|
||||
* @return Amount of time left in seconds to play as rested. See details below for clarification. Returns nil for EU and US accounts
|
||||
*/
|
||||
declare function GetBillingTimeRested(): number;
|
||||
|
||||
/**
|
||||
* Returns whether the player is using a trial (free-to-play) account
|
||||
*/
|
||||
declare function IsTrialAccount(): boolean
|
||||
268
declarations/achivement.d.ts
vendored
Normal file
268
declarations/achivement.d.ts
vendored
Normal file
@@ -0,0 +1,268 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
/// <reference path="unit.d.ts" />
|
||||
|
||||
/**
|
||||
* Achievement links are returned by GetAchievementLink().
|
||||
* @example |cffffff00|Hachievement:2186:00000000002FDDE9:1:12:19:8:4294967295:4294967295:4294967295:4294967295|h[The Immortal]|h|r
|
||||
*/
|
||||
declare type AchivementLink = Hyperlink;
|
||||
|
||||
/**
|
||||
* Marks an achievement for tracking in the WatchFrame.
|
||||
*
|
||||
* @param achivementId ID of the achievement to add to tracking
|
||||
* @event TRACKED_ACHIEVEMENT_UPDATE
|
||||
*/
|
||||
declare function AddTrackedAchievement(achivementId: number): void;
|
||||
|
||||
/**
|
||||
* Returns whether account-wide achievements are hidden from other players
|
||||
*
|
||||
* @returns true if other players cannot view your account-level achievements; false otherwise
|
||||
*/
|
||||
declare function AreAccountAchievementsHidden(): boolean;
|
||||
|
||||
/**
|
||||
* Returns if the AchievementUI can be displayed
|
||||
*
|
||||
* @returns true if the achievement data is available (and hence the AchievementUI can be displayed), false otherwise
|
||||
*/
|
||||
declare function CanShowAchievementUI(): boolean;
|
||||
|
||||
/**
|
||||
* Returns the category number the requested achievement belongs to
|
||||
*
|
||||
* @param achivementId ID of the achievement to retrieve information for
|
||||
* @returns ID of the achievement's category.
|
||||
*/
|
||||
declare function GetAchievementCategory(achivementId: number): number;
|
||||
|
||||
/**
|
||||
* Returns information about the comparison unit's achievements
|
||||
*
|
||||
* @param achivementId ID of the achievement to retrieve information for
|
||||
* @see https://wow.gamepedia.com/API_GetAchievementComparisonInfo
|
||||
*/
|
||||
declare function GetAchievementComparisonInfo(achivementId: number): MultipleReturnValues<boolean, number, number, number>;
|
||||
|
||||
/**
|
||||
* Returns information about the given Achievement's specified criteria
|
||||
*
|
||||
* @param achivementId Achievement ID the queried criteria belongs to
|
||||
* @param criteriaIndex Index of the criteria to query, ascending from 1 up to GetAchievementNumCriteria(achievementID).
|
||||
* @see https://wow.gamepedia.com/API_GetAchievementCriteriaInfo
|
||||
*/
|
||||
declare function GetAchievementCriteriaInfo(achivementId: number, criteriaIndex: number): MultipleReturnValues<string, number, boolean, number, number, string, number, number, string, number, boolean>;
|
||||
|
||||
/**
|
||||
* Returns information about the given Achievement's specified criteria
|
||||
*
|
||||
* @param achivementId Achievement ID the queried criteria belongs to
|
||||
* @param criteriaId Index of the criteria to query, ascending from 1 up to GetAchievementNumCriteria(achievementID).
|
||||
* @see https://wow.gamepedia.com/API_GetAchievementCriteriaInfoByID
|
||||
*/
|
||||
declare function GetAchievementCriteriaInfoByID(achivementId: number, criteriaId: number): MultipleReturnValues<string, number, boolean, number, string, number, number, string, number, boolean>;
|
||||
|
||||
/**
|
||||
* Returns information about the given Achievement
|
||||
*
|
||||
* @param achivementId ID of the achievement to retrieve information for
|
||||
* @param index An offset into the achievement category, between 1 and GetCategoryNumAchievements(categoryID)
|
||||
* @see https://wow.gamepedia.com/API_GetAchievementInfo
|
||||
*/
|
||||
declare function GetAchievementInfo(achivementId: number, index: number): MultipleReturnValues<number, string, number, boolean, number, number, number, string, number, number, string, boolean, boolean, string>;
|
||||
declare function GetAchievementInfo(categoryId: number, index: number): MultipleReturnValues<number, string, number, boolean, number, number, number, string, number, number, string, boolean, boolean, string>;
|
||||
|
||||
/**
|
||||
* Returns a achievementLink for the specified Achievement
|
||||
*
|
||||
* @param achivementId The ID of the Achievement
|
||||
* @see https://wow.gamepedia.com/API_GetAchievementLink
|
||||
*/
|
||||
declare function GetAchievementLink(achivementId: number): AchivementLink;
|
||||
|
||||
/**
|
||||
* Returns the number of criteria for the given Achievement
|
||||
*
|
||||
* @param achivementId The ID of the Achievement
|
||||
* @see https://wow.gamepedia.com/API_GetAchievementNumCriteria
|
||||
*/
|
||||
declare function GetAchievementNumCriteria(achivementId: number): number;
|
||||
|
||||
/**
|
||||
* Returns information about the given Category
|
||||
*
|
||||
* @param categoryId The ID of the category to get the info for.
|
||||
* @see https://wow.gamepedia.com/API_GetCategoryInfo
|
||||
*/
|
||||
declare function GetCategoryInfo(categoryId: number): MultipleReturnValues<string, number, number>;
|
||||
|
||||
/**
|
||||
* Returns the list of Achievement categories
|
||||
*
|
||||
* @returns array containing achievement category IDs, in no particular order
|
||||
* @see https://wow.gamepedia.com/API_GetCategoryList
|
||||
*/
|
||||
declare function GetCategoryList(): number[];
|
||||
|
||||
/**
|
||||
* Returns the total, completed and incompleted number of achievements in a specific category
|
||||
*
|
||||
* @param categoryId Achievement category ID, as returned by GetCategoryList.
|
||||
* @param includeAll If true-equivalent, include all achievements, otherwise, only includes those currently visible
|
||||
* @see https://wow.gamepedia.com/API_GetCategoryNumAchievements
|
||||
*/
|
||||
declare function GetCategoryNumAchievements(categoryId: number, includeAll?: boolean): MultipleReturnValues<number, number, number>;
|
||||
|
||||
/**
|
||||
* Return the value of the requested Statistic from the comparison unit
|
||||
*
|
||||
* @param achivementId The ID of the Achievement
|
||||
* @returns The value of the requested Statistic from the comparison unit
|
||||
* @see https://wow.gamepedia.com/API_GetComparisonStatistic
|
||||
*/
|
||||
declare function GetComparisonStatistic(achivementId: number): string;
|
||||
|
||||
/**
|
||||
* Returns the ID of a filtered achievement, resulting from a call to SetAchievementSearchString.
|
||||
*
|
||||
* @param index The index of the filtered achievement to return the ID of, between 1 and GetNumFilteredAchievements().
|
||||
* @returns The ID of an achievement.
|
||||
* @see https://wow.gamepedia.com/API_GetFilteredAchievementID
|
||||
* @since 7.0.3
|
||||
*/
|
||||
declare function GetFilteredAchievementID(index: number): number;
|
||||
|
||||
/**
|
||||
* Return the next achievement in a chain
|
||||
*
|
||||
* @param achivementId The ID of the Achievement
|
||||
* @returns The ID of the next Achievement in chain or nil
|
||||
* @see https://wow.gamepedia.com/API_GetNextAchievement
|
||||
*/
|
||||
declare function GetNextAchievement(achivementId: number): number | null;
|
||||
|
||||
/**
|
||||
* Returns the number of completed achievements for the comparison player
|
||||
*
|
||||
* @param achivementId ID of the achievement to retrieve information for
|
||||
* @see https://wow.gamepedia.com/API_GetNumComparisonCompletedAchievements
|
||||
*/
|
||||
declare function GetNumComparisonCompletedAchievements(achivementId: number): MultipleReturnValues<number, number>;
|
||||
|
||||
/**
|
||||
* Return the total number of Achievements, and number completed
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_GetNumCompletedAchievements
|
||||
*/
|
||||
declare function GetNumCompletedAchievements(): MultipleReturnValues<number, number>;
|
||||
|
||||
/**
|
||||
* Returns the number of achievements that match the search string specified calling SetAchievementSearchString
|
||||
*
|
||||
* @returns The number of achievements that match the search string
|
||||
* @see https://wow.gamepedia.com/API_GetNumFilteredAchievements
|
||||
* @since 7.0.3
|
||||
*/
|
||||
declare function GetNumFilteredAchievements(): number;
|
||||
|
||||
/**
|
||||
* Return the previous achievement in a chain
|
||||
*
|
||||
* @param achivementId The ID of the Achievement
|
||||
* @returns The ID of the previous Achievement in chain or nil
|
||||
* @see https://wow.gamepedia.com/API_GetPreviousAchievement
|
||||
*/
|
||||
declare function GetPreviousAchievement(achivementId: number): number | null;
|
||||
|
||||
/**
|
||||
* Return the value of the requested Statistic
|
||||
*
|
||||
* @param achievementId The ID of the Achievement
|
||||
* @returns The value of the requested Statistic
|
||||
* @see https://wow.gamepedia.com/API_GetStatistic
|
||||
*/
|
||||
declare function GetStatistic(achievementId: number): WowUnknownStringKeyTable;
|
||||
|
||||
/**
|
||||
* Returns a table of achievement categories
|
||||
*
|
||||
* @returns list of all the categories
|
||||
* @see https://wow.gamepedia.com/API_GetStatisticsCategoryList
|
||||
*/
|
||||
declare function GetStatisticsCategoryList(): WowUnknownNumberKeyTable;
|
||||
|
||||
/**
|
||||
* Returns the total number of Achievement Points earned
|
||||
*
|
||||
* @returns Total points earned
|
||||
* @see https://wow.gamepedia.com/API_GetTotalAchievementPoints
|
||||
*/
|
||||
declare function GetTotalAchievementPoints(): number;
|
||||
|
||||
/**
|
||||
* Returns a list of (up to 10) currently tracked achievements
|
||||
*
|
||||
* @returns achievementId(s) of achievements you are currently tracking
|
||||
* @see https://wow.gamepedia.com/API_GetTrackedAchievements
|
||||
* @since 3.0.2
|
||||
*/
|
||||
declare function GetTrackedAchievements(): MultipleReturnValues<number, number, number, number, number, number, number, number, number, number>;
|
||||
|
||||
/**
|
||||
* Returns the total number of tracked achievements
|
||||
*
|
||||
* @returns number of achievements you are currently tracking, up to 10.
|
||||
* @see https://wow.gamepedia.com/API_GetNumTrackedAchievements
|
||||
* @since 3.1.0
|
||||
*/
|
||||
declare function GetNumTrackedAchievements(): number;
|
||||
|
||||
/**
|
||||
* Indicates whether the specified achievement is eligible to be completed
|
||||
*
|
||||
* @param achievementId ID of the achievement to query
|
||||
* @see https://wow.gamepedia.com/API_IsAchievementEligible
|
||||
* @since 4.0.1
|
||||
*/
|
||||
declare function IsAchievementEligible(achievementId: number): WowUnknown;
|
||||
|
||||
/**
|
||||
* Un-marks an achievement for tracking in the WatchFrame
|
||||
*
|
||||
* @param achievementId ID of the achievement to add to tracking
|
||||
* @see https://wow.gamepedia.com/API_RemoveTrackedAchievement
|
||||
* @event TRACKED_ACHIEVEMENT_UPDATE
|
||||
* @since 3.1.0
|
||||
*/
|
||||
declare function RemoveTrackedAchievement(achievementId: number): void;
|
||||
|
||||
/**
|
||||
* Sets the unit to be compared to.
|
||||
*
|
||||
* @param unit unit to query, e.g. "target"
|
||||
* @returns Returns true/false depending on whether the unit is valid
|
||||
* @see https://wow.gamepedia.com/API_SetAchievementComparisonUnit
|
||||
* @event INSPECT_ACHIEVEMENT_READY
|
||||
*/
|
||||
declare function SetAchievementComparisonUnit(unit: WowUnitId): boolean;
|
||||
|
||||
/**
|
||||
* Starts a search for achievements containing the specified text
|
||||
*
|
||||
* @param searchText Text to search for in the achievements
|
||||
* @returns true if the search is finished, false otherwise
|
||||
* @event ACHIEVEMENT_SEARCH_UPDATED
|
||||
* @see https://wow.gamepedia.com/API_SetAchievementSearchString
|
||||
* @since 7.0.3
|
||||
*/
|
||||
declare function SetAchievementSearchString(searchText: string): boolean;
|
||||
|
||||
/**
|
||||
* Sets whether account-wide achievements are shown to other players
|
||||
*
|
||||
* @param show true to allow other players to view all achievements your account has achieved, false to only allow viewing achievements for individual characters
|
||||
* @see https://wow.gamepedia.com/API_ShowAccountAchievements
|
||||
* @since 5.0.4
|
||||
*/
|
||||
declare function ShowAccountAchievements(show: boolean): void;
|
||||
285
declarations/action.d.ts
vendored
Normal file
285
declarations/action.d.ts
vendored
Normal file
@@ -0,0 +1,285 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
/// <reference path="ui.d.ts" />
|
||||
|
||||
/**
|
||||
* Presses the specified FrameXML action button
|
||||
*
|
||||
* @param buttonId The button ID of the button to push
|
||||
* @see https://wow.gamepedia.com/API_ActionButtonDown
|
||||
* @private PROTECTED UI
|
||||
*/
|
||||
declare function ActionButtonDown(buttonId: number): void;
|
||||
|
||||
/**
|
||||
* Releases the specified action button
|
||||
*
|
||||
* @param buttonId The button ID of the button to release (Integers from 1 to 12)
|
||||
* @see https://wow.gamepedia.com/API_ActionButtonUp
|
||||
* @private PROTECTED UI
|
||||
*/
|
||||
declare function ActionButtonUp(buttonId: number): void;
|
||||
|
||||
/**
|
||||
* Returns true if the action has a numeric range requirement.
|
||||
*
|
||||
* @param slotId The slot ID to test
|
||||
* @returns True if the specified slot contains an action which has a numeric range requirement
|
||||
* @see https://wow.gamepedia.com/API_ActionHasRange
|
||||
*/
|
||||
declare function ActionHasRange(slotId: ActionBarSlotId): boolean;
|
||||
|
||||
/**
|
||||
* Begin "Left click" in the 3D world
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_CameraOrSelectOrMoveStart
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function CameraOrSelectOrMoveStart(): void;
|
||||
|
||||
/**
|
||||
* End "Left click" in the 3D game world
|
||||
*
|
||||
* @param stickyFlag If present and set then any camera offset is 'sticky' and remains until explicitly cancelled
|
||||
* @see https://wow.gamepedia.com/API_CameraOrSelectOrMoveStop
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function CameraOrSelectOrMoveStop(stickyFlag?: WowUnknown): void;
|
||||
|
||||
/**
|
||||
* Changes the current action button to the one specified in the arguments
|
||||
*
|
||||
* @param actionBarPage Which page of your action bar to switch to. Expects an integer 1-6.
|
||||
* @see https://wow.gamepedia.com/API_ChangeActionBarPage
|
||||
* @private NOCOMBAT
|
||||
*/
|
||||
declare function ChangeActionBarPage(actionBarPage: ActionBarPage): void;
|
||||
|
||||
/**
|
||||
* Returns the index of the currently-selected action bar page
|
||||
*
|
||||
* @returns integer index of the current action bar page, ascending from 1.
|
||||
* @see https://wow.gamepedia.com/API_GetActionBarPage
|
||||
*/
|
||||
declare function GetActionBarPage(): ActionBarPage;
|
||||
|
||||
/**
|
||||
* Gets the toggle states of the extra action bars.
|
||||
*
|
||||
* @returns bottomLeftState, bottomRightState, sideRightState, sideRight2State
|
||||
* @see https://wow.gamepedia.com/API_GetActionBarToggles
|
||||
*/
|
||||
declare function GetActionBarToggles(): MultipleReturnValues<boolean, boolean, boolean, boolean>;
|
||||
|
||||
/**
|
||||
* Returns information about the charges of a charge-accumulating player ability
|
||||
*
|
||||
* @param slotId The action slot to retrieve data from
|
||||
* @returns currentCharges, maxCharges, cooldownStart, cooldownDuration, chargeModRate
|
||||
* @see https://wow.gamepedia.com/API_GetActionCharges
|
||||
*/
|
||||
declare function GetActionCharges(slotId: ActionBarSlotId): MultipleReturnValues<number, number, number, number, number>;
|
||||
|
||||
/**
|
||||
* Retrieves the cooldown data of the action specified
|
||||
*
|
||||
* @param slotId The action slot to retrieve data from
|
||||
* @returns start, duration, enable, modRate
|
||||
* @see https://wow.gamepedia.com/API_GetActionCooldown
|
||||
*/
|
||||
declare function GetActionCooldown(slotId: ActionBarSlotId): MultipleReturnValues<number, number, number, number>;
|
||||
|
||||
/**
|
||||
* Gets the available count for an action, if applicable
|
||||
*
|
||||
* @param slotId The action slot to retrieve data from
|
||||
* @returns The action's count as displayed on the action's icon; e.g. for a potion action, returns the number of potions left. 0, if the action has no count or if the specified action slot is empty
|
||||
* @see https://wow.gamepedia.com/API_GetActionCount
|
||||
*/
|
||||
declare function GetActionCount(slotId: ActionBarSlotId): string | number;
|
||||
|
||||
/**
|
||||
* Returns information about a specific action
|
||||
*
|
||||
* @param slotId Action slot to retrieve information about.
|
||||
* @returns actionType, id, subType
|
||||
* @see https://wow.gamepedia.com/API_GetActionInfo
|
||||
*/
|
||||
declare function GetActionInfo(slotId: ActionBarSlotId): MultipleReturnValues<string, WowUnknown, WowUnknown>;
|
||||
|
||||
/**
|
||||
* Gets the text label for an action
|
||||
*
|
||||
* @param slotId Action slot to retrieve information about
|
||||
* @returns The action's text, if present. Macro actions use their names for their action text. nil, if the slot has no action text, or is empty. Most standard WoW action icons don't have action text
|
||||
* @see https://wow.gamepedia.com/API_GetActionText
|
||||
*/
|
||||
declare function GetActionText(slotId: ActionBarSlotId): string | null;
|
||||
|
||||
/**
|
||||
* Returns the filepath for an action's texture
|
||||
*
|
||||
* @param slotId Action slot to retrieve information about
|
||||
* @returns The texture filepath for the action's icon image. nil, if the slot is empty
|
||||
* @see https://wow.gamepedia.com/API_GetActionTexture
|
||||
*/
|
||||
declare function GetActionTexture(slotId: ActionBarSlotId): WowTexturePath | null;
|
||||
|
||||
/**
|
||||
* Returns the current bonus action bar index
|
||||
*
|
||||
* @returns The current bonus action bar index
|
||||
* @see https://wow.gamepedia.com/API_GetBonusBarOffset
|
||||
*/
|
||||
declare function GetBonusBarOffset(): number;
|
||||
|
||||
/**
|
||||
* Returns the name of the button responsible causing the OnClick handler to fire
|
||||
*
|
||||
* @returns name of the button responsible for the innermost OnClick event. For example, "LeftButton"
|
||||
* @see https://wow.gamepedia.com/API_GetMouseButtonClicked
|
||||
*/
|
||||
declare function GetMouseButtonClicked(): WowMouseButton;
|
||||
|
||||
/**
|
||||
* Tests if an action slot is occupied
|
||||
*
|
||||
* @param slotId The tested action slot
|
||||
* @returns 1, if the slot contains an action. nil, if the slot is empty
|
||||
* @see https://wow.gamepedia.com/API_HasAction
|
||||
*/
|
||||
declare function HasAction(slotId: ActionBarSlotId): WowFlag | null;
|
||||
|
||||
/**
|
||||
* Returns whether an action is in range for use
|
||||
*
|
||||
* @param slotId The action slot to test
|
||||
* @returns nil if the slot has no action, or if the action cannot be used on the current target; 0 if the action is out of range, and 1 otherwise
|
||||
* @see https://wow.gamepedia.com/API_IsActionInRange
|
||||
*/
|
||||
declare function IsActionInRange(slotId: ActionBarSlotId): WowFlag | null;
|
||||
|
||||
/**
|
||||
* Determine whether action slot is an attack action
|
||||
*
|
||||
* @param slotId The action slot to test
|
||||
* @returns nil if the specified slot is not an attack action, or is empty. 1 if the slot is an attack action and should flash red during combat
|
||||
* @see https://wow.gamepedia.com/API_IsAttackAction
|
||||
*/
|
||||
declare function IsAttackAction(slotId: ActionBarSlotId): WowFlag | null;
|
||||
|
||||
/**
|
||||
* Determine whether action slot is auto repeating
|
||||
*
|
||||
* @param slotId The action slot to test
|
||||
* @returns 1 if the action in the slot is currently auto-repeating, nil if it is not auto-repeating or the slot is empty
|
||||
* @see https://wow.gamepedia.com/API_IsAutoRepeatAction
|
||||
*/
|
||||
declare function IsAutoRepeatAction(slotId: ActionBarSlotId): WowFlag | null;
|
||||
|
||||
/**
|
||||
* Determine whether an action is currently executing
|
||||
*
|
||||
* @param slotId action slot ID to query.
|
||||
* @returns 1 if the action in the slot is currently executing, nil otherwise
|
||||
* @see https://wow.gamepedia.com/API_IsCurrentAction
|
||||
*/
|
||||
declare function IsCurrentAction(slotId: ActionBarSlotId): WowFlag | null;
|
||||
|
||||
/**
|
||||
* Tests if the action is linked to a consumable item
|
||||
*
|
||||
* @param slotId The tested action slot
|
||||
* @returns True if the action in the specified slot is linked to a consumable, e.g. a potion action. Consumable actions have a small number displayed in the bottom right corner of their action icon. False if the action is not consumable or if the action is empty
|
||||
* @see https://wow.gamepedia.com/API_IsConsumableAction
|
||||
*/
|
||||
declare function IsConsumableAction(slotId: ActionBarSlotId): boolean;
|
||||
|
||||
/**
|
||||
* An equip action is created if you drag a weapon from the Inventory to an action bar slot. If you click this action to equip the weapon, the action icon will obtain a green outline. It is in this case that IsEquippedAction() returns 1. All other cases (e.g. empty slot, non-equip action, equip action is of the current weapon but hasn't been used yet) will return nil.
|
||||
*
|
||||
* @param slotId The tested action
|
||||
* @returns 1 if the specified action is an action that equips a weapon and if the action has been used to equip the current weapon. nil otherwise
|
||||
* @see https://wow.gamepedia.com/API_IsEquippedAction
|
||||
*/
|
||||
declare function IsEquippedAction(slotId: ActionBarSlotId): WowFlag | null;
|
||||
|
||||
/**
|
||||
* Determine if an action can be used (you have sufficient mana, reagents and the action is not on cooldown).
|
||||
*
|
||||
* @param slotId Action slot to query
|
||||
* @returns isUsable, notEnoughMana
|
||||
* @see https://wow.gamepedia.com/API_IsUsableAction
|
||||
*/
|
||||
declare function IsUsableAction(slotId: ActionBarSlotId): MultipleReturnValues<boolean, boolean>;
|
||||
|
||||
/**
|
||||
* Determine if player has a pet with an action bar.
|
||||
*
|
||||
* @returns nil if the player has no pet (or the pet has no action bar), 1 if a pet action bar should be shown
|
||||
* @see https://wow.gamepedia.com/API_PetHasActionBar
|
||||
*/
|
||||
declare function PetHasActionBar(): WowFlag | null;
|
||||
|
||||
/**
|
||||
* Pick up an action for drag-and-drop
|
||||
*
|
||||
* @param slotId The action slot to pick the action up from
|
||||
* @see https://wow.gamepedia.com/API_PickupAction
|
||||
* @private PROTECTED NOCOMBAT
|
||||
*/
|
||||
declare function PickupAction(slotId: ActionBarSlotId): void;
|
||||
|
||||
/**
|
||||
* Pick up a pet action for drag-and-drop
|
||||
*
|
||||
* @param petSlotId The pet action slot to pick the action up from (1-10).
|
||||
* @see https://wow.gamepedia.com/API_PickupPetAction
|
||||
* @private PROTECTED NOCOMBAT
|
||||
*/
|
||||
declare function PickupPetAction(petSlotId: SlotActionBarPet): void;
|
||||
|
||||
/**
|
||||
* Place the drag-and-drop item as an action
|
||||
*
|
||||
* @param slotId The action slot to place the action into.
|
||||
* @see https://wow.gamepedia.com/API_PlaceAction
|
||||
*/
|
||||
declare function PlaceAction(slotId: ActionBarSlotId): void;
|
||||
|
||||
/**
|
||||
* Set the desired state of the extra action bars
|
||||
*
|
||||
* @param bottomLeftState 1 if the left-hand bottom action bar is to be shown, 0 or nil otherwise.
|
||||
* @param bottomRightState 1 if the right-hand bottom action bar is to be shown, 0 or nil otherwise.
|
||||
* @param sideRightState 1 if the first (outer) right side action bar is to be shown, 0 or nil otherwise.
|
||||
* @param sideRight2State 1 if the second (inner) right side action bar is to be shown, 0 or nil otherwise
|
||||
* @param alwaysShow 1 if the bars are always shown, 0 or nil otherwise.
|
||||
* @see https://wow.gamepedia.com/API_SetActionBarToggles
|
||||
*/
|
||||
declare function SetActionBarToggles(bottomLeftState: WowFlag, bottomRightState: WowFlag, sideRightState: WowFlag, sideRight2State: WowFlag, alwaysShow: WowFlag): void;
|
||||
|
||||
/**
|
||||
* Begin "Right click" in the 3D game world.
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_TurnOrActionStart
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function TurnOrActionStart(): void;
|
||||
|
||||
/**
|
||||
* End "Right click" in the 3D game world
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_TurnOrActionStop
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function TurnOrActionStop(): void;
|
||||
|
||||
/**
|
||||
* Perform the action in the specified action slot
|
||||
*
|
||||
* @param slot The action action slot to use
|
||||
* @param checkCursor Can be 0, 1, or nil. Appears to indicate whether the action button was clicked (1) or used via hotkey (0); probably involved in placing skills/items in the action bar after they've been picked up. I can confirm this. If you pass 0 for checkCursor, it will use the action regardless of whether another item/skill is on the cursor. If you pass 1 for checkCursor, it will replace the spell/action on the slot with the new one.
|
||||
* @param onSelf Can be 0, 1, or nil. If present and 1, then the action is performed on the player, not the target. If "true" is passed instead of 1, Blizzard produces a Lua error.
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function UseAction(slot: ActionBarSlotId, checkCursor?: WowFlag, onSelf?: WowFlag): void;
|
||||
183
declarations/activity.d.ts
vendored
Normal file
183
declarations/activity.d.ts
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
|
||||
/**
|
||||
* Accept the challenge to a duel.
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_AcceptDuel
|
||||
*/
|
||||
declare function AcceptDuel(): void;
|
||||
|
||||
/**
|
||||
* Toggles auto-attacking of the player's current target
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_AttackTarget
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function AttackTarget(): void;
|
||||
|
||||
/**
|
||||
* Forfeits the current duel, or declines an invitation to duel
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_CancelDuel
|
||||
*/
|
||||
declare function CancelDuel(): void;
|
||||
|
||||
/**
|
||||
* Cancels the logout timer (from camping or quitting).
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_CancelLogout
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function CancelLogout(): void;
|
||||
|
||||
/**
|
||||
* Rejects a summon request
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_CancelSummon
|
||||
*/
|
||||
declare function CancelSummon(): void;
|
||||
|
||||
/**
|
||||
* Accepts a summon request (only works during the two minutes the summon is available).
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_ConfirmSummon
|
||||
*/
|
||||
declare function ConfirmSummon(): void;
|
||||
|
||||
/**
|
||||
* The player stops descending (while flying or swimming).
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_DescendStop
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function DescendStop(): void;
|
||||
|
||||
/**
|
||||
* Dismounts the player if the player was mounted
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_Dismount
|
||||
* @since 2.0.3
|
||||
*/
|
||||
declare function Dismount(): void;
|
||||
|
||||
/**
|
||||
* Instantly quits the game, bypassing the usual 20 seconds countdown
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_ForceQuit
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function ForceQuit(): void;
|
||||
|
||||
/**
|
||||
* Returns which type of weapon the player currently has unsheathed, if any
|
||||
*
|
||||
* @returns 1=None, 2=Melee, 3=Ranged
|
||||
* @see https://wow.gamepedia.com/API_GetSheathState
|
||||
* @since 4.3.0
|
||||
*/
|
||||
declare function GetSheathState(): 1 | 2 | 3;
|
||||
|
||||
/**
|
||||
* Returns the amount of time left on your PVP flag
|
||||
*
|
||||
* @returns Amount of time (in milliseconds) until your PVP flag wears off.
|
||||
* @see https://wow.gamepedia.com/API_GetPVPTimer
|
||||
*/
|
||||
declare function GetPVPTimer(): number;
|
||||
|
||||
/**
|
||||
* Returns the name of the area you're being summoned to
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_GetSummonConfirmAreaName
|
||||
*/
|
||||
declare function GetSummonConfirmAreaName(): WowUnknown;
|
||||
|
||||
/**
|
||||
* Get the name of the unit which initiated the players summon
|
||||
*
|
||||
* @returns Name of the player summoning you, or nil if no summon is currently pending
|
||||
* @see https://wow.gamepedia.com/API_GetSummonConfirmSummoner
|
||||
*/
|
||||
declare function GetSummonConfirmSummoner(): string;
|
||||
|
||||
/**
|
||||
* Returns the amount of time left before the pending summon expires
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_GetSummonConfirmTimeLeft
|
||||
*/
|
||||
declare function GetSummonConfirmTimeLeft(): WowUnknown;
|
||||
|
||||
/**
|
||||
* Logs the player character out of the game.
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_Logout
|
||||
* @event PLAYER_CAMPING
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function Logout(): void;
|
||||
|
||||
/**
|
||||
* Quits the game.
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_Quit
|
||||
* @event PLAYER_QUITING
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function Quit(): void;
|
||||
|
||||
/**
|
||||
* Performs a random roll between two numbers
|
||||
*
|
||||
* @param low lowest number (default 1)
|
||||
* @param high highest number (default 100)
|
||||
* @description Yield: <Your name> rolls. <number> (1-10)
|
||||
* @see https://wow.gamepedia.com/API_RandomRoll
|
||||
*/
|
||||
declare function RandomRoll(low?: number, high?: number): void;
|
||||
|
||||
/**
|
||||
* Used to toggle PVP on or Off
|
||||
*
|
||||
* @param flag 0 or 1; 0 Toggles PVP off, 1 Toggles PVP on.
|
||||
* @see https://wow.gamepedia.com/API_SetPVP
|
||||
*/
|
||||
declare function SetPVP(flag: WowFlag | null): void;
|
||||
|
||||
/**
|
||||
* The player sits, stands, or begins to descend (while swimming or flying)
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_SitStandOrDescendStart
|
||||
* @since 2.1.0
|
||||
* @private PROTECTED
|
||||
*/
|
||||
declare function SitStandOrDescendStart(): void;
|
||||
|
||||
/**
|
||||
* Invites the specified player to a duel
|
||||
*
|
||||
* @param playerName The name of the player you wish to duel
|
||||
* @see https://wow.gamepedia.com/API_StartDuel
|
||||
*/
|
||||
declare function StartDuel(playerName: string): void;
|
||||
|
||||
/**
|
||||
* Toggles PvP setting on or off
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_TogglePVP
|
||||
*/
|
||||
declare function TogglePVP(): void;
|
||||
|
||||
/**
|
||||
* Toggles sheathed or unsheathed weapons
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_ToggleSheath
|
||||
* @event UNIT_MODEL_CHANGED
|
||||
*/
|
||||
declare function ToggleSheath(): void;
|
||||
|
||||
/**
|
||||
* Use an active soulstone to resurrect yourself after death. Also works for Shamans with Reincarnation available
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_UseSoulstone
|
||||
*/
|
||||
declare function UseSoulstone(): void;
|
||||
191
declarations/addon.d.ts
vendored
Normal file
191
declarations/addon.d.ts
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
|
||||
/**
|
||||
* Addon is banned by the client
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_BANNED = "BANNED";
|
||||
|
||||
/**
|
||||
* The addon's file(s) are corrupt
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_CORRUPT = "CORRUPT";
|
||||
|
||||
/**
|
||||
* Addon's dependency is banned by the client
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_DEP_BANNED = "DEP_BANNED";
|
||||
|
||||
/**
|
||||
* The addon's dependency cannot load because its file(s) are corrupt
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_DEP_CORRUPT = "DEP_CORRUPT";
|
||||
|
||||
/**
|
||||
* The addon cannot load without its dependency enabled
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_DEP_DISABLED = "DEP_DISABLED";
|
||||
|
||||
/**
|
||||
* The addon cannot load if its dependency cannot load
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_DEP_INCOMPATIBLE = "DEP_INCOMPATIBLE";
|
||||
|
||||
/**
|
||||
* The addon's dependency is physically not there
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_DEP_MISSING = "DEP_MISSING";
|
||||
|
||||
/**
|
||||
* The addon's dependency must be loadable on demand too
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_DEP_NOT_DEMAND_LOADED = "DEP_NOT_DEMAND_LOADED";
|
||||
|
||||
/**
|
||||
* Addon is disabled on the character select screen
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_DISABLED = "DISABLED";
|
||||
|
||||
/**
|
||||
* The addon is too old.
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_INCOMPATIBLE = "INCOMPATIBLE";
|
||||
|
||||
/**
|
||||
* The addon is physically not there
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_MISSING = "MISSING";
|
||||
|
||||
/**
|
||||
* As of 1.8 only addons marked as LoadOnDemand can be loaded via this function
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_NOT_DEMAND_LOADED = "NOT_DEMAND_LOADED";
|
||||
|
||||
/**
|
||||
* Unknown, presumably the interface version in the .toc file is incorrect
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON_INTERFACE_VERSION = "INTERFACE_VERSION";
|
||||
|
||||
/**
|
||||
* all possible load error reasons
|
||||
*/
|
||||
declare type ADDON_LOAD_REASON = ADDON_LOAD_REASON_BANNED | ADDON_LOAD_REASON_CORRUPT | ADDON_LOAD_REASON_DEP_BANNED | ADDON_LOAD_REASON_DEP_CORRUPT |
|
||||
ADDON_LOAD_REASON_DEP_DISABLED | ADDON_LOAD_REASON_DEP_INCOMPATIBLE | ADDON_LOAD_REASON_DEP_MISSING | ADDON_LOAD_REASON_DEP_NOT_DEMAND_LOADED |
|
||||
ADDON_LOAD_REASON_DISABLED | ADDON_LOAD_REASON_INCOMPATIBLE | ADDON_LOAD_REASON_MISSING | ADDON_LOAD_REASON_NOT_DEMAND_LOADED | ADDON_LOAD_REASON_INTERFACE_VERSION;
|
||||
|
||||
/**
|
||||
* Disable an AddOn for subsequent sessions
|
||||
*
|
||||
* @param index The index of the AddOn to disable in the user's AddOn list, from 1 to GetNumAddOns().
|
||||
* @see https://wow.gamepedia.com/API_DisableAddOn
|
||||
*/
|
||||
declare function DisableAddOn(index: number): void;
|
||||
|
||||
/**
|
||||
* Disable an AddOn for subsequent sessions
|
||||
*
|
||||
* @param name The name of the AddOn to be disabled
|
||||
* @param character The name of the character (without realm) for whom to disable the addon. Defaults to the current character
|
||||
* @see https://wow.gamepedia.com/API_DisableAddOn
|
||||
*/
|
||||
declare function DisableAddOn(name: string, character?: string): void;
|
||||
|
||||
/**
|
||||
* Disable all AddOns for subsequent sessions
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_DisableAllAddOns
|
||||
*/
|
||||
declare function DisableAllAddOns(): void;
|
||||
|
||||
/**
|
||||
* Enable an AddOn for subsequent sessions
|
||||
*
|
||||
* @param indexOrName The index of the AddOn to enable in the user's AddOn list OR The name of the AddOn to be enabled
|
||||
* @see https://wow.gamepedia.com/API_EnableAddOn
|
||||
*/
|
||||
declare function EnableAddOn(indexOrName: number | string): void;
|
||||
|
||||
/**
|
||||
* Enable all AddOns for subsequent sessions
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_EnableAllAddOns
|
||||
*/
|
||||
declare function EnableAllAddOns(): void;
|
||||
|
||||
/**
|
||||
* Get the required dependencies for an AddOn
|
||||
*
|
||||
* @param indexOrName The index of the AddOn in the user's AddOn list. Note that you cannot access Blizzard-provided AddOns through this mechanism. OR The name of the AddOn to be queries. You can access Blizzard-provided AddOns through this mechanism
|
||||
* @returns Name of an addon the specified addon lists as a required dependency
|
||||
* @see https://wow.gamepedia.com/API_GetAddOnDependencies
|
||||
*/
|
||||
declare function GetAddOnDependencies(indexOrName: number | string): MultipleReturnValues<string, string, string, string, string, string, string, string, string, string>;
|
||||
|
||||
/**
|
||||
* Unknown
|
||||
*
|
||||
* @param character Unknown
|
||||
* @param addonIndex Unknown
|
||||
* @see https://wow.gamepedia.com/API_GetAddOnEnableState
|
||||
*/
|
||||
declare function GetAddOnEnableState(character: WowUnknown, addonIndex: WowUnknown): WowUnknown;
|
||||
|
||||
/**
|
||||
* Get information about an AddOn
|
||||
*
|
||||
* @param indexOrName The index of the AddOn in the user's AddOn list. Note that you cannot access Blizzard-provided AddOns through this mechanism OR The name of the AddOn to be queried. You can access Blizzard-provided AddOns through this mechanism
|
||||
* @returns name, title, notes, loadable, reason, security, newVersion
|
||||
* @see https://wow.gamepedia.com/API_GetAddOnInfo
|
||||
*/
|
||||
declare function GetAddOnInfo(indexOrName: number | string): MultipleReturnValues<string, string, string, boolean, ADDON_LOAD_REASON, string, boolean>;
|
||||
|
||||
/**
|
||||
* get addon metadata from the toc file
|
||||
*
|
||||
* @param addonNameOrIndex Addon name to look up metadata for
|
||||
* @param field Field name. May be Title, Notes, Author, Version, or anything starting with X-
|
||||
* @returns The value of the field, nil if not defined.
|
||||
* @see https://wow.gamepedia.com/API_GetAddOnMetadata
|
||||
*/
|
||||
declare function GetAddOnMetadata(addonNameOrIndex: string | number, field: string): string | null;
|
||||
|
||||
/**
|
||||
* Returns a list of optional dependencies
|
||||
*
|
||||
* @param indexOrName The index of the AddOn in the user's AddOn list. Note that you cannot access Blizzard-provided AddOns through this mechanism. OR The name of the AddOn to be queries. You can access Blizzard-provided AddOns through this mechanism
|
||||
* @see https://wow.gamepedia.com/API_GetAddOnOptionalDependencies
|
||||
*/
|
||||
declare function GetAddOnOptionalDependencies(indexOrName: number | string): MultipleReturnValues<string, string, string, string, string, string, string, string, string, string>;
|
||||
|
||||
/**
|
||||
* Get the number of user supplied AddOns
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_GetNumAddOns
|
||||
*/
|
||||
declare function GetNumAddOns(): number;
|
||||
|
||||
/**
|
||||
* Returns whether an addon has been loaded
|
||||
*
|
||||
* @param indexOrName The index of the addon in the user's addon list. You cannot query Blizzard-provided AddOns using this parameter OR The name of the addon to be queried. You can query Blizzard-provided addon using this parameter
|
||||
* @returns loaded, finished
|
||||
* @see https://wow.gamepedia.com/API_IsAddOnLoaded
|
||||
*/
|
||||
declare function IsAddOnLoaded(indexOrName: number | string): MultipleReturnValues<WowFlag, WowFlag>;
|
||||
|
||||
/**
|
||||
* Determine if an AddOn is loaded on demand (via .toc file dependencies or LoadAddOn) rather than at startup
|
||||
*
|
||||
* @param indexOrName The index of the AddOn in the user's AddOn list. Note that you cannot access Blizzard-provided AddOns through this mechanism. OR The name of the AddOn to be queries. You can access Blizzard-provided AddOns through this mechanism
|
||||
* @returns Indicates if the AddOn is loaded on demand, 1 if it is, nil if it is loaded on startup
|
||||
* @see https://wow.gamepedia.com/API_IsAddOnLoadOnDemand
|
||||
*/
|
||||
declare function IsAddOnLoadOnDemand(indexOrName: number | string): WowFlag;
|
||||
|
||||
/**
|
||||
* Request the loading of an On-Demand AddOn
|
||||
*
|
||||
* @param indexOrName The index of the AddOn in the user's AddOn list. Note that you cannot access Blizzard-provided AddOns through this mechanism. OR The name of the AddOn to be queries. You can access Blizzard-provided AddOns through this mechanism
|
||||
* @returns loaded, reason
|
||||
* @see https://wow.gamepedia.com/API_LoadAddOn
|
||||
*/
|
||||
declare function LoadAddOn(indexOrName: number | string): MultipleReturnValues<WowFlag, ADDON_LOAD_REASON>;
|
||||
236
declarations/archaeology.d.ts
vendored
Normal file
236
declarations/archaeology.d.ts
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
/// <reference path="ui.d.ts" />
|
||||
|
||||
declare type ARCHAELOLOGY_RARITY_COMMON = 0;
|
||||
declare type ARCHAELOLOGY_RARITY_RARE = 1;
|
||||
declare type ARCHAELOLOGY_RARITY = ARCHAELOLOGY_RARITY_COMMON | ARCHAELOLOGY_RARITY_RARE;
|
||||
|
||||
declare type ARCHAELOLOGY_BRANCH_DWARF = 1;
|
||||
declare type ARCHAELOLOGY_BRANCH_DRAENEI = 2;
|
||||
declare type ARCHAELOLOGY_BRANCH_FOSSIL = 3;
|
||||
declare type ARCHAELOLOGY_BRANCH_NIGHT_ELF = 4;
|
||||
declare type ARCHAELOLOGY_BRANCH_NERUBIAN = 5;
|
||||
declare type ARCHAELOLOGY_BRANCH_ORC = 6;
|
||||
declare type ARCHAELOLOGY_BRANCH_TOL_VIR = 7;
|
||||
declare type ARCHAELOLOGY_BRANCH_TROLL = 8;
|
||||
declare type ARCHAELOLOGY_BRANCH_VRYKUL = 27;
|
||||
declare type ARCHAELOLOGY_BRANCH_MANTID = 29;
|
||||
declare type ARCHAELOLOGY_BRANCH_PANDAREN = 229;
|
||||
declare type ARCHAELOLOGY_BRANCH_MOGU = 231;
|
||||
declare type ARCHAELOLOGY_BRANCH_ARAKKOA = 315;
|
||||
declare type ARCHAELOLOGY_BRANCH_DRAENOR_CLANS = 350;
|
||||
declare type ARCHAELOLOGY_BRANCH_OGRE = 382;
|
||||
declare type ARCHAELOLOGY_BRANCH_HIGHBORNE = 404;
|
||||
declare type ARCHAELOLOGY_BRANCH_HIGHMOUNTAIN_TAUREN = 406;
|
||||
declare type ARCHAELOLOGY_BRANCH_DEMONIC = 408;
|
||||
|
||||
/**
|
||||
* all currently known branches
|
||||
*/
|
||||
declare type ARCHAELOLOGY_BRANCH = ARCHAELOLOGY_BRANCH_DWARF | ARCHAELOLOGY_BRANCH_DRAENEI | ARCHAELOLOGY_BRANCH_FOSSIL |
|
||||
ARCHAELOLOGY_BRANCH_NIGHT_ELF | ARCHAELOLOGY_BRANCH_NERUBIAN | ARCHAELOLOGY_BRANCH_ORC | ARCHAELOLOGY_BRANCH_TOL_VIR |
|
||||
ARCHAELOLOGY_BRANCH_TROLL | ARCHAELOLOGY_BRANCH_VRYKUL | ARCHAELOLOGY_BRANCH_MANTID | ARCHAELOLOGY_BRANCH_PANDAREN |
|
||||
ARCHAELOLOGY_BRANCH_MOGU | ARCHAELOLOGY_BRANCH_ARAKKOA | ARCHAELOLOGY_BRANCH_DRAENOR_CLANS | ARCHAELOLOGY_BRANCH_OGRE |
|
||||
ARCHAELOLOGY_BRANCH_HIGHBORNE | ARCHAELOLOGY_BRANCH_HIGHMOUNTAIN_TAUREN | ARCHAELOLOGY_BRANCH_DEMONIC;
|
||||
|
||||
|
||||
/**
|
||||
* Returns how many digsites are in a zone like Azsuna or Elwynn Forest
|
||||
*
|
||||
* @returns the number of digsites the player can use [Survey] on in a zone. The player must actually be in a zone that can be surveyed
|
||||
* @see https://wow.gamepedia.com/API_ArchaeologyMapUpdateAll
|
||||
* @since 5.4.0
|
||||
*/
|
||||
declare function ArchaeologyMapUpdateAll(): number;
|
||||
|
||||
/**
|
||||
* Unknown
|
||||
*
|
||||
* @param index Unknown
|
||||
* @see https://wow.gamepedia.com/API_ArchaeologyGetIconInfo
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function ArchaeologyGetIconInfo(index: WowUnknown): WowUnknown;
|
||||
|
||||
/**
|
||||
* Returns 1 if item could be added to the selected artifact
|
||||
*
|
||||
* @param itemId Unknown
|
||||
* @see https://wow.gamepedia.com/API_CanItemBeSocketedToArtifact
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function CanItemBeSocketedToArtifact(itemId: number): WowFlag;
|
||||
|
||||
/**
|
||||
* Returns whether the player is currently on a digsite
|
||||
*
|
||||
* @returns true if the player is currently on a digsite (and can use [Survey]), false otherwise
|
||||
* @see https://wow.gamepedia.com/API_CanScanResearchSite
|
||||
* @since 5.4.0
|
||||
*/
|
||||
declare function CanScanResearchSite(): boolean;
|
||||
|
||||
/**
|
||||
* Return true if artifact can be solved
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_CanSolveArtifact
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function CanSolveArtifact(): boolean;
|
||||
|
||||
/**
|
||||
* Unknown
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_CloseResearch
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function CloseResearch(): WowUnknown;
|
||||
|
||||
/**
|
||||
* Returns the information for a specific race's active artifact
|
||||
*
|
||||
* @param raceIndex Index of the race to pick the artifact from
|
||||
* @returns artifactName, artifactDescription, artifactRarity, artifactIcon, hoverDescription, keystoneCount, bgTexture
|
||||
* @see https://wow.gamepedia.com/API_GetActiveArtifactByRace
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function GetActiveArtifactByRace(raceIndex: number): MultipleReturnValues<string, string, ARCHAELOLOGY_RARITY, WowTexturePath, string, number, WowTexturePath>;
|
||||
|
||||
/**
|
||||
* Returns the localized name for Archaeology
|
||||
*
|
||||
* @returns Localized name of the Archaeology secondary skill
|
||||
* @see https://wow.gamepedia.com/API_GetArchaeologyInfo
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function GetArchaeologyInfo(): string;
|
||||
|
||||
/**
|
||||
* Returns the information for a specific race used in Archaeology
|
||||
*
|
||||
* @param raceIndex Index of the race to query, between 1 and GetNumArchaeologyRaces().
|
||||
* @returns raceName, raceTexture, raceItemID, numFragmentsCollected, numFragmentsRequired, maxFragments
|
||||
* @see https://wow.gamepedia.com/API_GetArchaeologyRaceInfo
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function GetArchaeologyRaceInfo(raceIndex: number): MultipleReturnValues<string, WowTexturePath, number, number, number, number>;
|
||||
|
||||
/**
|
||||
* Returns information about a branch of Archaeology
|
||||
*
|
||||
* @param branchId ID of the research branch (race) to query.
|
||||
* @returns raceName, raceTextureID, raceItemID, numFragmentsCollected, numFragmentsRequired, maxFragments
|
||||
* @see https://wow.gamepedia.com/API_GetArchaeologyRaceInfoByID
|
||||
* @since 5.4.0
|
||||
*/
|
||||
declare function GetArchaeologyRaceInfoByID(branchId: ARCHAELOLOGY_BRANCH): MultipleReturnValues<string, WowTexturePath, number, number, number, number>;
|
||||
|
||||
/**
|
||||
* Returns the information for a specific race's artifact
|
||||
*
|
||||
* @param raceIndex Index of the race to pick the artifact from
|
||||
* @param artifactIndex Index of the artifact
|
||||
* @returns artifactName, artifactDescription, artifactRarity, artifactIcon, hoverDescription, keystoneCount, bgTexture, firstCompletionTime, completionCount
|
||||
* @see https://wow.gamepedia.com/API_GetArtifactInfoByRace
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function GetArtifactInfoByRace(raceIndex: number, artifactIndex: number): MultipleReturnValues<string, string, ARCHAELOLOGY_RARITY, WowTexturePath, string, number, WowTexturePath, number, number>;
|
||||
|
||||
/**
|
||||
* Returns the number of Archaeology races in the game
|
||||
*
|
||||
* @returns The number of Archaeology races in the game
|
||||
* @see https://wow.gamepedia.com/API_GetNumArchaeologyRaces
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function GetNumArchaeologyRaces(): number;
|
||||
|
||||
/**
|
||||
* Returns the amount of artifacts the player has acquired from the provided race.
|
||||
*
|
||||
* @param raceIndex Index of the race to be selected.
|
||||
* @returns Number of artifacts for that race
|
||||
* @see https://wow.gamepedia.com/API_GetNumArtifactsByRace
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function GetNumArtifactsByRace(raceIndex: number): number;
|
||||
|
||||
/**
|
||||
* Returns the information for the selected race's current archaeology artifact
|
||||
*
|
||||
* @returns artifactName, artifactDescription, artifactRarity, artifactIcon, hoverDescription, keystoneCount, bgTexture, spellId
|
||||
* @see https://wow.gamepedia.com/API_GetSelectedArtifactInfo
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function GetSelectedArtifactInfo(): MultipleReturnValues<string, string, ARCHAELOLOGY_RARITY, WowTexturePath, string, number, WowTexturePath, number>;
|
||||
|
||||
/**
|
||||
* Returns information about current used fragments for the selected artifact
|
||||
*
|
||||
* @returns numFragmentsCollected, numFragmentsAdded, numFragmentsRequired
|
||||
* @see https://wow.gamepedia.com/API_GetArtifactProgress
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function GetArtifactProgress(): MultipleReturnValues<number, number, number>;
|
||||
|
||||
/**
|
||||
* Unknown
|
||||
*
|
||||
* @param args Unknown
|
||||
* @see https://wow.gamepedia.com/API_IsArtifactCompletionHistoryAvailable
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function IsArtifactCompletionHistoryAvailable(...args: WowUnknown[]): WowUnknown;
|
||||
|
||||
/**
|
||||
* Returns if there is a keystone in the artifact
|
||||
*
|
||||
* @param keystoneIndex Unknown
|
||||
* @see https://wow.gamepedia.com/API_ItemAddedToArtifact
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function ItemAddedToArtifact(keystoneIndex: WowUnknown): WowUnknown;
|
||||
|
||||
/**
|
||||
* Set the artifact-pointer to raceIndex
|
||||
*
|
||||
* @param raceIndex Index of the race to select
|
||||
* @see https://wow.gamepedia.com/API_SetSelectedArtifact
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function SetSelectedArtifact(raceIndex: number): void;
|
||||
|
||||
/**
|
||||
* Remove a Keystone from the selected artifact
|
||||
*
|
||||
* @returns True if the keystone is successfully removed
|
||||
* @see https://wow.gamepedia.com/API_RemoveItemFromArtifact
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function RemoveItemFromArtifact(): boolean;
|
||||
|
||||
/**
|
||||
* Queries the server for archeology data. RESEARCH_ARTIFACT_HISTORY_READY is fired when data is available
|
||||
*
|
||||
* @event RESEARCH_ARTIFACT_HISTORY_READY
|
||||
* @see https://wow.gamepedia.com/API_RequestArtifactCompletionHistory
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function RequestArtifactCompletionHistory(): void;
|
||||
|
||||
/**
|
||||
* Socked a Keystone to the selected artifact
|
||||
*
|
||||
* @returns True if the keystone is successfully added
|
||||
* @see https://wow.gamepedia.com/API_SocketItemToArtifact
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function SocketItemToArtifact(): boolean;
|
||||
|
||||
/**
|
||||
* Solve the selected artifact
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_SolveArtifact
|
||||
* @since 4.0.0
|
||||
*/
|
||||
declare function SolveArtifact(): WowUnknown;
|
||||
65
declarations/arena.d.ts
vendored
Normal file
65
declarations/arena.d.ts
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
|
||||
declare type ARENA_TEAM_GREEN = 0;
|
||||
declare type ARENA_TEAM_GOLD = 1;
|
||||
declare type ARENA_TEAM = ARENA_TEAM_GREEN | ARENA_TEAM_GOLD;
|
||||
|
||||
declare type ARENA_ID_2VS2 = 4;
|
||||
declare type ARENA_ID_3VS3 = 5;
|
||||
declare type ARENA_ID = ARENA_ID_2VS2 | ARENA_ID_3VS3;
|
||||
|
||||
/**
|
||||
* Returns information regarding an Arena team
|
||||
*
|
||||
* @param index Which team to get information on, 0 is Green team and 1 is Gold Team
|
||||
* @returns teamName, oldTeamRating, newTeamRating, teamRating
|
||||
* @see https://wow.gamepedia.com/API_GetBattlefieldTeamInfo
|
||||
*/
|
||||
declare function GetBattlefieldTeamInfo(index: ARENA_TEAM): MultipleReturnValues<string, number, number, number>;
|
||||
|
||||
/**
|
||||
* Returns the current arena season. Returns 0 when there is no active season
|
||||
*
|
||||
* @returns Current arena season
|
||||
* @see https://wow.gamepedia.com/API_GetCurrentArenaSeason
|
||||
*/
|
||||
declare function GetCurrentArenaSeason(): number;
|
||||
|
||||
/**
|
||||
* Gets the previous Arena season
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_GetPreviousArenaSeason
|
||||
*/
|
||||
declare function GetPreviousArenaSeason(): WowUnknown;
|
||||
|
||||
/**
|
||||
* Used for checking if the player is inside an arena or if it's a rated match. If you are in waiting room and/or countdown is going on, it will return false
|
||||
*
|
||||
* @returns isArena, isRegistered
|
||||
* @see https://wow.gamepedia.com/API_IsActiveBattlefieldArena
|
||||
*/
|
||||
declare function IsActiveBattlefieldArena(): MultipleReturnValues<boolean, boolean>;
|
||||
|
||||
/**
|
||||
* Returns a value based on whether the player is the arena team captain
|
||||
*
|
||||
* @param index The team index
|
||||
* @see https://wow.gamepedia.com/API_IsArenaTeamCaptain
|
||||
*/
|
||||
declare function IsArenaTeamCaptain(index: ARENA_TEAM): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if you are a member of an arena team.
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_IsInArenaTeam
|
||||
*/
|
||||
declare function IsInArenaTeam(): boolean;
|
||||
|
||||
/**
|
||||
* Queue for a arena either solo or as a group
|
||||
*
|
||||
* @param arenaId The arena id
|
||||
* @param joinAsGroup Unknown
|
||||
* @see https://wow.gamepedia.com/API_JoinSkirmish
|
||||
*/
|
||||
declare function JoinSkirmish(arenaId: ARENA_ID, joinAsGroup?: boolean): void;
|
||||
1
declarations/artifact.d.ts
vendored
Normal file
1
declarations/artifact.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
// @todo: write declarations!
|
||||
184
declarations/auction.d.ts
vendored
Normal file
184
declarations/auction.d.ts
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
/// <reference path="item.d.ts" />
|
||||
|
||||
declare type AUCTION_RUNTIME_12H = 1;
|
||||
declare type AUCTION_RUNTIME_24H = 2;
|
||||
declare type AUCTION_RUNTIME_48H = 3;
|
||||
declare type AUCTION_RUNTIME = AUCTION_RUNTIME_12H | AUCTION_RUNTIME_24H | AUCTION_RUNTIME_48H;
|
||||
|
||||
declare type AUCTION_SALE_STATUS_UNSOLD = 0;
|
||||
declare type AUCTION_SALE_STATUS_SOLD = 1;
|
||||
declare type AUCTION_SALE_STATUS = AUCTION_SALE_STATUS_UNSOLD | AUCTION_SALE_STATUS_SOLD;
|
||||
|
||||
/**
|
||||
* short (less than 30 minutes)
|
||||
*/
|
||||
declare type AUCTION_TIMELEFT_SHORT = 1;
|
||||
|
||||
/**
|
||||
* medium (30 minutes - 2 hours)
|
||||
*/
|
||||
declare type AUCTION_TIMELEFT_MEDIUM = 2;
|
||||
|
||||
/**
|
||||
* long (2 - 12 hours)
|
||||
*/
|
||||
declare type AUCTION_TIMELEFT_LONG = 3;
|
||||
|
||||
/**
|
||||
* very long (more than 12 hours)
|
||||
*/
|
||||
declare type AUCTION_TIMELEFT_VERY_LONG = 4;
|
||||
|
||||
/**
|
||||
* all currently known time left values
|
||||
*/
|
||||
declare type AUCTION_TIMELEFT = AUCTION_TIMELEFT_SHORT | AUCTION_TIMELEFT_MEDIUM | AUCTION_TIMELEFT_LONG | AUCTION_TIMELEFT_VERY_LONG;
|
||||
|
||||
|
||||
/**
|
||||
* An item up for auction, the "Browse" tab in the dialog
|
||||
*/
|
||||
declare type AUCTION_TYPE_LIST = "list";
|
||||
|
||||
/**
|
||||
* An item the player has bid on, the "Bids" tab in the dialog
|
||||
*/
|
||||
declare type AUCTION_TYPE_BIDDER = "bidder";
|
||||
|
||||
/**
|
||||
* An item the player has up for auction, the "Auctions" tab in the dialog
|
||||
*/
|
||||
declare type AUCTION_TYPE_OWNER = "owner";
|
||||
|
||||
/**
|
||||
* the currently known auction types
|
||||
*/
|
||||
declare type AUCTION_TYPE = AUCTION_TYPE_LIST | AUCTION_TYPE_BIDDER | AUCTION_TYPE_OWNER;
|
||||
|
||||
/**
|
||||
* The itemLink of one item in the current retrieved list of items from the Auction House
|
||||
*/
|
||||
declare type AuctionLink = Hyperlink;
|
||||
|
||||
/**
|
||||
* Returns the required deposit for the current selling item given the specified duration (1=12h, 2=24h, 3=48h).
|
||||
*
|
||||
* @param runTime The time to run the auction
|
||||
* @param stackSize the stack size
|
||||
* @param numStacks the amount of stacks to auction
|
||||
* @see https://wow.gamepedia.com/API_CalculateAuctionDeposit
|
||||
*/
|
||||
declare function CalculateAuctionDeposit(runTime: AUCTION_RUNTIME, stackSize: number, numStacks: number): number;
|
||||
|
||||
/**
|
||||
* Returns 1 if auction can be canceled
|
||||
*
|
||||
* @param index the index of the auction
|
||||
* @see https://wow.gamepedia.com/API_CanCancelAuction
|
||||
*/
|
||||
declare function CanCancelAuction(index: number): WowFlag;
|
||||
|
||||
/**
|
||||
* Stops the process of listing multiple stacks of an item on the auction house
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_CancelSell
|
||||
*/
|
||||
declare function CancelSell(): void;
|
||||
|
||||
/**
|
||||
* Determine if a new auction house query can be sent (via QueryAuctionItems())
|
||||
*
|
||||
* @returns canQuery, canQueryAll
|
||||
* @see https://wow.gamepedia.com/API_CanSendAuctionQuery
|
||||
*/
|
||||
declare function CanSendAuctionQuery(): MultipleReturnValues<boolean, boolean>;
|
||||
|
||||
/**
|
||||
* Cancel the specified auction (on the "owner" list).
|
||||
*
|
||||
* @param index the auction index to cancel
|
||||
* @see https://wow.gamepedia.com/API_CancelAuction
|
||||
*/
|
||||
declare function CancelAuction(index: number): WowUnknown;
|
||||
|
||||
/**
|
||||
* In the Auction house, under 'auctions', 'create auction', there is an 'auction item' slot. This function lets you 'drop' your currently 'picked up' item into it. AFAIK It works as long as the 'auction' window is up (the one you get by clicking on the auctioneer).
|
||||
*
|
||||
* @param args Unknown
|
||||
* @see https://wow.gamepedia.com/API_ClickAuctionSellItemButton
|
||||
*/
|
||||
declare function ClickAuctionSellItemButton(...args: WowUnknown[]): WowUnknown;
|
||||
|
||||
/**
|
||||
* Will close the AuctionFrame if opened
|
||||
*
|
||||
* @see https://wow.gamepedia.com/API_CloseAuctionHouse
|
||||
*/
|
||||
declare function CloseAuctionHouse(): void;
|
||||
|
||||
/**
|
||||
* Retrieves info about one Battle Pet in the current retrieved list of Battle Pets from the Auction House
|
||||
*
|
||||
* @param type the type to query
|
||||
* @param index The index of the item in the list to retrieve info from (normally 1-50, inclusive).
|
||||
* @returns creatureID, displayID
|
||||
* @see https://wow.gamepedia.com/API_GetAuctionItemBattlePetInfo
|
||||
* @since 5.0.4
|
||||
*/
|
||||
declare function GetAuctionItemBattlePetInfo(type: AUCTION_TYPE, index: number): MultipleReturnValues<number, number>;
|
||||
|
||||
/**
|
||||
* Retrieves info about one item in the current retrieved list of items from the Auction House
|
||||
*
|
||||
* @param type the type to query
|
||||
* @param index The index of the item in the list to retrieve info from (normally 1-50, inclusive)
|
||||
* @returns name, texture, count, quality, canUse, level, levelColHeader, minBid, minIncrement, buyoutPrice, bidAmount, highBidder, bidderFullName, owner, ownerFullName, saleStatus, itemId, hasAllInfo
|
||||
* @see https://wow.gamepedia.com/API_GetAuctionItemInfo
|
||||
*/
|
||||
declare function GetAuctionItemInfo(type: AUCTION_TYPE, index: number): MultipleReturnValues<string, WowTexturePath, number, ITEM_QUALITY, boolean, number, string, number, number, number, number, boolean, string, string, string, AUCTION_SALE_STATUS, number, WowUnknown>;
|
||||
|
||||
/**
|
||||
* Retrieves the itemLink of one item in the current retrieved list of items from the Auction House
|
||||
*
|
||||
* @param type the type to query
|
||||
* @param index The index of the item in the list to retrieve info from (normally 1-50, inclusive)
|
||||
* @see https://wow.gamepedia.com/API_GetAuctionItemLink
|
||||
*/
|
||||
declare function GetAuctionItemLink(type: AUCTION_TYPE, index: number): AuctionLink;
|
||||
|
||||
/**
|
||||
* Gets a list of the sub-classes for an Auction House item class
|
||||
*
|
||||
* @param categoryIndex Index of the major category to look into, ascending from 1 to #GetAuctionItemClasses
|
||||
* @see https://wow.gamepedia.com/API_GetAuctionItemSubClasses
|
||||
* @returns subClass1, subClass2, subClass3, ...
|
||||
*/
|
||||
declare function GetAuctionItemSubClasses(categoryIndex: number): MultipleReturnValues<string, string, string, string, string, string, string, string, string, string, string, string, string, string, string>;
|
||||
|
||||
/**
|
||||
* Retrieves the time left for a item in the Auction House
|
||||
*
|
||||
* @param type the type to query
|
||||
* @param index The index of the item in the list to retrieve info from (normally 1-50, inclusive)
|
||||
* @see https://wow.gamepedia.com/API_GetAuctionItemTimeLeft
|
||||
*/
|
||||
declare function GetAuctionItemTimeLeft(type: AUCTION_TYPE, index: number): AUCTION_TIMELEFT;
|
||||
|
||||
/**
|
||||
* get information about the currently displayed auction item
|
||||
*
|
||||
* @returns name, texture, count, quality, canUse, price, pricePerUnit, stackCount, totalCount
|
||||
* @see https://wow.gamepedia.com/API_GetAuctionSellItemInfo
|
||||
*/
|
||||
declare function GetAuctionSellItemInfo(): MultipleReturnValues<string, WowTexturePath, number, ITEM_QUALITY, number, number, number, number>;
|
||||
|
||||
/**
|
||||
* Unknown
|
||||
*
|
||||
* @param args Unknown
|
||||
* @see https://wow.gamepedia.com/API_GetAuctionSort
|
||||
*/
|
||||
declare function GetAuctionSort(...args: WowUnknown[]): WowUnknown;
|
||||
|
||||
// @todo: write declarations for GetBidderAuctionItems and following
|
||||
5
declarations/debug.d.ts
vendored
Normal file
5
declarations/debug.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Passes its arguments to the current print output handler.
|
||||
* By default, this will output them all to the default chat frame.
|
||||
*/
|
||||
declare function print(...args: any[]): void;
|
||||
4
declarations/gameClient.d.ts
vendored
Normal file
4
declarations/gameClient.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* get the current game client language
|
||||
*/
|
||||
declare function GetLocale(): string;
|
||||
58
declarations/global.d.ts
vendored
Normal file
58
declarations/global.d.ts
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
declare type EXPANSION_CLASSIC = 0;
|
||||
declare type EXPANSION_BURNING_CRUSADE = 1;
|
||||
declare type EXPANSION_WRATH_OF_THE_LICH_KING = 2;
|
||||
declare type EXPANSION_CATACLYSM = 3;
|
||||
declare type EXPANSION_MISTS_OF_PANDARIA = 4;
|
||||
declare type EXPANSION_WARLORDS_OF_DRAENOR = 5;
|
||||
declare type EXPANSION_LEGION = 6;
|
||||
declare type EXPANSION_BATTLE_FOR_AZEROTH = 7;
|
||||
|
||||
declare type WowUnknown = any;
|
||||
declare type WowUnknownStringKeyTable = { [anyKey: string]: any };
|
||||
declare type WowUnknownNumberKeyTable = { [anyKey: number]: any };
|
||||
|
||||
declare type WowFlag = 0 | 1;
|
||||
|
||||
/**
|
||||
* a texture can be a path to a blp file or a number as fileID
|
||||
*/
|
||||
declare type WowTexturePath = string | number;
|
||||
|
||||
declare type ActionBarPage1 = 1;
|
||||
declare type ActionBarPage2 = 2;
|
||||
declare type ActionBarPage3 = 3;
|
||||
declare type ActionBarPage4 = 4;
|
||||
declare type ActionBarPage5 = 5;
|
||||
declare type ActionBarPage6 = 6;
|
||||
declare type ActionBarPage = ActionBarPage1 | ActionBarPage2 | ActionBarPage3 | ActionBarPage4 | ActionBarPage5 | ActionBarPage6;
|
||||
|
||||
declare type SlotActionBarPet = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
||||
declare type SlotActionBarPage1 = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
||||
declare type SlotActionBarPage2 = 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
|
||||
declare type SlotActionBarPage3 = 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36;
|
||||
declare type SlotActionBarPage4 = 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48;
|
||||
declare type SlotActionBarPage5 = 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60;
|
||||
declare type SlotActionBarPage6 = 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72;
|
||||
declare type SlotActionBarMisc = 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
|
||||
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 |
|
||||
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120;
|
||||
declare type SlotActionBarPossess = 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132;
|
||||
declare type ActionBarSlotId = SlotActionBarPage1 | SlotActionBarPage2 | SlotActionBarPage3 | SlotActionBarPage4 |
|
||||
SlotActionBarPage5 | SlotActionBarPage6 | SlotActionBarMisc | SlotActionBarPossess;
|
||||
|
||||
declare type MultipleReturnValues<
|
||||
A extends Object = undefined, B extends Object = undefined, C extends Object = undefined,
|
||||
D extends Object = undefined, E extends Object = undefined, F extends Object = undefined,
|
||||
G extends Object = undefined, H extends Object = undefined, I extends Object = undefined,
|
||||
J extends Object = undefined, K extends Object = undefined, L extends Object = undefined,
|
||||
M extends Object = undefined, N extends Object = undefined, O extends Object = undefined,
|
||||
P extends Object = undefined, Q extends Object = undefined, R extends Object = undefined,
|
||||
S extends Object = undefined, T extends Object = undefined, U extends Object = undefined,
|
||||
V extends Object = undefined, W extends Object = undefined
|
||||
> = [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W];
|
||||
|
||||
|
||||
/**
|
||||
* the base type for all clickable ingame links in the chat
|
||||
*/
|
||||
declare type Hyperlink = string;
|
||||
14
declarations/index.d.ts
vendored
Normal file
14
declarations/index.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import "./global";
|
||||
|
||||
import "./account";
|
||||
import "./achivement";
|
||||
import "./action";
|
||||
import "./activity";
|
||||
import "./addon";
|
||||
import "./archaeology";
|
||||
import "./arena";
|
||||
import "./debug";
|
||||
import "./gameClient";
|
||||
|
||||
import "./ui";
|
||||
import "./unit";
|
||||
15
declarations/item.d.ts
vendored
Normal file
15
declarations/item.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
declare type ITEM_QUALITY_GENERIC = -1;
|
||||
declare type ITEM_QUALITY_POOR = 0;
|
||||
declare type ITEM_QUALITY_COMMON = 1;
|
||||
declare type ITEM_QUALITY_UNCOMMON = 2;
|
||||
declare type ITEM_QUALITY_RARE = 3;
|
||||
declare type ITEM_QUALITY_EPIC = 4;
|
||||
declare type ITEM_QUALITY_LEGENDARY = 5;
|
||||
declare type ITEM_QUALITY_ARTIFACT = 6;
|
||||
declare type ITEM_QUALITY_HEIRLOOM = 7;
|
||||
|
||||
/**
|
||||
* all currently known item qualities
|
||||
*/
|
||||
declare type ITEM_QUALITY = ITEM_QUALITY_GENERIC | ITEM_QUALITY_POOR | ITEM_QUALITY_COMMON | ITEM_QUALITY_UNCOMMON |
|
||||
ITEM_QUALITY_RARE | ITEM_QUALITY_EPIC | ITEM_QUALITY_LEGENDARY | ITEM_QUALITY_ARTIFACT | ITEM_QUALITY_HEIRLOOM;
|
||||
820
declarations/ui.d.ts
vendored
Normal file
820
declarations/ui.d.ts
vendored
Normal file
@@ -0,0 +1,820 @@
|
||||
/// <reference path="global.d.ts" />
|
||||
|
||||
declare type WowHorizontalAlign = "LEFT" | "CENTER" | "RIGHT";
|
||||
declare type WowVerticalAlign = "TOP" | "MIDDLE" | "BUTTOM";
|
||||
declare type WowPoint = "TOP" | "RIGHT" | "BOTTOM" | "LEFT" | "TOPRIGHT" | "TOPLEFT" | "BOTTOMLEFT" | "BOTTOMRIGHT" | "CENTER";
|
||||
declare type WowLayer = "BACKGROUND" | "ARTWORK";
|
||||
declare type WowFrameStrata = "WORLD" | "BACKGROUND" | "LOW" | "MEDIUM" | "HIGH" | "DIALOG" | "FULLSCREEN" | "FULLSCREEN_DIALOG" | "TOOLTIP";
|
||||
declare type WowWrap = "CLAMP" | "CLAMPTOBLACK" | "CLAMPTOBLACKADDITIVE" | "CLAMPTOSHITE" | "REPEAT" | true | "MIRROR";
|
||||
declare type WowMouseButton = "LeftButton" | "RightButton" | "Middle" | "Button4" | "Button5";
|
||||
declare type WowFilterMode = "LINEAR" | "BILINEAR" | "TRILINEAR" | "NEAREST";
|
||||
declare type WowMouseWheelDelta = 1 | -1;
|
||||
declare type WowAlign = "HORIZONTAL" | "VERTICAL";
|
||||
|
||||
/**
|
||||
* global lua namespace
|
||||
*/
|
||||
declare const _G: { [prop: string]: any };
|
||||
declare const InterfaceOptionsFramePanelContainer: WowRegion;
|
||||
|
||||
// EVENTS
|
||||
declare type WowEventOnEvent = "OnEvent";
|
||||
declare type WowEventOnLoad = "OnLoad";
|
||||
declare type WowEventOnUpdate = "OnUpdate";
|
||||
declare type WowEventOnClick = "OnClick";
|
||||
declare type WowEventOnEnter = "OnEnter";
|
||||
declare type WowEventOnLeave = "OnLeave";
|
||||
declare type WowEventOnHide = "OnHide";
|
||||
declare type WowEventOnShow = "OnShow";
|
||||
declare type WowEventOnMouseDown = "OnMouseDown";
|
||||
declare type WowEventOnMouseUp = "OnMouseUp";
|
||||
declare type WowEventOnMouseWheel = "OnMouseWheel";
|
||||
declare type WowEventOnValueChanged = "OnValueChanged";
|
||||
declare type WowEventOnTextChanged = "OnTextChanged";
|
||||
// -----
|
||||
declare type WowEventPlayerLogin = "PLAYER_LOGIN";
|
||||
declare type WowEventPlayerLogout = "PLAYER_LOGOUT";
|
||||
declare type WowEventUnitHealth = "UNIT_HEALTH";
|
||||
declare type WowEventUnitPowerUpdate = "UNIT_POWER_UPDATE";
|
||||
declare type WowEventUnitDisplaypower = "UNIT_DISPLAYPOWER";
|
||||
declare type WowEventPlayerTargetChanged = "PLAYER_TARGET_CHANGED";
|
||||
declare type WowEventUnitMaxhealth = "UNIT_MAXHEALTH";
|
||||
declare type WowEventUnitMaxpower = "UNIT_MAXPOWER";
|
||||
declare type WowEventGroupRosterUpdate = "GROUP_ROSTER_UPDATE";
|
||||
declare type WowEventPlayerEnteringWorld = "PLAYER_ENTERING_WORLD";
|
||||
declare type WowEventPlayerFocusChanged = "PLAYER_FOCUS_CHANGED";
|
||||
declare type WowEventUnitEnteredVehicle = "UNIT_ENTERED_VEHICLE";
|
||||
declare type WowEventUnitExitedVehicle = "UNIT_EXITED_VEHICLE";
|
||||
// -----
|
||||
declare type WowEvent = WowEventPlayerLogin | WowEventPlayerLogout | WowEventUnitHealth | WowEventUnitPowerUpdate |
|
||||
WowEventUnitDisplaypower | WowEventPlayerTargetChanged | WowEventUnitMaxhealth | WowEventUnitMaxpower | WowEventGroupRosterUpdate |
|
||||
WowEventPlayerEnteringWorld | WowEventPlayerFocusChanged | WowEventUnitEnteredVehicle | WowEventUnitExitedVehicle;
|
||||
declare type WowEventOnAny = WowEventOnEvent | WowEventOnLoad | WowEventOnUpdate | WowEventOnClick | WowEventOnEnter |
|
||||
WowEventOnLeave | WowEventOnHide | WowEventOnShow | WowEventOnMouseDown | WowEventOnMouseUp | WowEventOnMouseWheel |
|
||||
WowEventOnValueChanged | WowEventOnTextChanged;
|
||||
|
||||
|
||||
/**
|
||||
* ##################################
|
||||
* FRAME MANAGEMENT
|
||||
* ##################################
|
||||
*/
|
||||
|
||||
// global frame related functions
|
||||
|
||||
/**
|
||||
* set the width for the given dropdown frame
|
||||
*
|
||||
* @param dropdown the dropdown frame
|
||||
* @param width the new width
|
||||
*/
|
||||
declare function UIDropDownMenu_SetWidth(dropdown: WowFrame, width: number): void;
|
||||
|
||||
/**
|
||||
* set the text for the given dropdown frame
|
||||
*
|
||||
* @param dropdown the dropdown frame
|
||||
* @param text the text to set
|
||||
*/
|
||||
declare function UIDropDownMenu_SetText(dropdown: WowFrame, text: string): void;
|
||||
|
||||
/**
|
||||
* initialize the given dropdown frame
|
||||
*
|
||||
* @param dropdown the dropdown frame
|
||||
* @param callback the initializer function
|
||||
*/
|
||||
declare function UIDropDownMenu_Initialize(dropdown: WowFrame, callback: (_self: WowFrame, level: number, menuList: number) => void): void;
|
||||
|
||||
declare type WowUiDropdownInfo = {
|
||||
text: string,
|
||||
func?: () => void,
|
||||
checked: boolean
|
||||
};
|
||||
/**
|
||||
* create an info object for a dropdown element
|
||||
*/
|
||||
declare function UIDropDownMenu_CreateInfo(): WowUiDropdownInfo;
|
||||
|
||||
/**
|
||||
* add the given info object to the current inizialized dropdown frame
|
||||
*
|
||||
* @param info the info to add
|
||||
*/
|
||||
declare function UIDropDownMenu_AddButton(info: WowUiDropdownInfo): void;
|
||||
|
||||
|
||||
/**
|
||||
* comma separated list of enabled flags
|
||||
*/
|
||||
declare type FontInstanceFlags = "OUTLINE" | "MONOCHROME" | "THICKOUTLINE";
|
||||
|
||||
/**
|
||||
* The Frame type
|
||||
*/
|
||||
declare type WowFrameType = "Frame" | "Button" | "Cooldown"
|
||||
| "ColorSelect" | "EditBox" | "GameTooltip" | "MessageFrame"
|
||||
| "Minimap" | "Model" | "ScrollFrame" | "ScrollingMessageFrame"
|
||||
| "SimpleHTML" | "Slider" | "StatusBar";
|
||||
|
||||
/**
|
||||
* the generic UIObject type
|
||||
*/
|
||||
declare interface WowUiObject {
|
||||
|
||||
/**
|
||||
* get the parent UIObject
|
||||
*/
|
||||
GetParent(): WowUiObject;
|
||||
|
||||
/**
|
||||
* Get the current alpha value
|
||||
*/
|
||||
GetAlpha(): number;
|
||||
|
||||
/**
|
||||
* get the type of this object
|
||||
*/
|
||||
GetObjectType(): WowFrameType;
|
||||
|
||||
/**
|
||||
* Return the name of the object.
|
||||
*/
|
||||
GetName(): string;
|
||||
|
||||
/**
|
||||
* Returns whether insecure interaction with a widget is forbidden.
|
||||
*/
|
||||
IsForbidden(): boolean;
|
||||
|
||||
/**
|
||||
* Determine if this object is of the specified type, or a subclass of that type.
|
||||
*
|
||||
* @param type the type to check for
|
||||
*/
|
||||
IsObjectType(type: WowFrameType): boolean;
|
||||
|
||||
/**
|
||||
* Set the object's alpha (opacity) value.
|
||||
*
|
||||
* @param alpha the new alpha value
|
||||
*/
|
||||
SetAlpha(alpha: number): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is another abstract object type that groups together a number of font related methods that are used by multiple other widget types.
|
||||
* This doesn't have a direct correlation to a UI object. See FontInstance object information for details.
|
||||
*/
|
||||
declare interface WowFontInstance extends WowUiObject {
|
||||
|
||||
/**
|
||||
* Returns detailed information on a font object.
|
||||
* @returns MultipleReturnValues:
|
||||
* fontName: Path to font file
|
||||
* fontHeight: Font height in pixels. Due to internal graphics engine workings, this will be ridiculously close to an integer number, but not quite ever fully.
|
||||
* fontFlags: See FontInstance:SetFont().
|
||||
*/
|
||||
GetFont(): MultipleReturnValues<string, number, string>;
|
||||
|
||||
/**
|
||||
* Gets the text color of of a Font Instance.
|
||||
* @return MultipleReturnValues:
|
||||
* r: The red color
|
||||
* g: The green color
|
||||
* b: The blue color
|
||||
* a?: the alpha (opacity)
|
||||
*/
|
||||
GetTextColor(): MultipleReturnValues<number, number, number, number | undefined>;
|
||||
|
||||
/**
|
||||
* The function is used to set the font to use for displaying text.
|
||||
*
|
||||
* @param font path to the font file, relative to the WoW base directory.
|
||||
* @param size size in points.
|
||||
* @param flags any comma-delimited combination of "OUTLINE", "THICKOUTLINE" and "MONOCHROME".
|
||||
*/
|
||||
SetFont(font: string, size: number, flags?: FontInstanceFlags): void;
|
||||
|
||||
/**
|
||||
* Sets horizontal text justification
|
||||
*
|
||||
* @param align the new align
|
||||
*/
|
||||
SetJustifyH(align: WowHorizontalAlign): void;
|
||||
|
||||
/**
|
||||
* Sets vertical text justification
|
||||
*
|
||||
* @param align the new align
|
||||
*/
|
||||
SetJustifyV(align: WowVerticalAlign): void;
|
||||
|
||||
/**
|
||||
* Sets the default text color.
|
||||
*
|
||||
* @param r red color
|
||||
* @param g green color
|
||||
* @param b blue color
|
||||
* @param a alpha (opacity)
|
||||
*/
|
||||
SetTextColor(r: number, g: number, b: number, a?: number): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an abstract object type which cannot actually be created. It gathers together a number of common methods which have identical behaviours across all widget types.
|
||||
* This object contains a collection of methods that are related to the size, location and visibility of a widget.
|
||||
* Note that it is not directly related to Frame:GetRegions() et al. See Region object information for details.
|
||||
*/
|
||||
declare interface WowRegion extends WowUiObject {
|
||||
|
||||
/**
|
||||
* Clear all attachment points for this object.
|
||||
*/
|
||||
ClearAllPoints(): void;
|
||||
|
||||
/**
|
||||
* Set this object to hidden (it and all of its children will disappear).
|
||||
*/
|
||||
Hide(): void;
|
||||
|
||||
/**
|
||||
* Set this object to shown (it will appear if its parent is visible).
|
||||
*/
|
||||
Show(): void;
|
||||
|
||||
/**
|
||||
* Returns the distance from the bottom/left edge of the screen to the requested edge of an object, scaled with the objects's effective scale.
|
||||
*/
|
||||
GetBottom(): number;
|
||||
|
||||
/**
|
||||
* Get the coordinates of the center of this frame - Moved in 1.10.
|
||||
*/
|
||||
GetCenter(): number;
|
||||
|
||||
/**
|
||||
* Returns the distance from the bottom/left edge of the screen to the requested edge of an object, scaled with the objects's effective scale.
|
||||
*/
|
||||
GetTop(): number;
|
||||
|
||||
/**
|
||||
* Returns the distance from the bottom/left edge of the screen to the requested edge of an object, scaled with the objects's effective scale.
|
||||
*/
|
||||
GetLeft(): number;
|
||||
|
||||
/**
|
||||
* Returns the distance from the bottom/left edge of the screen to the requested edge of an object, scaled with the objects's effective scale.
|
||||
*/
|
||||
GetRight(): number;
|
||||
|
||||
/**
|
||||
* Get the width of this object.
|
||||
*/
|
||||
GetWidth(): number;
|
||||
|
||||
/**
|
||||
* Get the height of this object.
|
||||
*/
|
||||
GetHeight(): number;
|
||||
|
||||
/**
|
||||
* Sets an attachment point of an UI component.
|
||||
*
|
||||
* @param point Point of the object to adjust based on the anchor.
|
||||
* @param relativeTo Name or reference to a Region to attach obj to. If not specified in the call's signature, defaults to obj's parent (or, if obj has no parent, the entire screen), or if specified in the signature and passed nil, defaults to the entire screen.
|
||||
* @param relativePoint point of the relativeTo Region to attach point of obj to. If not specified, defaults to the value of point.
|
||||
* @param offsetX x-offset (negative values will move obj left, positive values will move obj right), defaults to 0 if not specified, if ofsy is not specified, or if both relativeTo and relativePoint are specified and nil.
|
||||
* @param offsetY y-offset (negative values will move obj down, positive values will move obj up), defaults to 0 if not specified, if ofsx is not specified, or if both relativeTo and relativePoint are specified and nil.
|
||||
*/
|
||||
SetPoint(point: WowPoint, relativeTo: WowRegion | string, relativePoint: WowPoint, offsetX: number, offsetY: number): void
|
||||
SetPoint(point: WowPoint): void
|
||||
SetPoint(point: WowPoint, offsetX: number, offsetY: number): void
|
||||
SetPoint(point: WowPoint, relativeTo: WowRegion | string, relativePoint: WowPoint): void;
|
||||
|
||||
/**
|
||||
* Sets an object to be positioned and sized exactly the same as another object.
|
||||
*/
|
||||
SetAllPoints(relativeRegion: WowRegion | string): void;
|
||||
|
||||
/**
|
||||
* Sets the desired height of a frame-based object.
|
||||
*
|
||||
* @param height The desired height to set the frame-based object to (use 0 to clear the desired height). Note that a frame whose height is determined based on its anchors will not use this height.
|
||||
*/
|
||||
SetHeight(height: number): void;
|
||||
|
||||
/**
|
||||
* Sets the width of a frame-based object.
|
||||
*
|
||||
* @param width The width to set the frame-based object to (use 0 to clear the desired width). Note that a frame whose width is determined based on its anchors will not use this width.
|
||||
*/
|
||||
SetWidth(width: number): void;
|
||||
|
||||
/**
|
||||
* Set the size (width and height) of the object with one function
|
||||
*
|
||||
* @param width The new width
|
||||
* @param height The new height
|
||||
*/
|
||||
SetSize(width: number, height: number): void;
|
||||
|
||||
/**
|
||||
* Checks if mouse is over a given region.
|
||||
*
|
||||
* @return True if the mouse cursor is currently over the region (as modified by the offset arguments); false otherwise.
|
||||
*/
|
||||
IsMouseOver(): boolean
|
||||
IsMouseOver(top: number, bottom: number, left: number, right: number): boolean;
|
||||
|
||||
/**
|
||||
* Determine if this object can be manipulated in certain ways by tainted code in combat or not
|
||||
*/
|
||||
IsProtected(): boolean;
|
||||
|
||||
/**
|
||||
* Determine if this object is shown (would be visible if its parent was visible).
|
||||
*/
|
||||
IsShown(): boolean;
|
||||
|
||||
/**
|
||||
* Get whether the object is visible on screen (logically (IsShown() and GetParent():IsVisible()));
|
||||
*/
|
||||
IsVisible(): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Another abstract type, for objects that represent only a rendering process onto the screen, rather than a full blown frame. (See LayeredRegion object information for details)
|
||||
*/
|
||||
declare interface WowLayeredRegion extends WowRegion {
|
||||
|
||||
/**
|
||||
* Returns the draw layer for the Region.
|
||||
*/
|
||||
GetDrawLayer(): number;
|
||||
|
||||
/**
|
||||
* Sets the layer in which the LayeredRegion is drawn.
|
||||
*
|
||||
* @param layer coarse layer to draw the region in, e.g. "BACKGROUND" or "ARTWORK".
|
||||
* @param sublevel Integer between -8 and 7 (inclusive), controls rendering order within the specified layer. Regions with lower sublevel values are drawn below those with higher ones.
|
||||
*/
|
||||
SetDrawLayer(layer: WowLayer, sublevel?: number): void;
|
||||
|
||||
/**
|
||||
* Sets the color of an object.
|
||||
*
|
||||
* @param r The red color value to set the object to. The range is 0 to 1.
|
||||
* @param g The green color value to set the object to. The range is 0 to 1.
|
||||
* @param b The blue color value to set the object to. The range is 0 to 1.
|
||||
* @param a The alpha value to set the object to. The range is 0 to 1.
|
||||
*/
|
||||
SetVertexColor(r: number, g: number, b: number, a?: number): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* See Texture object information for details.
|
||||
*/
|
||||
declare interface WowTexture extends WowLayeredRegion {
|
||||
|
||||
/**
|
||||
* Returns the texture string from any Texture object.
|
||||
*
|
||||
* @returns The path/filename without extension of the texture
|
||||
*/
|
||||
GetTexture(): string;
|
||||
|
||||
/**
|
||||
* Applies a counter-clockwise rotation to the texture.
|
||||
*
|
||||
* @param angle Rotation angle in radians. Positive values rotate the texture counter-clockwise.
|
||||
* @param cx Horizontal coordinate of the rotation "center" point, defaults to 0.5.
|
||||
* @param cy Vertical coordinate of the rotation "center" point, defaults to 0.5.
|
||||
*/
|
||||
SetRotation(angle: number, cx: number, cy: number): void
|
||||
SetRotation(angle: number): void;
|
||||
|
||||
/**
|
||||
* Modifies the region of a texture drawn by the Texture widget.
|
||||
*/
|
||||
SetTextCoord(left: number, right: number, top: number, bottom: number): void
|
||||
SetTextCoord(ULx: number, ULy: number, LLx: number, LLy: number, URx: number, URy: number, LRx: number, LRy: number): void;
|
||||
|
||||
/**
|
||||
* Changes the texture of a Texture widget.
|
||||
*
|
||||
* @param file Path to a texture image. | ID number specifying a Blizzard texture file. Returned by various API functions.
|
||||
* @param horizWrap Wrap behavior specifying what should appear when sampling pixels with an x coordinate outside the (0, 1) region of the texture coordinate space
|
||||
* @param vertWrap Wrap behavior specifying what should appear when sampling pixels with a y coordinate outside the (0, 1) region of the texture coordinate space.
|
||||
* @param filterMode Texture filtering mode to use
|
||||
*/
|
||||
SetTexture(file: string | number, horizWrap?: WowWrap, vertWrap?: WowWrap, filterMode?: WowFilterMode): void;
|
||||
|
||||
/**
|
||||
* Changes the color of a texture.
|
||||
*
|
||||
* @param r Red component.
|
||||
* @param g Green component.
|
||||
* @param b Blue component.
|
||||
* @param a Alpha component (1.0 is opaque, 0.0 is transparent). The default value is 1.0.
|
||||
*/
|
||||
SetColorTexture(r: number, g: number, b: number, a?: number): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* a font string object
|
||||
*/
|
||||
declare interface WowFontString extends WowFontInstance, WowLayeredRegion {
|
||||
|
||||
/**
|
||||
* Returns the text from any FontString UI object.
|
||||
*
|
||||
* @returns The text of the FontString. Returns nil if the FontString is an empty string.
|
||||
*/
|
||||
GetText(): string;
|
||||
|
||||
/**
|
||||
* Sets the text to be displayed in the fontstring. The text will have the color given to it via the fontinstance definition (or a FontString:SetTextColor call). You may however use escape sequences to modify the string's appearance.
|
||||
*
|
||||
* @param text The text to set
|
||||
*/
|
||||
SetText(text: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* a generic hook script interface for reuse in other objects
|
||||
*/
|
||||
declare interface WowObjectHookScript<T extends WowUiObject> {
|
||||
|
||||
/**
|
||||
* Securely post-hooks a script handler.
|
||||
*
|
||||
* @param event The handler to hook to, e.g. "OnShow". See Widget handlers.
|
||||
* @param handler The function to call; will be passed all arguments relevant for the hooked widget handler type. May not be nil.
|
||||
*/
|
||||
HookScript(event: WowEventOnAny, handler: (frame: T, ...args: any[]) => void): void
|
||||
HookScript(event: "OnClick", handler: (frame: T, button: WowMouseButton, down: boolean) => void): void
|
||||
HookScript(event: "OnEnter", handler: (frame: T, motion: WowUnknown) => void): void
|
||||
HookScript(event: "OnEvent", handler: (frame: T, eventName: WowEventOnAny & WowEvent, ...args: any[]) => void): void
|
||||
HookScript(event: "OnHide" | "OnShow" | "OnLoad", handler: (frame: T) => void): void
|
||||
HookScript(event: "OnLeave", handler: (frame: T, motion: WowUnknown) => void): void
|
||||
HookScript(event: "OnMouseDown" | "OnMouseUp", handler: (frame: T, button: WowMouseButton) => void): void;
|
||||
HookScript(event: "OnMouseWheel", handler: (frame: T, delta: WowMouseWheelDelta) => void): void;
|
||||
HookScript(event: "OnUpdate", handler: (frame: T, elapsed: number) => void): void;
|
||||
HookScript(event: "OnValueChanged", handler: (frame: T, changed: any) => void): void;
|
||||
HookScript(event: "OnTextChanged", handler: (frame: T, text: string) => void): void;
|
||||
HookScript(event: WowEventOnAny, handler: undefined | null): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* a generoc set script interface for reuse in other objects
|
||||
*/
|
||||
declare interface WowObjectSetScript<T extends WowUiObject> {
|
||||
|
||||
/**
|
||||
* Changes the specified widget script handler.
|
||||
*
|
||||
* @param event Name of the widget script handler to modify (OnShow, OnEvent, etc).
|
||||
* @param handler The function to call when handling the specified widget event, or nil to remove the handler.
|
||||
*/
|
||||
SetScript(event: WowEventOnAny, handler: (frame: T, ...args: any[]) => void): void
|
||||
SetScript(event: "OnClick", handler: (frame: T, button: WowMouseButton, down: boolean) => void): void
|
||||
SetScript(event: "OnEnter", handler: (frame: T, motion: WowUnknown) => void): void
|
||||
SetScript(event: "OnEvent", handler: (frame: T, eventName: WowEventOnAny | WowEvent, ...args: any[]) => void): void
|
||||
SetScript(event: "OnHide" | "OnShow" | "OnLoad", handler: (frame: T) => void): void
|
||||
SetScript(event: "OnLeave", handler: (frame: T, motion: WowUnknown) => void): void
|
||||
SetScript(event: "OnMouseDown" | "OnMouseUp", handler: (frame: T, button: WowMouseButton) => void): void;
|
||||
SetScript(event: "OnMouseWheel", handler: (frame: T, delta: WowMouseWheelDelta) => void): void;
|
||||
SetScript(event: "OnUpdate", handler: (frame: T, elapsed: number) => void): void;
|
||||
SetScript(event: "OnValueChanged", handler: (frame: T, changed: any) => void): void;
|
||||
SetScript(event: "OnTextChanged", handler: (frame: T, isUserInput: boolean) => void): void;
|
||||
SetScript(event: WowEventOnAny, handler: undefined | null): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The main wow frame object
|
||||
*/
|
||||
declare interface WowFrame extends WowRegion, WowObjectHookScript<WowFrame>, WowObjectSetScript<WowFrame> {
|
||||
|
||||
/**
|
||||
* Creates a new FontString as a child of a frame.
|
||||
*
|
||||
* @param name The name for a global variable that points to the newly created font string. If nil, the texture is anonymous and no global variable will be created.
|
||||
* @param layer The layer the font should be drawn in, e.g. "ARTWORK".
|
||||
* @param inheritsFrom The name of a virtual font string, created in XML, to inherit from. if nil, the font string does not inherit any properties.
|
||||
*/
|
||||
CreateFontString(name: string, layer: WowLayer, inheritsFrom?: string): WowFontString;
|
||||
|
||||
/**
|
||||
* Creates a Texture object within the specified widget.
|
||||
*
|
||||
* @param name Name of the newly created texture; the function will create a global variable mapping this value to the created texture. If nil, the texture is anonymous and no global variable is created.
|
||||
* @param layer The layer to the texture should be drawn in, e.g. "ARTWORK".
|
||||
* @param inheritsFrom a comma-delimited list of names of virtual textures (created in XML) to inherit from; if nil, the texture does not inherit any properties.
|
||||
* @param subLayer The order in which the texture should be drawn, within the same layer.
|
||||
*/
|
||||
CreateTexture(name?: string, layer?: WowLayer, inheritsFrom?: string, subLayer?: number): WowTexture;
|
||||
|
||||
/**
|
||||
* Allows this frame to receive keyboard input via OnKeyUp and OnKeyDown script handlers.
|
||||
*
|
||||
* @param enableFlag Whether to enable (true, default) or disable (false).
|
||||
*/
|
||||
EnableKeyboard(enableFlag: boolean): void;
|
||||
|
||||
/**
|
||||
* Allows a frame to receive mouse input via OnMouseDown, OnMouseUp or OnClick. The frame must be shown to receive mouse events.
|
||||
*
|
||||
* @param enableFlag Whether to enable (true, default) or disable (false).
|
||||
*/
|
||||
EnableMouse(enableFlag: boolean): void;
|
||||
|
||||
/**
|
||||
* Allows a frame to receive mouse wheel input.
|
||||
*
|
||||
* @param enableFlag Whether to enable (true, default) or disable (false).
|
||||
*/
|
||||
EnableMouseWheel(enableFlag: boolean): void;
|
||||
|
||||
/**
|
||||
* Returns the Frame Strata the frame is in.
|
||||
*/
|
||||
GetFrameStrata(): WowFrameStrata;
|
||||
|
||||
/**
|
||||
* returns whether the flag is enabled or not
|
||||
*/
|
||||
IsKeyboardEnabled(): boolean;
|
||||
|
||||
/**
|
||||
* returns whether the flag is enabled or not
|
||||
*/
|
||||
IsMouseEnabled(): boolean;
|
||||
|
||||
/**
|
||||
* returns whether the flag is enabled or not
|
||||
*/
|
||||
IsMouseWheelEnabled(): boolean;
|
||||
|
||||
/**
|
||||
* Registers which events the object would like to monitor.
|
||||
*
|
||||
* @param eventName The name of the event to register the object as monitoring.
|
||||
*/
|
||||
RegisterEvent(eventName: WowEvent): void;
|
||||
|
||||
/**
|
||||
* Sets the Frame Strata of the frame.
|
||||
*
|
||||
* @param frameStrata The Frame Strata the frame will be put in
|
||||
*/
|
||||
SetFrameStrata(frameStrata: WowFrameStrata): void;
|
||||
|
||||
/**
|
||||
* Specified a size scaling to be applied to the object (and its children).
|
||||
*
|
||||
* @param scale New scale applied to this object and its children; must be greater than 0, 1 indicates no additional scaling.
|
||||
*/
|
||||
SetScale(scale: number): void;
|
||||
|
||||
/**
|
||||
* set an attribute on the frame
|
||||
*
|
||||
* @param name the name of the attribute to set
|
||||
* @param value the value of the attribute
|
||||
*/
|
||||
SetAttribute(name: string, value: any): void;
|
||||
|
||||
/**
|
||||
* Unregisters the widget from receiving OnEvent notifications for a particular event.
|
||||
*
|
||||
* @param eventName The name of the event the object wishes to no longer monitor. See Events.
|
||||
*/
|
||||
UnregisterEvent(eventName: WowEvent): void;
|
||||
|
||||
/**
|
||||
* Unregisters all events that the object is currently monitoring.
|
||||
*/
|
||||
UnregisterAllEvents(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The InterfaceOptions framework requires an addon to supply its own configuration frame (panel). The supplied panel will be repositioned by FrameXML and displayed when the addon's configuration category is selected.
|
||||
* When the user presses the Okay, Cancel or Defaults buttons on the Interface Options frame, the panels will be notified by calling specific functions in the supplied frame table.
|
||||
*/
|
||||
declare interface WowFrameInterfaceCategory extends WowFrame {
|
||||
|
||||
/**
|
||||
* name displayed in the Interface Options category list (your addon name, or a panel-specific name)
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* the panel.name value of the parent configuration panel, used to display a hierarchical category tree. If the parent panel is not specified or does not exist, the panel is displayed as a top-level panel.
|
||||
*/
|
||||
parent?: string;
|
||||
|
||||
/**
|
||||
* called when the frame is initially displayed, and after requesting the default values to be restored.
|
||||
*/
|
||||
refresh?: Function;
|
||||
|
||||
/**
|
||||
* called when the player presses the Okay button, indicating that settings should be saved.
|
||||
*/
|
||||
okay?: Function;
|
||||
|
||||
/**
|
||||
* called when the player presses the Cancel button, indicating that changes made should be discarded.
|
||||
*/
|
||||
cancel?: Function;
|
||||
|
||||
/**
|
||||
* called when the player presses the Defaults button, indicating that default settings for the addon should be restored.
|
||||
*/
|
||||
default?: Function;
|
||||
}
|
||||
|
||||
/**
|
||||
* A slider for wow
|
||||
*/
|
||||
declare interface WowSlider extends WowFrame {
|
||||
|
||||
/**
|
||||
* Disables the slider
|
||||
*/
|
||||
Disable(): void;
|
||||
|
||||
/**
|
||||
* Enables the slider
|
||||
*/
|
||||
Enable(): void;
|
||||
|
||||
/**
|
||||
* Returns the minimum and maximum values of a slider
|
||||
*/
|
||||
GetMinMaxValues(): MultipleReturnValues<number, number>
|
||||
|
||||
/**
|
||||
* Get the current value of the slider
|
||||
*/
|
||||
GetValue(): number;
|
||||
|
||||
/**
|
||||
* Get the current step size of the slider
|
||||
*/
|
||||
GetValueStep(): number;
|
||||
|
||||
/**
|
||||
* set the minimun and maximum value of the slider
|
||||
*
|
||||
* @param min the min value
|
||||
* @param max the max value
|
||||
*/
|
||||
SetMinMaxValues(min: number, max: number): void;
|
||||
|
||||
/**
|
||||
* set the current value of the slider
|
||||
*
|
||||
* @param value the new value
|
||||
*/
|
||||
SetValue(value: number): void;
|
||||
|
||||
/**
|
||||
* set the new step value for the slider
|
||||
*
|
||||
* @param stepValue the new step value
|
||||
*/
|
||||
SetValueStep(stepValue: number): void;
|
||||
|
||||
/**
|
||||
* set the orientation of the slider
|
||||
*
|
||||
* @param orientation the orientation to set
|
||||
*/
|
||||
SetOrientation(orientation: WowAlign): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* a textbox like object
|
||||
*/
|
||||
declare interface WowEditBox extends WowFrame, WowFontInstance {
|
||||
|
||||
/**
|
||||
* Clears the input text focus out of the EditBox. After this call EditBox will no longer receive input from keyboard.
|
||||
*/
|
||||
ClearFocus(): void;
|
||||
|
||||
/**
|
||||
* Returns the position of the editbox cursor.
|
||||
*/
|
||||
GetCursorPosition(): number;
|
||||
|
||||
/**
|
||||
* This function reads text entered into the editBox, tries to convert it into a number, and returns corresponding numerical value, or 0 if text didn't look like a number.
|
||||
*/
|
||||
GetNumber(): number;
|
||||
|
||||
/**
|
||||
* Returns the String that is currently entered in the EditBox.
|
||||
*/
|
||||
GetText(): string;
|
||||
|
||||
/**
|
||||
* Inserts text at the current cursor position.
|
||||
*
|
||||
* @param text text to insert at the current cursor position.
|
||||
*/
|
||||
Insert(text: string): void;
|
||||
|
||||
/**
|
||||
* Sets the position of the cursor in the edit box.
|
||||
*
|
||||
* @param position New editing cursor position; the cursor is set after position'th character of the string
|
||||
*/
|
||||
SetCursorPosition(position: number): void;
|
||||
|
||||
/**
|
||||
* Sets editBox's text to the specified string
|
||||
*
|
||||
* @param text the string you want to appear in the EditBox
|
||||
*/
|
||||
SetText(text: string): void;
|
||||
|
||||
/**
|
||||
* Sets whether the cursor should automatically focus on the EditBox when it is shown
|
||||
*
|
||||
* @param state Whether autofocus should be enabled
|
||||
*/
|
||||
SetAutoFocus(state: boolean): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* a wow button
|
||||
*/
|
||||
interface WowButton extends WowFrame {
|
||||
|
||||
/**
|
||||
* Execute the click action of the button.
|
||||
*/
|
||||
Click(): void;
|
||||
|
||||
/**
|
||||
* Disable the Button so that it cannot be clicked
|
||||
*/
|
||||
Disable(): void;
|
||||
|
||||
/**
|
||||
* Enable to the Button so that it may be clicked
|
||||
*/
|
||||
Enable(): void;
|
||||
|
||||
/**
|
||||
* Get the text label for the Button
|
||||
*/
|
||||
GetText(): string;
|
||||
|
||||
/**
|
||||
* Get the height of the Button's text
|
||||
*/
|
||||
GetTextHeight(): number;
|
||||
|
||||
/**
|
||||
* Get the width of the Button's text
|
||||
*/
|
||||
GetTextWidth(): number;
|
||||
|
||||
/**
|
||||
* Determine whether the Button is enabled
|
||||
*/
|
||||
IsEnabled(): boolean;
|
||||
|
||||
/**
|
||||
* Sets the Button's text to the specified string
|
||||
*
|
||||
* @param text The text that will be written on the Button
|
||||
*/
|
||||
SetText(text: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new UI frame.
|
||||
*
|
||||
* @param frameType Type of the frame to be created (XML tag name): "Frame", "Button", etc. See UIOBJECT_Frame
|
||||
* @param frameName Name of the newly created frame. If nil, no frame name is assigned. The function will also set a global variable of this name to point to the newly created frame.
|
||||
* @param parentFrame The frame object that will be used as the created Frame's parent (cannot be a string!) Does not default to UIParent if given nil.
|
||||
* @param inheritsFrame a comma-delimited list of names of virtual frames to inherit from (the same as in XML). If nil, no frames will be inherited. These frames cannot be frames that were created using this function, they must be created using XML with virtual="true" in the tag.
|
||||
* @param id ID to assign to the frame. See API Frame SetID
|
||||
*/
|
||||
declare function CreateFrame(frameType: WowFrameType, frameName?: string, parentFrame?: WowUiObject, inheritsFrame?: string, id?: number): WowUiObject
|
||||
declare function CreateFrame(frameType: "Frame", frameName?: string, parentFrame?: WowUiObject, inheritsFrame?: string, id?: number): WowFrame;
|
||||
declare function CreateFrame(frameType: "Slider", frameName?: string, parentFrame?: WowUiObject, inheritsFrame?: string, id?: number): WowSlider;
|
||||
declare function CreateFrame(frameType: "EditBox", frameName?: string, parentFrame?: WowUiObject, inheritsFrame?: string, id?: number): WowEditBox;
|
||||
declare function CreateFrame(frameType: "Button", frameName?: string, parentFrame?: WowUiObject, inheritsFrame?: string, id?: number): WowButton;
|
||||
|
||||
/**
|
||||
* Adds a configuration panel (with the fields described in #Panel fields below set) to the category list. The optional position argument (number) allows addons to insert top-level panels at arbitrary positions in the category list.
|
||||
*
|
||||
* @param panel the panel to add
|
||||
*/
|
||||
declare function InterfaceOptions_AddCategory(panel: WowFrameInterfaceCategory): void;
|
||||
13
declarations/unit.d.ts
vendored
Normal file
13
declarations/unit.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
declare type WowUnitIdArena = "arena1" | "arena2" | "arena3" | "arena4" | "arena5"
|
||||
declare type WowUnitIdRaidPlayer = "raid1" | "raid2" | "raid3" | "raid4" | "raid5" | "raid6" | "raid7" | "raid8" | "raid9" |
|
||||
"raid10" | "raid11" | "raid12" | "raid13" | "raid14" | "raid15" | "raid16" | "raid17" | "raid18" | "raid19" | "raid20" |
|
||||
"raid21" | "raid22" | "raid23" | "raid24" | "raid25" | "raid26" | "raid27" | "raid28" | "raid29" | "raid30" | "raid31" |
|
||||
"raid32" | "raid33" | "raid34" | "raid35" | "raid36" | "raid37" | "raid38" | "raid39" | "raid40";
|
||||
declare type WowUnitIdRaidPlayerPet = "raidpet1" | "raidpet2" | "raidpet3" | "raidpet4" | "raidpet5" | "raidpet6" | "raidpet7" | "raidpet8" | "raidpet9" |
|
||||
"raidpet10" | "raidpet11" | "raidpet12" | "raidpet13" | "raidpet14" | "raidpet15" | "raidpet16" | "raidpet17" | "raidpet18" | "raidpet19" | "raidpet20" |
|
||||
"raidpet21" | "raidpet22" | "raidpet23" | "raidpet24" | "raidpet25" | "raidpet26" | "raidpet27" | "raidpet28" | "raidpet29" | "raidpet30" | "raidpet31" |
|
||||
"raidpet32" | "raidpet33" | "raidpet34" | "raidpet35" | "raidpet36" | "raidpet37" | "raidpet38" | "raidpet39" | "raidpet40";
|
||||
declare type WowUnitIdParty = "party1" | "party2" | "party3" | "party4";
|
||||
declare type WowUnitIdPartyPet = "partypet1" | "partypet2" | "partypet3" | "partypet4";
|
||||
declare type WowUnitIdOther = "player" | "pet" | "focus" | "mouseover" | "vehicle" | "target" | "none" | "npc" | "targettarget";
|
||||
declare type WowUnitId = WowUnitIdOther | WowUnitIdArena | WowUnitIdRaidPlayer | WowUnitIdRaidPlayerPet | WowUnitIdParty | WowUnitIdPartyPet;
|
||||
21
package.json
Normal file
21
package.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "@wartoshika/wow-declarations",
|
||||
"version": "0.0.2",
|
||||
"description": "Typescript declarations for the current live World of Warcraft LUA API",
|
||||
"main": "declarations/index.d.ts",
|
||||
"types": "declarations/index.d.ts",
|
||||
"publishConfig": {
|
||||
"registry":"http://npm-registry.qhun.de"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [
|
||||
"wow",
|
||||
"lua",
|
||||
"wartoshika",
|
||||
"qhun"
|
||||
],
|
||||
"author": "wartoshika <dev@qhun.de>",
|
||||
"license": "MIT"
|
||||
}
|
||||
17
tsconfig.json
Normal file
17
tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"noImplicitAny": true,
|
||||
"removeComments": false,
|
||||
"preserveConstEnums": true,
|
||||
"target": "es5",
|
||||
"moduleResolution": "node",
|
||||
"typeRoots": [
|
||||
"./node_modules/@types",
|
||||
"./node_modules/@wartoshika/lua-declarations"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"declarations/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user