typeof
Luau 0.731 · --!stricttype Name = typeof(value)
Derive a type from an existing value. It is convenient for local configuration; an explicit type is often clearer for a public contract.
When to use it
Read this page when you need to apply typeof, verify its exact contract, and adapt the example without bypassing validation or host boundaries.
Focused example
--!strict
local defaults = {
soundEnabled = true,
volume = 0.8,
}
type Settings = typeof(defaults)
local settings: Settings = {
soundEnabled = false,
volume = 0.5,
}