open-index/open-npm huggingface dataset:
npm package: @mobilc/dota-lua-types
Description: TypeScript definitions for Dota 2 Lua API
Author: ark120202
Latest version: 7.36.3

# Dota Lua Types

TypeScript definitions for Dota 2 Lua API, designed to be used with
[TypeScriptToLua](https://github.com/TypeScriptToLua/TypeScriptToLua).
[![npm标签](https://img.shields.io/npm/v/@mobilc/dota-lua-types)](https://www.npmjs.com/package/@mobilc/dota-lua-types)

## Installation

> Check out our [addon template](https://gitee.com/kill-seven-at-once/ts-dota-rpg) for usage
> examples.

1. Get package from npm

```shell
pnpm add -D @mobilc/dota-lua-types
# or
npm install -D @mobilc/dota-lua-types
```

2. Modify your `tsconfig.json`

```json
{
  "compilerOptions": {
    "types": ["@mobilc/dota-lua-types"],
    "plugins": [{ "transform": "@mobilc/dota-lua-types/transformer" }]
  }
}
```

## Enums

This package includes 2 versions of enum types - raw and normalized. Raw types are included with
`"types": ["@mobilc/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": ["@mobilc/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.

## Notes

- You can explore the same data in readable form on
  [Moddota API](https://moddota.com/api/) page.

- To extend standard classes you can use declaration merging:

  ```ts
  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](https://gist.github.com/ark120202/f9ccd1076887664e8e8cb7e7d78fd7d1)

  ```ts
  import { BaseAbility, BaseModifier, registerAbility, registerModifier } from './utils';

  @registerAbility('ability_test')
  export class Test extends BaseAbility {
    GetIntrinsicModifierName = () => TestModifier.name;
  }

  @registerModifier('ability_test_modifier')
  export class TestModifier extends BaseModifier {
    OnCreated() {
      print('Test modifier created');
    }
  }
  ```
npm package: @mobilc/panorama-polyfill
Description: Polyfills for common JavaScript features for Valve's Panorama UI (for Dota 2 Custom Games).
Latest version: 0.1.0

# `panorama-polyfill`

> Polyfills for common JavaScript features for Valve's Panorama UI (for Dota 2 Custom Games).

## Installation

This package can be used only with a ESM bundler, such as webpack. Check out
[this tutorial](https://moddota.com/panorama/webpack) for configuration instructions.

```shell
npm install panorama-polyfill
```

## Usage

Functionality of this module is split across multiple entry points:

### `panorama-polyfill/lib/console`

A polyfill for `console` object, featuring pretty value formatting.

```js
import 'panorama-polyfill/lib/console';

console.log('Hello, world!'); // => Hello, world!
console.log('Hello, %s!', 'world'); // => Hello, world!
console.log([1, 2, 3]); // => [1, 2, 3]
console.log({ foo: { bar: /baz/ } }); // => { foo: { bar: /baz/ } }
```

### `panorama-polyfill/lib/timers`

Polyfills for web timers (using `$.Schedule`):

- `setInterval` and `clearInterval`
- `setTimeout` and `clearTimeout`
- `setImmediate` and `clearImmediate`

### `panorama-polyfill/lib/es`

Polyfills for standard EcmaScript features that are missing from Panorama (> ES2017).
npm package: @mobilc/panorama-types
Description: TypeScript definitions for Dota 2 Panorama API
Author: ark120202
Latest version: 7.36.2

# Panorama Types

TypeScript definitions for Dota 2 Panorama API
[![npm标签](https://img.shields.io/npm/v/@mobilc/panorama-types)](https://www.npmjs.com/package/@mobilc/panorama-types)
## Installation

> Check out our [addon template](https://github.com/ModDota/TypeScriptAddonTemplate) for usage
> examples.

1. Get package from npm

```shell
pnpm add -D @mobilc/panorama-types
# or
npm install -D @mobilc/panorama-types
```

2. Modify your `tsconfig.json`

```json
{
  "compilerOptions": {
    "types": ["@mobilc/panorama-types"]
  }
}
```

## Enums

This package includes 2 versions of enum types - raw and normalized. Raw types are included by
default, with `"types": ["@mobilc/panorama-types"]`. They match actual values available at runtime, however
lead to repetition and require you to use inconsistent standard names.

Normalized enum types can be included with `"types": ["@mobilc/panorama-types/normalized"]` and require you
to use `@mobilc/panorama-types/transformer` (for example using [ttypescript]). 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.

[ttypescript]: https://github.com/cevek/ttypescript
npm package: @mobilc/usual-tool
Description: usual tool for war3 rpg development
Author: 西索酱
Latest version: 0.1.9

一个用于ts 开发 war3 RPG 的自定义函数基础库

# 如何使用
1. 安装依赖
```bash
npm install @mobilc/usual-tool --save-dev
```
或者
```bash
pnpm add @mobilc/usual-tool -D
```

# 代码演示
封装了计时器，特效库等工具,更多趣味写法可自行探索
```typescript
import { thinkAdd } from '@mobilc/usual-tool'
thinkAdd('游戏开始', ()=>{
    print('Hello World')
}, 0.1)
```

# 注意事项
1. 需要基础类型 @mobilc/war3-type
1. 需要基础库 @mobilc/vector

# issue
欢迎添加我的个人[飞书](https://www.feishu.cn/invitation/page/add_contact/?token=9fah665e-ee7a-4916-a45d-1693350e39c5&amp;unique_id=fSNYli_1nRgdHKoNPARsJA==),我拉你进话题组中讨论地图制作
 * 比起QQ，飞书可以按话题讨论，对于技术点更有针对性
 * 我也是初尝试，欢迎大家一通使用

或者使用[github](https://github.com/takegine/testdodo/issues) 给我留言。

编辑不易，欢迎通过[爱发电](https://afdian.net/@takegine)对我赞助
npm package: @mobilc/utils
Description: usual tool for war3 rpg development
Author: 西索酱
Latest version: 0.2.4
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

一个用于ts 开发 dota2/war3 RPG 的脚手架

[![npm标签](https://img.shields.io/npm/v/@mobilc/utils)](https://www.npmjs.com/package/@mobilc/utils)

# 如何使用
1. 安装依赖
```bash
npm install @mobilc/utils --save-dev
```
或者
```bash
pnpm add @mobilc/utils -D
```

# api
[文档](https://takegine.github.io/AddonUtilDoc/ "document")

# issue
欢迎添加我的个人[飞书](https://www.feishu.cn/invitation/page/add_contact/?token=9fah665e-ee7a-4916-a45d-1693350e39c5&amp;unique_id=fSNYli_1nRgdHKoNPARsJA==),我拉你进话题组中讨论地图制作
 * 比起QQ，飞书可以按话题讨论，对于技术点更有针对性
 * 我也是初尝试，欢迎大家一通使用

或者使用[github](https://github.com/takegine/testdodo/issues) 给我留言。

编辑不易，欢迎通过[爱发电](https://afdian.net/@takegine)对我赞助
npm package: @mobilc/war3-type
Description: TypeScript definitions for WAR 3 Lua API
Author: 西索酱
Latest version: 0.0.5

TypeScript definitions for WAR 3 Lua API
基于ts 开发 war3 RPG 的类型申明

# 如何使用
1. 安装依赖
```bash
npm install @mobilc/war3-type --save-dev
```
或者
```bash
pnpm add @mobilc/war3-type -D
```
2. 引入类型
在tsconfig.json中添加如下配置
```json
{
    "compilerOptions": {
        "types": ["@mobilc/war3-type"]
    }
}
```

# 代码演示
在ts中支持 使用原生模块
```typescript
import { CreateUnit, Player, UnitAddAbility } from "jass/common";
let name,spell
let unit = CreateUnit(Player(0), name, 0, 0, 0)
UnitAddAbility(unit, spell )
```

# 注意事项
1. 需要搭配 tstl使用

2. 大部分函数已经可以正常使用

3. 常量的枚举数 需要 自己导入到 全局环境中
例如
```lua
local common = require("jass.common")
UNIT_TYPE_HERO=common.UNIT_TYPE_HERO
```
并在tsconfig.json中做如下配置
```json
{
    "compilerOptions": {
        "plugins": [{ "transform": "@mobilc/war3-type/transformer" }]
    }
}
```


# issue
欢迎添加我的个人[飞书](https://www.feishu.cn/invitation/page/add_contact/?token=9fah665e-ee7a-4916-a45d-1693350e39c5&amp;unique_id=fSNYli_1nRgdHKoNPARsJA==),我拉你进话题组中讨论地图制作
 * 比起QQ，飞书可以按话题讨论，对于技术点更有针对性
 * 我也是初尝试，欢迎大家一通使用

或者使用[github](https://github.com/takegine/testdodo/issues) 给我留言。

编辑不易，欢迎通过[爱发电](https://afdian.net/@takegine)对我赞助