← Application composition

App.ComposeOptions

luastra/app

App.ComposeOptions 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/app to this module's dependencies in luastra.json, then import it with require("luastra/app"). Return exactly one App.compose instance from the entry module. Feature IDs must be disjoint lowercase paths, and a feature must claim each asynchronous request ID before its completion can be routed.

How it fits

App types describe the root composition contract, feature hooks, request-ownership context, diagnostics, and returned instance. Static types are erased after analysis.

When to use it

Use App.ComposeOptions 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
features{ Feature<T> }?Checked features field of App.ComposeOptions; its exact admitted type is { Feature<T> }?.
render(outputs: { [string]: T }) -> TCallable render member exposed by App.ComposeOptions; invoke it through the owning contract rather than replacing internal state.
handle((action: string, target: string, value: string) -> ())?Callable handle member exposed by App.ComposeOptions; invoke it through the owning contract rather than replacing internal state.
resolve((requestId: number, success: boolean, payload: string, errorCode: string, errorMessage: string) -> ())?Callable resolve member exposed by App.ComposeOptions; invoke it through the owning contract rather than replacing internal state.
snapshot() -> SCallable snapshot member exposed by App.ComposeOptions; invoke it through the owning contract rather than replacing internal state.

What happens next

A checked application-composition annotation that matches the exported contract.

Failures and fixes

Duplicate or overlapping feature IDs, invalid event bounds, duplicate request ownership, and malformed compose options fail immediately. Late, cancelled, unknown, or post-dispose completions are suppressed or delegated only through the explicitly configured root path.

Availability

Public-source alpha composition API in 0.5.0-alpha; host-independent except for the capabilities used by composed features.

Exact declaration

export type ComposeOptions<T, S> = {
    features: { Feature<T> }?,
    render: (outputs: { [string]: T }) -> T,
    handle: ((action: string, target: string, value: string) -> ())?,
    resolve: ((requestId: number, success: boolean, payload: string, errorCode: string, errorMessage: string) -> ())?,
    snapshot: () -> S,
}

Complete inventory

View all pages in Application composition
← Previous: App.FeatureNext: App.Diagnostics →