interaction
@fungi.computer/whistle / interaction
interaction
Section titled “interaction”Type Aliases
Section titled “Type Aliases”WhistleInteractionStatus
Section titled “WhistleInteractionStatus”WhistleInteractionStatus =
"working"|"prompting"|"failed"|"done"|"cancelled"
Where one interaction is in its life.
WhistlePendingPrompt
Section titled “WhistlePendingPrompt”WhistlePendingPrompt =
Readonly<{sequence:number;request:WhistlePrompt; }>
The one pending question, with the sequence its answer must name.
WhistleMessageNotice
Section titled “WhistleMessageNotice”WhistleMessageNotice =
Extract<WhistleNotice,Readonly<{type:"info"|"progress"|"success"; }>>
A notice that carries a message line.
WhistleHandoffNotice
Section titled “WhistleHandoffNotice”WhistleHandoffNotice =
Extract<WhistleNotice,Readonly<{type:"handoff"; }>>
A “continue elsewhere” notice.
WhistleInteractionSnapshot
Section titled “WhistleInteractionSnapshot”WhistleInteractionSnapshot =
Readonly<{title:string;status:WhistleInteractionStatus;message?:WhistleMessageNotice;handoff?:WhistleHandoffNotice;links: readonlyWhistleNoticeLink[];prompt?:WhistlePendingPrompt;failure?:string; }>
Everything a renderer needs to draw one interaction.
WhistleInteractionHost
Section titled “WhistleInteractionHost”WhistleInteractionHost =
Readonly<{snapshot: () =>WhistleInteractionSnapshot;subscribe: (listener) => () =>void;begin: () =>WhistleInteractionSession;answer: (sequence,value) =>boolean;cancel: () =>void; }>
A renderer-neutral store behind one interaction dialog or panel.
Functions
Section titled “Functions”createWhistleInteractionHost()
Section titled “createWhistleInteractionHost()”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”options
Section titled “options”Readonly<{ title: string; onEnd?: (end) => void; }>
Returns
Section titled “Returns”References
Section titled “References”interactionTextLimit
Section titled “interactionTextLimit”Re-exports interactionTextLimit