npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tilua-types/roblox

v4.0.0

Published

Luau and the whole Roblox API as tilua types: every class, enum, data type, service and global

Readme

@tilua-types/roblox

Luau and the whole Roblox API as tilua types: every class (921 of them), enum (633), data type, service and global, plus what Luau adds to Lua — typeof, buffer, bit32, utf8, table.create, string.split, math.clamp, ...

Luau is Roblox's language, so the two ship together. Underneath is @tilua-types/lua, the Lua 5.1 standard library, which this depends on and is loaded along with it — so this is the only package a Roblox project installs.

npm i -D @tilua-types/roblox
{ "types": ["roblox"], "paths": {}, "sourceMap": "sourcemap.json" }

With sourceMap pointing at a Rojo sourcemap (rojo sourcemap -o sourcemap.json), game, workspace and each file's script are typed from the real instance tree, down to script.Parent.

What you get

  • Classes with Roblox's own hierarchy. Every type is a nominal declare class (Part extends FormFactorPart extends BasePart ...). A Part passes wherever a BasePart or Instance is expected, but a Folder does not pass as a Part, and a table never passes as an Instance. typeof(instance) is "Instance".
  • Events with typed arguments. In Players.PlayerAdded:Connect(function(player) ... end), player is a Player. Callbacks assigned to a property, such as remote.OnServerInvoke = function(player, ...), are typed the same way.
  • Enums. Enum.KeyCode.E is an Enum.KeyCode, Enum.Material works as a type, and one enum's items do not pass as another's.
  • Data types with their operators. Vector3 + Vector3, CFrame * Vector3 and 2 * vector get their types from the declared metamethods.
  • Names checked against the API. game:GetService("Players"), inst:IsA("BasePart") (which also narrows), Instance.new("Part") and FindFirstChildOfClass("Humanoid") all return the class they name, and a misspelt name is an error.

Deprecated members stay: Humanoid:LoadAnimation, Model:SetPrimaryPartCFrame and the rest still run. Only the lowercase spellings from Roblox's early API (findFirstChild, isA) are left out, since each is another name for a member written the current way. Deprecated globals such as wait, spawn and Workspace stay.

Errors in callbacks

A bundle's entry runs under xpcall, so an uncaught error names the project's files, not lines of the bundle. A callback that Roblox runs later on its own thread is outside that xpcall. This package's lowering (lowering.mjs) wraps those callbacks in the same handler:

  • signal:Connect(f), signal:Once(f), signal:ConnectParallel(f)
  • task.spawn, task.defer, task.delay, including const spawn = task.spawn
  • RunService:BindToRenderStep, game:BindToClose, ContextActionService:BindAction and BindActionAtPriority
main.tilua:5: attempt to index nil with 'Name'
    at main.tilua:5 (touched)
    at main.tilua:7

The error is still raised on the callback's thread, so the callback stops the same way it did before. A callback that runs synchronously (a table.sort comparator, names:map(f)) is not wrapped, because it is already inside its caller's xpcall. coroutine is not wrapped either: coroutine.resume returning false, err is part of how it behaves. Outside a bundle, nothing is wrapped.

Where it comes from

index.d.tilua is generated. Don't edit it by hand; change scripts/generate-roblox.mjs instead — or scripts/luau.d.tilua, the hand-written Luau layer the generator copies into the head of the file. The generator converts the definitions luau-lsp builds from the Roblox API dump, at a pinned commit, into tilua syntax. To pick up a newer API:

npm run generate:roblox                                      # the pinned commit
node scripts/generate-roblox.mjs --commit <luau-lsp commit>  # a newer one

luau-lsp is MIT licensed. Its notice is in THIRD_PARTY_NOTICES.md.