← Bounded paged collections

Collection.Options

luastra/collection

Collection.Options is the checked configuration record accepted by the related SDK operation. Required fields establish the minimum contract, while optional fields preserve documented defaults when omitted.

Before you use it

Add luastra/collection to this module's dependencies in luastra.json, then import it with require("luastra/collection"). Choose a stable bounded key for every item and explicit maxItems, maxPages, and maxPageItems values appropriate to the screen. Provider cursors remain application state and must never be used as UI node IDs.

How it fits

Collection types describe pages, directions, tickets, bounded snapshots, results, and the state controller contract.

When to use it

Use Collection.Options when a reusable variable or helper passes configuration to the related SDK operation. The exported type keeps optional and required fields aligned with the checked public contract.

Fields or definition

ParameterType / valuesDescription
key(T) -> stringCallable key member exposed by Collection.Options; invoke it through the owning contract rather than replacing internal state.
maxItemsnumber?Checked maxItems field of Collection.Options; its exact admitted type is number?.
maxPagesnumber?Checked maxPages field of Collection.Options; its exact admitted type is number?.
maxPageItemsnumber?Checked maxPageItems field of Collection.Options; its exact admitted type is number?.

What happens next

A checked page-window annotation for cursor-based ordered data.

Failures and fixes

Duplicate or malformed keys, oversized pages, repeated cursors, stale tickets, or invalid bounds are rejected without silently corrupting order. Edge failures remain separate so the existing window stays usable while the user retries only the failed direction.

Availability

Public-source alpha collection API in 0.5.0-alpha; fetching and viewport triggers remain explicit application and host concerns.

Exact declaration

export type Options<T> = {
    key: (T) -> string,
    maxItems: number?,
    maxPages: number?,
    maxPageItems: number?,
}

Complete inventory

View all pages in Bounded paged collections
← Previous: Collection.TicketNext: Collection.Snapshot →