← Luau typing quick reference

typeof

Luau 0.731 · --!strict
type 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,
}

Complete inventory

View all pages in Luau typing quick reference
← Previous: Exported module typesNext: Intersections →