Skip to content

Ambient Typedefs

Ambient typedefs describe X-Ray globals and bundled Lua libraries. They are not modules to import. Add the entries your runtime provides to compilerOptions.types, or reference them with /// <reference types="..." />.

TypedefProvides
xray16/typedefs/extensionsOpenXRay table and string extensions, including table.random, table.size, and string.trim variants.
xray16/typedefs/luajitLuaJIT globals and methods missing from the default TSTL typings.
xray16/typedefs/lfsLuaFileSystem (lfs).
xray16/typedefs/marshalmarshal serialization helpers.
xray16/typedefs/jestTypes for the custom Jest matchers.
jsonc
{
  "compilerOptions": {
    "types": [
      "@typescript-to-lua/language-extensions",
      "xray16",
      "xray16/typedefs/extensions",
      "xray16/typedefs/luajit",
    ],
  },
}

xray16/typedefs/jest is only needed when tests use the custom Jest matchers. See testing for setup.