API reference
interaction
Import
Section titled “Import”import * as api from "@fungi.computer/whistle/interaction";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | WhistleInteractionStatus | Where one interaction is in its life. |
| type alias | WhistlePendingPrompt | The one pending question, with the sequence its answer must name. |
| type alias | WhistleMessageNotice | A notice that carries a message line. |
| type alias | WhistleHandoffNotice | A “continue elsewhere” notice. |
| type alias | WhistleInteractionSnapshot | Everything a renderer needs to draw one interaction. |
| type alias | WhistleInteractionHost | A renderer-neutral store behind one interaction dialog or panel. |
| function | createWhistleInteractionHost() | Own one interaction’s state for any renderer. Prompts and notices are parsed here, at the boundary where command-supplied data becomes UI. |
WhistleInteractionStatustype alias
Section titled “WhistleInteractionStatus”type WhistleInteractionStatus = "working" | "prompting" | "failed" | "done" | "cancelled";Where one interaction is in its life.
WhistlePendingPrompttype alias
Section titled “WhistlePendingPrompt”type WhistlePendingPrompt = Readonly<{ sequence: number; request: WhistlePrompt;}>;The one pending question, with the sequence its answer must name.
WhistleMessageNoticetype alias
Section titled “WhistleMessageNotice”type WhistleMessageNotice = Extract< WhistleNotice, Readonly<{ type: "info" | "progress" | "success"; }>>;A notice that carries a message line.
WhistleHandoffNoticetype alias
Section titled “WhistleHandoffNotice”type WhistleHandoffNotice = Extract< WhistleNotice, Readonly<{ type: "handoff"; }>>;A “continue elsewhere” notice.
WhistleInteractionSnapshottype alias
Section titled “WhistleInteractionSnapshot”type WhistleInteractionSnapshot = Readonly<{ title: string; status: WhistleInteractionStatus; message?: WhistleMessageNotice; handoff?: WhistleHandoffNotice; links: readonly WhistleNoticeLink[]; prompt?: WhistlePendingPrompt; failure?: string; retryable: boolean; closing?: WhistleMessageNotice;}>;Everything a renderer needs to draw one interaction.
WhistleInteractionHosttype alias
Section titled “WhistleInteractionHost”type WhistleInteractionHost = Readonly<{ snapshot: () => WhistleInteractionSnapshot; subscribe: (listener) => () => void; begin: () => WhistleInteractionSession; retry: () => void; answer: (sequence, value) => boolean; cancel: () => void;}>;A renderer-neutral store behind one interaction dialog or panel.
createWhistleInteractionHost()function
Section titled “createWhistleInteractionHost()”function createWhistleInteractionHost(options): WhistleInteractionHost;Own one interaction’s state for any renderer. Prompts and notices are parsed here, at the boundary where command-supplied data becomes UI.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
Readonly<{ title: string; onEnd?: (end) => void; }> |
Returns
Section titled “Returns”References
Section titled “References”interactionTextLimit
Section titled “interactionTextLimit”Re-exports interactionTextLimit