Appearance
API
Functions
ConstructWithTable
lua
function LibTSMClass.ConstructWithTable(tbl, class, ...)
-> <T>Constructs a class from an existing table, preserving its keys.
Parameters:
| Name | Type | Description |
|---|---|---|
tbl | table | The table with existing keys to preserve |
class | T | The class to construct |
... | any | Arguments to pass to the constructor |
Returns:
| Type | Description |
|---|---|
<T> |
DefineClass
lua
function LibTSMClass.DefineClass(name, superclass, ...)
-> <T:Class>Defines a new class.
Parameters:
| Name | Type | Description |
|---|---|---|
name | <T> | The name of the class |
superclass | P | The superclass |
... | ClassProperties | Properties to define the class with |
Returns:
| Type | Description |
|---|---|
<T:Class> |
GetDebugInfo
lua
function LibTSMClass.GetDebugInfo(instStr, maxDepth, tableLookupFunc)
-> string?Gets instance properties from an instance string for debugging purposes.
Parameters:
| Name | Type | Description |
|---|---|---|
instStr | string | The string representation of the instance |
maxDepth | number | The maximum depth to recurse into tables |
tableLookupFunc | fun(tbl: table): string? | A lookup function which is used to get debug information for an unknown table |
Returns:
| Type | Description |
|---|---|
string? | The properties dumped as a multiline string |