manifold:ui 0.2.0
Contract reference · Payloads · contract.json (crates/manifold-wasm-abi/wit/contract.json)
Contract 0.2.0, track 0.2: open, unreleased. Nothing on track 0.2 is released yet, so any item may still change in place (spec §7.2).
| Interface | Kind | Consent | Sides | Owner |
|---|---|---|---|---|
client-ui | import | listed | client | enki |
Interface client-ui
import · consent listed · sides client · owner enki · since 0.2.0
Client-authority UIs and notices (Enki C §14, §2.4; Enki B §12.3). Called by a mod’s client instance; client side only. Consent class: listed.
A client-authority UI is a registration of this mod’s ui-manifest with
UiAuthority::Client: the client host builds its state and handles its
events on this instance, so editing it never waits for the network.
key is the mod-local UI key string the registration was built from
("enki:workspace").
Functions
close
close: func(key: string) -> result<_, ui-error>
Close a client-authority UI of this mod.
is-open
is-open: func(key: string) -> bool
Whether the UI is open.
mark-dirty
mark-dirty: func(key: string) -> result<_, ui-error>
Ask the host to call build-ui-state again; at most once per frame.
notify
notify: func(level: notice-level, text: localized-text) -> bool
Queue a notice for the status bar’s message zone (Enki C §3.12). Not for validation or routine results. False when this mod’s share of the queue is full; never blocks or prompts.
open
open: func(key: string) -> result<_, ui-error>
Open a client-authority UI of this mod. The host builds its state
(build-ui-state) before the next frame draws it. Opening an open
UI is not an error.
Types
localized-text (alias)
= core/text.localized-text
notice-level (enum)
How a notice is shown. Never “success”: results are neutral messages in a status bar, not notices.
| Index | Case | About |
|---|---|---|
| 0 | info | |
| 1 | warn | |
| 2 | error |
ui-error (variant)
Why a control call was refused. other lets the variant grow within
the track.
| Index | Case | Payload | About |
|---|---|---|---|
| 0 | unknown-ui | none | This mod registers no UI under the key. |
| 1 | not-client-authority | none | The key names a server-authority UI, which the server opens. |
| 2 | not-open | none | close or mark-dirty of a UI that is not open. |
| 3 | other | string |