@maxhealth.tech/prefab / actions
actions
Classes
| Class | Description |
|---|---|
| SetState | Base interface all actions implement |
| ToggleState | Base interface all actions implement |
| AppendState | Base interface all actions implement |
| PopState | Base interface all actions implement |
| ShowToast | Base interface all actions implement |
| CloseOverlay | Base interface all actions implement |
| OpenLink | Base interface all actions implement |
| SetInterval | Base interface all actions implement |
| Fetch | Base interface all actions implement |
| OpenFilePicker | Base interface all actions implement |
| CallHandler | Base interface all actions implement |
| CallTool | Invoke an MCP tool from the UI. Used in Form.onSubmit or Button.onClick to call backend tools. |
| SendMessage | Base interface all actions implement |
| UpdateContext | Base interface all actions implement |
| RequestDisplayMode | Base interface all actions implement |
| Subscribe | Subscribe to a resource URI for real-time updates. |
| Unsubscribe | Unsubscribe from a previously subscribed resource URI. |
Interfaces
| Interface | Description |
|---|---|
| SetStateOpts | - |
| ShowToastOpts | - |
| FetchOpts | - |
| OpenFilePickerOpts | - |
| CallHandlerOpts | - |
| CallToolOpts | - |
| SubscribeOpts | - |
| ActionJSON | Serialized action JSON |
| Action | Base interface all actions implement |
Type Aliases
| Type Alias | Description |
|---|---|
| ToastVariant | - |
| DisplayMode | - |
| StateTarget | Anything that resolves to a state key: Signal, Collection, or raw string. |
Functions
| Function | Description |
|---|---|
| set | Set a state value. set(signal, value) → new SetState(signal.key, value) |
| toggle | Toggle a boolean state value. toggle(signal) → new ToggleState(signal.key) |
| append | Append an item to an array state value. Optionally specify insertion index. |
| pop | Remove an element from an array by index or value. Defaults to last element (-1). |
| serializeCallbacks | Serialize one or more actions to their JSON form. |