Skip to content

add some missing API dumped from cl_panorama_typescript_declarations #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions packages/panorama-types/types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,23 @@ interface ScreenEntity {
accurateCollision: boolean;
}

interface ContextualTip {
TipAnnotation?: string;
DisplayDuration?: number;
PanoramaClasses?: string[];
PanoramaSnippet?: string;
ReferencedAbilities?: string[];
ReferencedUnits: string[];
Variant?: number;
ForceAnnotation?: boolean;
IntParameter?: number;
IntParameter2?: number;
FloatParameter?: number;
FloatParameter2?: number;
StringParameter?: string;
StringParameter2?: string;
}

interface CDOTA_PanoramaScript_GameUI {
/**
* Control whether the default UI is enabled
Expand Down Expand Up @@ -343,6 +360,36 @@ interface CDOTA_PanoramaScript_GameUI {
* Creates a localized version of the number
*/
ConstructNumberString(n: number): string;

/**
* Query to check if Tips are available for the local player
*/
AreTipsAvailable(): boolean;

/**
* Query to see if the local player can tip a specific player
*/
IsPlayerTippable(iPlayerID: number): boolean;

/**
* Tip a player
*/
TipPlayer(iPlayerID: number): void;

/**
* Display a custom contextual tip (wizard tip) with specific loc string and duration
*/
DisplayCustomContextualTip(tip: ContextualTip): void;

/**
* Set the text of a passed label for a DOTA Talent using ability values.
*/
SetupDOTATalentNameLabel(panel: LabelPanel, sAbilityName: string): void;

/**
* Returns true if the passed ability is a talent.
*/
IsAbilityDOTATalent(pszAbilityName: string): boolean;
}

/**
Expand Down Expand Up @@ -693,6 +740,11 @@ interface CScriptBindingPR_Players {
*/
GetTeam(iPlayerID: PlayerID): DOTATeam_t;

/**
* Get the player's selected hero id.
*/
GetSelectedHeroID(iPlayerID: PlayerID): HeroID;

/**
* Average gold earned per minute for this player.
*/
Expand All @@ -718,8 +770,16 @@ interface CScriptBindingPR_Players {
*/
IsSpectator(iPlayerID: PlayerID): boolean;

/**
* Player portrait click event.
*/
PlayerPortraitClicked(nClickedPlayerID: PlayerID, bHoldingCtrl: boolean, bHoldingAlt: boolean): void;

/**
* Player portrait double click event.
*/
PlayerPortraitDoubleClicked(nClickedPlayerID: PlayerID, bHoldingCtrl: boolean, bHoldingAlt: boolean): void;

BuffClicked(nEntity: EntityIndex, nBuffSerial: number, bAlert: boolean): void;

/**
Expand Down Expand Up @@ -1116,6 +1176,11 @@ interface CScriptBindingPR_Entities {
* Get the item contained in this physical item container.
*/
GetContainedItem(nEntityIndex: EntityIndex): ItemEntityIndex;

/**
* Set the minimap icon on this client.
*/
SetMinimapIcon(nEntityIndex: number, pszMinimapIcon: string): void;
}

interface CScriptBindingPR_Abilities {
Expand Down Expand Up @@ -1159,6 +1224,8 @@ interface CScriptBindingPR_Abilities {

GetCurrentCharges(nEntityIndex: AbilityEntityIndex): number;

GetCurrentAbilityCharges(nEntityIndex: AbilityEntityIndex): number;

GetEffectiveLevel(nEntityIndex: AbilityEntityIndex): number;

GetHeroLevelRequiredToUpgrade(nEntityIndex: AbilityEntityIndex): number;
Expand Down Expand Up @@ -1225,6 +1292,8 @@ interface CScriptBindingPR_Abilities {

IsToggle(nEntityIndex: AbilityEntityIndex): boolean;

UsesAbilityCharges(nEntityIndex: AbilityEntityIndex): boolean;

GetAOERadius(nEntityIndex: AbilityEntityIndex): number;

GetBackswingTime(nEntityIndex: AbilityEntityIndex): number;
Expand All @@ -1247,6 +1316,8 @@ interface CScriptBindingPR_Abilities {

GetUpgradeBlend(nEntityIndex: AbilityEntityIndex): number;

GetAbilityChargeRestoreTimeRemaining(nEntityIndex: AbilityEntityIndex): number;

/**
* Get the local player's current active ability. (Pre-cast targetting state.)
*/
Expand Down Expand Up @@ -1281,6 +1352,9 @@ interface CScriptBindingPR_Abilities {
* Returns the keybind (as a string) for the specified ability.
*/
GetKeybind(nAbilityEntIndex: AbilityEntityIndex): string;

/** Get the max ability charge count. */
GetMaxAbilityCharges(nAbilityEntIndex: number): number;
}

interface CScriptBindingPR_Items {
Expand Down Expand Up @@ -1437,6 +1511,12 @@ interface CScriptBindingPR_Game {

IsInBanPhase(): boolean;

GetConvarBool(name: string): boolean;

GetConvarInt(name: string): number;

GetConvarFloat(name: string): number;

/**
* Return the team id of the winning team.
*/
Expand Down Expand Up @@ -1685,6 +1765,54 @@ interface CScriptBindingPR_Game {
* Registers a keybind that can be listened to with Game.AddCommand
*/
CreateCustomKeyBind(keyName: string, commandName: string): void;

NemesticeGetGameplayTipNumber(): number;

NemesticeSetGameplayTipNumber(nGameplayTipNumber: number): void;

NemesticeShouldShowGameInfo(): boolean;

NemesticeSetShowGameInfo(bShowGameInfo: boolean): void;

Winter2022ShouldShowGameInfo(): boolean;

Winter2022SetShowGameInfo(bShowGameInfo: boolean): void;

Winter2022GetGameplayTipNumber(): number;

Winter2022SetGameplayTipNumber(nGameplayTipNumber: number): void;

ForceCustomUILoad(): void;

CutToDefaultCamera(): void;

PlayDataDrivenCamera(pszCameraName: string): number;

SetJoyFocusPanel(pPanelArg?: Panel): void;

PushJoyFocusPanel(pPanelArg?: Panel): void;

PopJoyFocusPanel(): void;

/**
*Whether the local player has muted voice chat for the specified player id
*/
IsPlayerMutedVoice(nPlayerID: number): boolean;

/**
* Set whether the local player has muted voice chat for the specified player id
*/
SetPlayerMutedVoice(nPlayerID: number, bMutedVoice: boolean): void;

/**
* Whether the local player has muted text chat for the specified player id
*/
IsPlayerMutedText(nPlayerID: number): boolean;

/**
* Set whether the local player has muted text chat for the specified player id
*/
SetPlayerMutedText(nPlayerID: number, bMutedText: boolean): void;
}

interface CPanoramaScript_SteamUGC {
Expand Down Expand Up @@ -1909,6 +2037,11 @@ interface DollarStatic {
* Convert a string to HTML-safe
*/
HTMLEscape(string: string): string;

/**
* Return true if a file exists. Path will usually start with 'file://{images}'
*/
BImageFileExists(path: string): boolean;
}

interface AsyncWebRequestResponse {
Expand Down