Skip to content

Function: $fromLuaTable()

Call Signature

ts
function $fromLuaTable<K, T>(object: LuaTable<K, T>): Record<K, T>;

Treat a Lua table as a TypeScript object.

The plugin removes this call and emits its argument. At runtime it reads the LuaTable entries back into a plain TypeScript object.

Type Parameters

Type Parameter
K extends string | number
T

Parameters

ParameterTypeDescription
objectLuaTable<K, T>Lua table.

Returns

Record<K, T>

Same entries as a TypeScript object.

Call Signature

ts
function $fromLuaTable<D>(object: LuaTable<keyof D, D[keyof D]>): D;

Treat a Lua table as a TypeScript object.

The plugin removes this call and emits its argument. At runtime it reads the LuaTable entries back into a plain TypeScript object.

Type Parameters

Type Parameter
D

Parameters

ParameterTypeDescription
objectLuaTable<keyof D, D[keyof D]>Lua table.

Returns

D

Same entries as a TypeScript object.