Skip to content

Typescript definitions for the Moonsharp lua interpreter

License

Notifications You must be signed in to change notification settings

tts-community/types-moonsharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moonsharp Types

Typescript definitions for the Moonsharp Lua interpreter made with types-lua

Installation

  1. Get npm package
yarn add -D https://github.com/tts-community/types-moonsharp
# or
npm install -D https://github.com/tts-community/types-moonsharp

# And if we publish it:
yarn add -D @types/moonsharp
  1. Configure tsconfig.json

Typescript will not automatically load typescript definitions unless they are a @types module

{
  "compilerOptions": {
    "types": ["types-lua"]
  }
}

Loading only a subset of features

Some Lua environments are sandboxed and don't have some globals declared, like io, os and debug. To avoid registering these globals you should look at the version-specific file at the root of this package and loaded each of it's dependencies separately. For example

{
  "compilerOptions": {
    "types": [
      "types-moonsharp/core/coroutine",
      "types-moonsharp/core/global",
      "types-moonsharp/core/math",
      "types-moonsharp/core/metatable",
      "types-moonsharp/core/modules",
      "types-moonsharp/core/string",
      "types-moonsharp/core/table",
      "types-moonsharp/patches"
    ]
  }
}

About

Typescript definitions for the Moonsharp lua interpreter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published