1 karma · joined May 22, 2025 (1y ago) · 2 submissions
comment 1y ago · link · parent
Unless you're using metatables, this would just be manually defining `self` with a type containing the fields you want it to represent.
For example:
```luau local Module = {} export type Module = { field: string }
function Module.Something(self: Module) print(self.field) end
return Module ```
EDIT: oops, new to this site; expected codeblocks to be a thing :p
comment 1y ago · link · parent
However, I should mention that there is another Luau runtime called cart which has the sole goal of being heavily portable across environments -- and it supports running within WASM! You can even interact with JS APIs and mutate the DOM to write websites with it, if you wanted to.