roblox-ts

Notable Supported Features

Here are some of the more notable and useful features of roblox-ts that are supported right now:

  • The entire Roblox API is available and has type definitions, with automated generation and releases with Roblox updates.
  • Promises with new Promise (uses roblox-lua-promise internally)
  • async/await with promises
  • Map (Also WeakMap)
  • Set (Also WeakSet)
  • Array methods (.map, .filter, etc.)
  • Object.assign, Object.entries, Object.keys, Object.values
  • String methods
  • Rest/spread syntax in objects and arrays
  • Try/catch and object throws
  • Bitwise operations (except ~ and >>>)
  • TSX for Roact with the rbx-roact package
  • Files named index.ts will be transpiled as init.lua in order to align with conventional syncing plugin details, allowing you to have scripts inside of other scripts in the game tree.
  • All functions are called with a . as there is no : method syntax in TypeScript. Emitted Lua will call functions with : or . depending on its type definition (as members of objects, arrow functions are called with ., normal functions with :).