The globalTypes.d.luau
file provides an autogenerated types definition file. This file is generated by dumpRobloxTypes.py
:
$ python dumpRobloxTypes.py > globalTypes.d.luau
The script extracts type information from the Roblox API Dump:
We make use of some corrections provided by Roblox LSP:
DataTypes are also provided by Roblox LSP:
BrickColor information is retrieved from:
There are often times when the information provided in the following dump information is either incorrect or too generic to provide useful intellisense. Pull requests to fix these definitions are welcome.
Inside dumpRobloxTypes.py
, there are two collections that are of interest when submitting corrections:
-
IGNORED_MEMBERS
: a dictionary of class name to a list of members that are ignored from the dump information. Add a member here if you wish to improve it's type definition. -
EXTRA_MEMBERS
: a dictionary of class name to a list of strings in definitions syntax format that are added to classes. Add a member definition here if you wish to overwrite an autogenerated definition or add a missing definition.
If types are not present at all in the autogenerated information, you can hardcode its definition. Modify one of three strings to add your type to the file:
START_BASE
: types that go before anything else is definedPOST_DATATYPES_BASE
: types that go after the Data Types have been definedEND_BASE
: types that go after all autogenerated types have been defined
The relevant string to add it to depends on whether the type relies on other types. For simplicity, it is often best to
add it to END_BASE
. However, please do not add a hardcoded definition unless it is absolutely necessary.
In summary, to submit corrections, follow the following steps:
- Checkout the repository
- Edit
IGNORED_MEMBERS
andEXTRA_MEMBERS
indumpRobloxTypes.py
with your fixes - Run
python dumpRobloxTypes.py > globalTypes.d.luau
- Commit and submit a Pull Request