Type alias LuaIterator<TValue, TState>

LuaIterator<TValue, TState>: TState extends undefined
    ? ((this) => TValue)
    : LuaMultiReturn<[((this, state, lastValue) => TValue), TState, TValue extends LuaMultiReturn<infer TTuple>
        ? TTuple[0]
        : TValue]>

Represents a Lua-style iterator which is returned from a LuaIterable. For simple iterators (with no state), this is just a function. For complex iterators that use a state, this is a LuaMultiReturn tuple containing a function, the state, and the initial value to pass to the function. For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions

Type Parameters

  • TValue

  • TState

Param

The state object returned from the LuaIterable.

Param

The last value returned from this function. If iterating LuaMultiReturn values, this is the first value of the tuple.

Generated using TypeDoc