added initial declarations for shadowland. more are on its way

This commit is contained in:
wartoshika
2021-02-20 21:46:45 +01:00
parent 2d1c7cf174
commit f0a2c8b39f
16 changed files with 664 additions and 3 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.idea/
*.tgz
node_modules/
node_modules/

View File

@@ -1,6 +1,7 @@
/** @noSelfInFile */
/// <reference path="global.d.ts" />
/// <reference path="enums.d.ts" />
/**
* Returns the highest expansion id the current account has been flagged for.
@@ -16,5 +17,53 @@ declare function GetBillingTimeRested(): number;
/**
* Returns whether the player is using a trial (free-to-play) account
* @see https://wow.gamepedia.com/API_IsTrialAccount
*/
declare function IsTrialAccount(): boolean;
/**
* Returns the cap on trial character level, money and profession skill for Starter Edition accounts
* @returns
* 1. rLevel number - character level cap, currently 20
* 2. rMoney number - max amount of money in copper, currently 10000000
* 3. profCap number - profession level cap, currently 0
* @see https://wow.gamepedia.com/API_GetRestrictedAccountData
*/
declare function GetRestrictedAccountData(): [number, number, number];
/**
* unknown
*/
declare function GetSecondsUntilParentalControlsKick(): WoWAPI.Unknown;
/**
* Returns if the account has been secured with Blizzard Mobile Authenticator
* @returns accountSecured
* @since 7.3.5 (2018-01-16)
*/
declare function IsAccountSecured(): boolean;
/**
* Returns if the account has trial account restrictions
*/
declare function IsRestrictedAccount(): WoWAPI.Unknown;
/**
* unknown behaviour
* @since 6.1.0 (2015-02-24)
* @see https://wow.gamepedia.com/API_IsVeteranTrialAccount
*/
declare function IsVeteranTrialAccount(): boolean;
/**
* Indicates the player's account has reached a daily curfew of 90 minutes, imposed on children and any non-confirmed adults in China to comply with local law
* @returns 1 if the account is "unhealthy", nil if not. See details below for clarification. Always returns nil outside China.
* @see https://wow.gamepedia.com/API_NoPlayTime
*/
declare function NoPlayTime(): WoWAPI.Flag;
/**
* unknown behaviour
* @since 9.0.1 (2020-10-13)
*/
declare function SendSubscriptionInterstitialResponse(): Enum.SubscriptionInterstitialResponseType;

1
declarations/atlas.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare type AtlasID = string;

View File

@@ -0,0 +1,85 @@
declare namespace WoWAPI {
interface AnimaDiversionNodeInfo {
talentId: number;
name: string;
description: string;
costs: AnimaDiversionCostInfo[];
currencyId: number;
icon: number;
normalizedPosition: WoWAPI.Vector2D;
state: Enum.AnimaDiversionNodeState;
}
interface AnimaDiversionCostInfo {
currencyId: number;
quantity: number;
}
}
declare namespace C_AnimaDiversion {
/**
* Closes the AnimaDiversionFrame
* @see https://wow.gamepedia.com/API_C_AnimaDiversion.CloseUI
* @fires ANIMA_DIVERSION_CLOSE
* @since 9.0.1 (2020-10-13)
*/
function CloseUI(): void;
/**
* Returns all Anima Conductor nodes for the player's Covenant
* Requires interacting with an Anima Conductor at least once since logging on; otherwise, returns nil.
* Subsequent calls to C_UI.Reload() will not interrupt this function
* @see https://wow.gamepedia.com/API_C_AnimaDiversion.GetAnimaDiversionNodes
* @since 9.0.1 (2020-10-13)
*/
function GetAnimaDiversionNodes(): WoWAPI.AnimaDiversionNodeInfo[];
/**
* Locates an Anima Conductor
* @returns An Anima Conductor's location on the continent map only while interacting with it; otherwise nil
* @see https://wow.gamepedia.com/API_C_AnimaDiversion.GetOriginPosition
* @since 9.0.1 (2020-10-13)
*/
function GetOriginPosition(): WoWAPI.Vector2D | null;
/**
* Needs summary
* @returns progress
* @see https://wow.gamepedia.com/API_C_AnimaDiversion.GetReinforceProgress
* @since 9.0.1 (2020-10-13)
*/
function GetReinforceProgress(): number;
/**
* Names the texture kit applied to the AnimaDiversionFrame
* @returns Name of a texture kit if the player has interacted with an Anima Conductor at least once since logging on; otherwise, returns nil
* @see https://wow.gamepedia.com/API_C_AnimaDiversion.GetTextureKit
* @since 9.0.1 (2020-10-13)
*/
function GetTextureKit(): string | null;
/**
* Attempts to open the AnimaDiversionFrame
* - Triggers ANIMA_DIVERSION_OPEN only after interacting with an Anima Conductor at least once since logging on, regardless of subsequent
* calls to C_UI.Reload(); otherwise, this function silently fails
* - Despite its name, this function is not used by the native UI when interacting with an Anima Conductor
* - Calling this function after walking away from the Anima Conductor results in an incomplete UI because C_AnimaDiversion.GetOriginPosition() returns nil
* - However, it is possible to close and reopen the frame with full functionality if the player has remained within range
* of the Anima Conductor since interacting with it
* @see https://wow.gamepedia.com/API_C_AnimaDiversion.OpenAnimaDiversionUI
* @fires ANIMA_DIVERSION_OPEN
* @since 9.0.1 (2020-10-13)
*/
function OpenAnimaDiversionUI(): void;
/**
* Needs summary
* @param talentId
* @param temporary
* @see https://wow.gamepedia.com/API_C_AnimaDiversion.SelectAnimaNode
* @since 9.0.1 (2020-10-13)
*/
function SelectAnimaNode(talentId: number, temporary: boolean): void;
}

View File

@@ -0,0 +1,24 @@
declare namespace WoWAPI {
interface ArdenwealdGardenData {
active: number;
ready: number;
remainingSeconds: number;
}
}
declare namespace C_ArdenwealdGardening {
/**
* unknown behaviour
* @see https://wow.gamepedia.com/API_C_ArdenwealdGardening.GetGardenData
* @since 9.0.2 (2020-11-17)
*/
function GetGardenData(): WoWAPI.ArdenwealdGardenData;
/**
* unknown behaviour
* @see https://wow.gamepedia.com/API_C_ArdenwealdGardening.IsGardenAccessible
* @since 9.0.2 (2020-11-17)
*/
function IsGardenAccessible(): boolean;
}

View File

@@ -0,0 +1,18 @@
declare namespace C_CovenantCallings {
/**
* Needs summary.
* @returns unlocked
* @see https://wow.gamepedia.com/API_C_CovenantCallings.AreCallingsUnlocked
* @since 9.0.1 (2020-10-13)
*/
function AreCallingsUnlocked(): boolean;
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantCallings.RequestCallings
* @since 9.0.1 (2020-10-13)
*/
function RequestCallings(): void;
}

View File

@@ -0,0 +1,35 @@
declare namespace WoWAPI {
interface CovenantPreviewInfo {
textureKit: string;
transmogSetID: number;
mountID: number;
covenantName: string;
covenantZone: string;
description: string;
covenantCrest: string;
covenantAbilities: CovenantAbilityInfo[];
fromPlayerChoice: boolean;
covenantSoulbinds: CovenantSoulbindInfo[];
featureInfo: CovenantFeatureInfo;
}
}
declare namespace C_CovenantPreview {
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantPreview.CloseFromUI
* @since 9.0.1 (2020-10-13)
*/
function CloseFromUI(): void;
/**
* Needs summary
* @param playerChoiceResponseID
* @see https://wow.gamepedia.com/API_C_CovenantPreview.GetCovenantInfoForPlayerChoiceResponseID
* @since 9.0.1 (2020-10-13)
*/
function GetCovenantInfoForPlayerChoiceResponseID(playerChoiceResponseID: number): WoWAPI.CovenantPreviewInfo;
}

View File

@@ -0,0 +1,123 @@
declare namespace WoWAPI {
interface CovenantSanctumFeatureInfo {
garrTalentTreeID: number;
featureType: number;
uiOrder: number;
}
interface CovenantSanctumRenownLevelInfo {
level: number;
locked: boolean;
isMilestone: boolean;
isCapstone: boolean;
}
interface CovenantSanctumRenownRewardInfo {
uiOrder: number;
itemID: number | null;
spellID: number | null;
mountID: number | null;
transmogID: number | null;
transmogSetID: number | null;
titleMaskID: number | null;
garrFollowerID: number | null;
transmogIllusionSourceID: number | null;
icon: number | null;
name: string | null;
description: string | null;
toastDescription: string | null;
}
}
declare namespace C_CovenantSanctumUI {
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.CanAccessReservoir
* @since 9.0.2 (2020-11-17)
*/
function CanAccessReservoir(): boolean;
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.CanDepositAnima
* @since 9.0.2 (2020-11-17)
*/
function CanDepositAnima(): boolean;
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.DepositAnima
* @protected
* @since 9.0.1 (2020-10-13)
*/
function DepositAnima(): boolean;
/**
* Needs summary.
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.EndInteraction
* @since 9.0.1 (2020-10-13)
*/
function EndInteraction(): void;
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.GetAnimaInfo
* @returns currencyId, maxDisplayableValue
* @since 9.0.1 (2020-10-13)
*/
function GetAnimaInfo(): [number, number];
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.GetCurrentTalentTreeID
* @since 9.0.2 (2020-11-17)
*/
function GetCurrentTalentTreeID(): number | null;
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.GetFeatures
* @since 9.0.1 (2020-10-13)
*/
function GetFeatures(): WoWAPI.CovenantSanctumFeatureInfo[];
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.GetRenownLevel
* @since 9.0.1 (2020-10-13)
*/
function GetRenownLevel(): number;
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.GetRenownLevels
* @since 9.0.2 (2020-11-17)
*/
function GetRenownLevels(covenantId: Enum.CovenantType): WoWAPI.CovenantSanctumRenownLevelInfo[];
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.GetRenownRewardsForLevel
* @since 9.0.1 (2020-10-13)
*/
function GetRenownRewardsForLevel(covenantId: Enum.CovenantType, renownLevel: number): WoWAPI.CovenantSanctumRenownRewardInfo[];
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.GetSanctumType
* @since 9.0.1 (2020-10-13)
*/
function GetSanctumType(): Enum.GarrTalentFeatureSubtype;
/**
* Needs summary
* @returns currencyIds
* @see https://wow.gamepedia.com/API_C_CovenantSanctumUI.GetSoulCurrencies
* @since 9.0.1 (2020-10-13)
*/
function GetSoulCurrencies(): number[];
}

71
declarations/classes/C_Covenants.d.ts vendored Normal file
View File

@@ -0,0 +1,71 @@
declare namespace WoWAPI {
interface CovenantData {
ID: number;
textureKit: string;
celebrationSoundKit: number;
animaChannelSelectSoundKit: number;
animaChannelActiveSoundKit: number;
animaGemsFullSoundKit: number;
animaNewGemSoundKit: number;
animaReinforceSelectSoundKit: number;
upgradeTabSelectSoundKitID: number;
reservoirFullSoundKitID: number;
beginResearchSoundKitID: number;
renownFanfareSoundKitID: number;
name: string;
soulbindIDs: number[];
}
interface CovenantAbilityInfo {
spellId: number;
type: Enum.CovenantAbilityType;
}
interface CovenantSoulbindInfo {
spellID: number;
uiTextureKit: string;
name: string;
description: string;
sortOrder: number;
}
interface CovenantFeatureInfo {
name: string;
description: string;
texture: number;
}
}
declare namespace C_Covenants {
/**
* Returns the CovenantID of the chosen covenant
* - Only applies to joining a Covenant at maximum level or during N [50] The Threads of Fate
* - Returns 0 while loading addons until info is available, before PLAYER_LOGIN and immediately after /reload
* @see https://wow.gamepedia.com/API_C_Covenants.GetActiveCovenantID
* @since 9.0.1 (2020-10-13)
*/
function GetActiveCovenantID(): Enum.CovenantType;
/**
* Needs summary
* @param covenantId
* @see https://wow.gamepedia.com/API_C_Covenants.GetCovenantData
* @since 9.0.1 (2020-10-13)
*/
function GetCovenantData(covenantId: Enum.CovenantType): WoWAPI.CovenantData | null;
/**
* Needs summary.
* @see https://wow.gamepedia.com/API_C_Covenants.GetCovenantIDs
* @since 9.0.1 (2020-10-13)
*/
function GetCovenantIDs(): Enum.CovenantType[];
}

38
declarations/classes/C_Spell.d.ts vendored Normal file
View File

@@ -0,0 +1,38 @@
/// <reference path="../atlas.d.ts" />
declare namespace C_Spell {
/**
* unknown behaviour
* @param spellId
* @returns rarityBorderAtlas
* @see https://wow.gamepedia.com/API_C_Spell.GetMawPowerBorderAtlasBySpellID
* @since 9.0.2 (2020-11-17)
*/
function GetMawPowerBorderAtlasBySpellID(spellId: number): AtlasID;
/**
* Needs summary
* @param spellId
* @see https://wow.gamepedia.com/API_C_Spell.DoesSpellExist
* @since 8.0.1 (2018-07-17)
*/
function DoesSpellExist(spellId: number): boolean;
/**
* Needs summary
* @param spellId
* @see https://wow.gamepedia.com/API_C_Spell.IsSpellDataCached
* @since 8.0.1 (2018-07-17)
*/
function IsSpellDataCached(spellId: number): boolean;
/**
* Asynchronously downloads spell information to the game client, making the full details available for subsequent calls to GetSpellInfo(spellId).
* @param spellId
* @fires SPELL_DATA_LOAD_RESULT
* @see https://wow.gamepedia.com/API_C_Spell.RequestLoadSpellData
* @since 8.0.1 (2018-07-17)
*/
function RequestLoadSpellData(spellId: number): boolean;
}

25
declarations/classes/C_SpellBook.d.ts vendored Normal file
View File

@@ -0,0 +1,25 @@
declare namespace C_SpellBook {
/**
* Needs summary
* @see https://wow.gamepedia.com/API_C_SpellBook.ContainsAnyDisenchantSpell
* @since 8.2.0 (2019-06-25)
*/
function ContainsAnyDisenchantSpell(): boolean;
/**
* Needs summary
* @param skillLineId
* @see https://wow.gamepedia.com/API_C_SpellBook.GetSkillLineIndexByID
* @since 9.0.1 (2020-10-13)
*/
function GetSkillLineIndexByID(skillLineId: number): number | undefined;
/**
* Needs summary
* @param spellId
* @see https://wow.gamepedia.com/API_C_SpellBook.IsSpellDisabled
* @since 8.2.5 (2019-09-24)
*/
function IsSpellDisabled(spellId: number): boolean;
}

9
declarations/classes/index.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
import "./C_AnimaDiversion";
import "./C_ArdenwealdGardening";
import "./C_CovenantCallings";
import "./C_CovenantPreview";
import "./C_Covenants";
import "./C_CovenantSanctumUI";
import "./C_Spell";
import "./C_SpellBook";

38
declarations/enums.d.ts vendored Normal file
View File

@@ -0,0 +1,38 @@
declare namespace Enum {
enum SubscriptionInterstitialResponseType {
Clicked = 0,
Closed = 1,
WebRedirect = 2,
}
enum AnimaDiversionNodeState {
Unavailable = 0,
Available = 1,
SelectedTemporary = 2,
SelectedPermanent = 3,
Cooldown = 4,
}
enum CovenantType {
None = 0,
Kyrian = 1,
Venthyr = 2,
NightFae = 3,
Necrolord = 4,
}
enum CovenantAbilityType {
Class = 0,
Signature = 1,
Soulbind = 2,
}
enum GarrTalentFeatureSubtype {
Generic = 0,
Bastion = 1,
Revendreth = 2,
Ardenweald = 3,
Maldraxxus = 4,
}
}

View File

@@ -10,6 +10,7 @@ import "./activity";
import "./addon";
import "./archaeology";
import "./arena";
import "./atlas";
// B
import "./bank";
import "./barber";
@@ -34,6 +35,7 @@ import "./cursor";
// D
import "./debug";
// E
import "./enums";
import "./event";
// G
import "./gossip";
@@ -51,5 +53,11 @@ import "./ui/tooltip";
import "./ui/ui";
import "./unit";
// V
import "./vector";
// C_* classes
import "./classes";
export = WoWAPI;
export as namespace WoWAPI;

133
declarations/vector.d.ts vendored Normal file
View File

@@ -0,0 +1,133 @@
declare namespace WoWAPI {
/**
* @see https://wow.gamepedia.com/Vector2DMixin
*/
interface Vector2D {
/**
* compares to vectors for equalness
* @param other
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:IsEqualTo
* @since 7.2.0 (2017-03-28)
*/
IsEqualTo(other: Vector2D): boolean;
/**
* returns x and y coordinate from the vector
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:GetXY
* @returns x and y
* @since 7.2.0 (2017-03-28)
*/
GetXY(): [number, number];
/**
* sets x and y coordinate
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:SetXY
* @since 7.2.0 (2017-03-28)
*/
SetXY(x: number, y: number): void;
/**
* multiplies x and y by the given scale number
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:ScaleBy
* @since 7.2.0 (2017-03-28)
*/
ScaleBy(scale: number): void;
/**
* divides x and y by the given number
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:DivideBy
* @since 7.2.0 (2017-03-28)
*/
DivideBy(scale: number): void;
/**
* adds another vector to the current
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:Add
* @since 7.2.0 (2017-03-28)
*/
Add(other: Vector2D): void;
/**
* subtracts another vector from the current
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:Subtract
* @since 7.2.0 (2017-03-28)
*/
Subtract(other: Vector2D): void;
/**
* cross products the given vector into the current one
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:Cross
* @since 7.2.0 (2017-03-28)
*/
Cross(other: Vector2D): void;
/**
* dot products the given vector into the current one
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:Dot
* @since 7.2.0 (2017-03-28)
*/
Dot(other: Vector2D): void;
/**
* tests if the current vector is zero
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:IsZero
* @since 9.0.1 (2020-10-13)
*/
IsZero(): boolean;
/**
* get the squared magnitude (length) of the vector
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:GetLengthSquared
* @since 7.2.0 (2017-03-28)
*/
GetLengthSquared(): number;
/**
* get the magnitude (length) of the vector
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:GetLength
* @since 7.2.0 (2017-03-28)
*/
GetLength(): number;
/**
* normalizes the current vector
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:Normalize
* @since 7.2.0 (2017-03-28)
*/
Normalize(): void;
/**
* rotates the vector by the given amount of radians
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:RotateDirection
* @since 8.0.1 (2018-07-17)
*/
RotateDirection(rotationRadians: number): void;
/**
* Clones this vector into a new instance
* @see https://www.townlong-yak.com/framexml/live/go/Vector2DMixin:Clone
* @since 7.2.0 (2017-03-28)
*/
Clone(): Vector2D;
}
}
/**
* creates a new two dimensional vector from the given x and y coordinates
* @param x x value
* @param y y value
* @see https://www.townlong-yak.com/framexml/live/go/CreateVector2D
* @since 7.2.0 (2017-03-28)
*/
declare function CreateVector2D(x: number, y: number): WoWAPI.Vector2D;
/**
* checks if the two given vectors are considered equal
* @param first the first vector
* @param second the second vector
* @see https://www.townlong-yak.com/framexml/live/go/AreVector2DEqual
* @since 7.2.0 (2017-03-28)
*/
declare function AreVector2DEqual(first: WoWAPI.Vector2D, second: WoWAPI.Vector2D): boolean;

View File

@@ -1,12 +1,15 @@
[![npm version](https://badge.fury.io/js/%40wartoshika%2Fwow-declarations.svg)](https://badge.fury.io/js/%40wartoshika%2Fwow-declarations)
[![Build Status](https://travis-ci.org/wartoshika/wow-declarations.svg?branch=master)](https://travis-ci.org/wartoshika/wow-declarations)
> I am currently working on a program able to generate the WoW declaration files. This should resolve the problem of missing functions and out of date versions. I will update the declaration files for retail and classic as soon as the program works as expected. In addition PTR and BETA documentation could be available. **This will also include declaration updates for Shadowland (Version 9.0.x)**
# Typescript declarations for the current live World of Warcraft LUA API
> WoW Classic developers should use the [wow-classic-declarations](https://github.com/wartoshika/wow-classic-declarations) repository.
## Shadowland
Updates for the Shadowland expansion are currently in development. You can find a partial implementation on the master branch.
Once every function has been documented i will release it into a dedicated version.
**Supported transpilers for LUA targets**:
- qhun-transpiler ([GitHub-Page](https://github.com/wartoshika/qhun-transpiler))
- TypescriptToLua ([GitHub-Page](https://github.com/TypeScriptToLua/TypeScriptToLua)) - *Thanks to tstirrat*