Nucleic Phosphate Modifier

    TypeScript icon, indicating that this package has built-in type declarations

    4.19.0 • Public • Published

    Dota Lua Types

    TypeScript definitions for Dota 2 Lua API, designed to be used with TypeScriptToLua.


    Check out our addon template for usage examples.

    1. Get package from npm
    yarn add -D @moddota/dota-lua-types
    # or
    npm install -D @moddota/dota-lua-types
    1. Modify your tsconfig.json
      "compilerOptions": {
        "types": ["@moddota/dota-lua-types"],
        "plugins": [{ "transform": "@moddota/dota-lua-types/transformer" }]


    This package includes 2 versions of enum types - raw and normalized. Raw types are included with "types": ["@moddota/dota-lua-types"]. They are defined using original engine names and have no structural changes. This makes the code using some enums compatible with Panorama, however it leads to repetition and requires you to use inconsistent standard names.

    Normalized enum types can be included with "types": ["@moddota/dota-lua-types/normalized"]. With these types, enums have consistent names and have no repeated parts. For example, instead of EDOTA_ModifyGold_Reason.DOTA_ModifyGold_Unspecified you have to write ModifyGoldReason.UNSPECIFIED.

    Both type versions define aliases for alternative names, so libraries created with one version would be compatible with a different one.


    • You can explore the same data in readable form on Moddota API page.

    • To extend standard classes you can use declaration merging:

      interface CDOTA_BaseNPC {
        log(message: string): void;
      CDOTA_BaseNPC.log = function (message) {
        print(`${this.GetUnitName()} says: ${message}`);
      HeroList.GetHero(0)!.log('Hello world');
    • All Dota classes there are declared as interfaces. To extend them you can use utilities

      import { BaseAbility, BaseModifier, registerAbility, registerModifier } from './utils';
      export class Test extends BaseAbility {
        GetIntrinsicModifierName = () =>;
      export class TestModifier extends BaseModifier {
        OnCreated() {
          print('Test modifier created');


    npm i @moddota/dota-lua-types

    DownloadsWeekly Downloads






    Unpacked Size

    885 kB

    Total Files


    Last publish


    • doctorgester
    • perryvw
    • sinz