Package Type Extraction
Installed Luau packages don’t ship TypeScript types, so importing them would normally
resolve to any. The rbx-tsx types command reads each package’s Luau source and emits a
declare module block, giving your imports real types.
wally install # or: pesde installrbx-tsx types # reads wally.toml / pesde.toml + the Packages/ folder| Flag | Description | Default |
|---|---|---|
-o, --output <dir> | Output directory for the generated .d.ts files | types/packages |
Add the output directory to your tsconfig.json include (e.g. "types/**/*") so
TypeScript picks the declarations up. Re-run after installing or updating packages.
What it captures
Section titled “What it captures”For each dependency it reads the package’s Luau source, extracts export type aliases and
the module’s exported shape, and emits a declare module block:
- Exported type aliases (with generics)
- Function signatures
- Table / record shapes
- Unions, optionals
- Common ecosystem aliases (
Array→T[],Map/Set→ TSMap/Set,Object→Record<string, any>)
What degrades to any
Section titled “What degrades to any”Constructs the extractor can’t resolve degrade gracefully to any rather than failing:
- Metatable classes and
typeof(setmetatable(...)) - Cross-module type references
- Luau type functions
Packages that ship bundled hand-written types (react, react-roblox, react-dom) are
skipped.