-
What do you want to achieve?
I want to know how to use mixed types of data as values, specifically, with a table that follows the structure of {Type1,…} where Type1 is an already defined type, and … is a list of parameters used to interface with that type -
What is the issue?
Luau seems to think that everything else in the table must be the first value type (HistoryActionContext):
-
What solutions have you tried so far?
I’ve tried all options here to define that table in a way that could allow mixed value types:
Incase it helps, here’s what those other tables look like:
export type HistoryActionContext = {
Name: string,
UndoFunction: any, -- Function
RedoContext: HistoryActionContext,
}
local UndoContext : {[string] : HistoryActionContext} = {}
local ActiveUndoState : HistoryAction = {}
I’ve also tried to look through the documentation? for Luau to try and understand more what I’m supposed to do here. I’m really new to Luau typing, and I’m primarily trying to write code that’s compliant so that other devs on the team I work for can have it turned on.