Libertas OS API Documentation
    Preparing search index...

    Type Alias LuaIterator<TValue, TState>

    LuaIterator: TState extends undefined
        ? (this: void) => TValue
        : LuaMultiReturn<
            [
                (
                    this: void,
                    state: TState,
                    lastValue: TValue extends LuaMultiReturn<infer TTuple>
                        ? TTuple[0]
                        : TValue,
                ) => 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

    The state object returned from the LuaIterable.

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