Skip to content

Types

Array

type Array<Value> = {[number]: Value}

A table with values of type Value and numeric keys 1..n with no gaps

Args

type Args<Value> = {[number]: Value}

A table with values of type Value and numeric keys, possibly with gaps.

Map

Map<Key, Value> = {[Key]: Value}

A table with keys of type Key and values of type Value

Set

type Set<Key> = {[Key]: boolean}

A table with keys of a fixed type Key and a boolean value representing membership of the set (default is false)

Table

type Table = {[any]: any}

A table of any type

Class

type Class<Object> = {

new: () -> Object
}

A class has a constructor returning an instance of Object type

Handler

type Handler<Value> = (Value, number) -> ()

A callback function for an ipairs iteration which is called with a value and index.

PairsHandler

type PairsHandler<Key, Value> = (Value, Key) -> ()

A callback function for a pairs iteration which is called with a value and key.