The build generates Luau type stubs for the game bindings. They give autocomplete and type checks in your editor. This page describes the stub file and the overload policy. For download, placement, and LSP setup, see Editor setup.
The code generator creates types/geode.d.luau,
describing all classes, factories, enums, and the geode namespace.
Do not edit this file by hand.
Every file in tools/luau_codegen/extra_bindings/ is appended to the same output at build time:
task.dluauaddstask,time,loadstring, andwarn. See tasks and time and globals.imgui.dluauaddsimgui. See imgui.web.dluauaddsWebNamespaceand its request and response types. See web.hook.dluauaddsHookHandleandHookCallbackTable. See hooks.mod.dluauaddsModNamespace. See mod.loader.dluauaddsLoaderModInfoandLoaderNamespace. See loader.json.dluauaddsJsonNamespace. See json.keyboard.dluauadds keyboard input support types. See Keyboard input.fs.dluauaddsFsRootandFsNamespace. See fs.gd3d.dluauaddsgd3d, Transform, Mesh, Material, Texture, and ViewportFrame types. See gd3d.websocket.dluauaddswebsocketand its connection and server types. See websocket.color.dluauadds Geode color support types. See cocos.popup.dluauadds managed popup support types. See UI and layouts.
Files for a global like task use declare. Files that only add support types use export type.
There is no separate imgui.d.luau after a build.
Handwritten bindings that codegen does not scan are listed
in MANUAL_FREE_FN_FIELDS inside tools/luau_codegen/emit/luau_types/manual_fields.py.
The generator merges these entries into types/geode.d.luau so stubs stay complete.
Namespaces covered today:
webfield ongeode.utils(runtime namespacegeode.utils.web)geode.utils.base64andgeode.utils.permissiongeode.ColorProvider,geode.VersionInfo,geode.Keybind, and keyboard input namespacesgeode.Color,geode.PopupManager, andgeode.utils.random.choice- Selected
geode.cocoscolor helpers
Codegen scans Geode headers listed in tools/luau_codegen/model/free_fn_sources.py
and merges the results into types/geode.d.luau. These are not in MANUAL_FREE_FN_FIELDS.
| Namespace | Source header | Doc page |
|---|---|---|
geode.utils (top-level) |
utils/general.hpp |
geode.utils |
geode.utils.clipboard |
utils/general.hpp |
geode.utils |
geode.utils.game |
utils/general.hpp |
game |
geode.utils.platform |
utils/general.hpp |
geode.utils |
geode.utils.thread |
utils/general.hpp |
geode.utils |
geode.utils.string |
utils/string.hpp |
geode.utils |
geode.utils.random |
utils/random.hpp |
geode.utils |
geode.cocos (codegen portion) |
utils/cocos.hpp |
cocos |
geode UI free functions |
ui/Popup.hpp, ui/GeodeUI.hpp, ui/General.hpp |
UI and layouts |
Generated support types can also appear in the stub.
GeodeTaskHandle<T> represents a native Geode async task returned by generated bindings.
It has onComplete, cancel, detach, isPending, isDone, and isDetached.
It is separate from the TaskHandle returned by the Lua task library.
Some Geode C++ wide integer types (size_t, uint64_t, and similar) appear as string in the stub.
At runtime, pass decimal integer strings for those arguments and read wide integer results as decimal strings.
Return pointers use ? in stubs. Arg pointers do not. Nil object args fail unless hook allow_nil_object. See hooks.
Container field and argument shapes are summarized in game objects. Pair, nested, and ccCArray binding details live under contributor/codegen.
tests/luau_codegen/guards/test_manual_fields_sync.py guards drift between the Python map, C++ registrars, and emitted stubs.
Enum stubs use a number alias plus a FooNamespace table type for constants. See enums.
Methods and factories with several overloads are emitted as one widened signature that ends in ...any.
Leading arguments are typed where every overload agrees, then the rest fall back to ...any.
Runtime picks overload by arity only. One Lua key per C++ name. See Codegen.
Luau keywords in C++ method names export with a ToLua suffix in stubs and runtime.
See Codegen.
Building LuauAPI runs the luauapi_codegen target and refreshes types/geode.d.luau.
See Codegen and Editor setup.
.luaurctools/luau_codegen/emit/luau_types/tools/luau_codegen/extra_bindings/tools/luau_codegen/emit/luau_types/manual_fields.pyCMakeLists.txt