@fungi.computer/whistle 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +373 -2
- package/dist/catalog.d.ts +459 -0
- package/dist/catalog.js +147 -0
- package/dist/html.d.ts +14 -0
- package/dist/html.js +11 -0
- package/dist/index.d.ts +253 -0
- package/dist/index.js +694 -0
- package/dist/interaction.d.ts +59 -0
- package/dist/interaction.js +131 -0
- package/dist/keymap.d.ts +34 -0
- package/dist/keymap.js +36 -0
- package/dist/wire.d.ts +380 -0
- package/dist/wire.js +299 -0
- package/docs/api/README.md +17 -0
- package/docs/api/catalog.md +498 -0
- package/docs/api/html.md +45 -0
- package/docs/api/index.md +675 -0
- package/docs/api/interaction.md +124 -0
- package/docs/api/wire.md +1033 -0
- package/package.json +87 -3
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/whistle**](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/whistle](README.md) / interaction
|
|
8
|
+
|
|
9
|
+
# interaction
|
|
10
|
+
|
|
11
|
+
## Type Aliases
|
|
12
|
+
|
|
13
|
+
### WhistleInteractionStatus
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type WhistleInteractionStatus =
|
|
17
|
+
"working" | "prompting" | "failed" | "done" | "cancelled";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Where one interaction is in its life.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
### WhistlePendingPrompt
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
type WhistlePendingPrompt = Readonly<{
|
|
28
|
+
sequence: number;
|
|
29
|
+
request: WhistlePrompt;
|
|
30
|
+
}>;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The one pending question, with the sequence its answer must name.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
### WhistleMessageNotice
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
type WhistleMessageNotice = Extract<
|
|
41
|
+
WhistleNotice,
|
|
42
|
+
Readonly<{
|
|
43
|
+
type: "info" | "progress" | "success";
|
|
44
|
+
}>
|
|
45
|
+
>;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
A notice that carries a message line.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### WhistleHandoffNotice
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
type WhistleHandoffNotice = Extract<
|
|
56
|
+
WhistleNotice,
|
|
57
|
+
Readonly<{
|
|
58
|
+
type: "handoff";
|
|
59
|
+
}>
|
|
60
|
+
>;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
A "continue elsewhere" notice.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### WhistleInteractionSnapshot
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
type WhistleInteractionSnapshot = Readonly<{
|
|
71
|
+
title: string;
|
|
72
|
+
status: WhistleInteractionStatus;
|
|
73
|
+
message?: WhistleMessageNotice;
|
|
74
|
+
handoff?: WhistleHandoffNotice;
|
|
75
|
+
links: readonly WhistleNoticeLink[];
|
|
76
|
+
prompt?: WhistlePendingPrompt;
|
|
77
|
+
failure?: string;
|
|
78
|
+
}>;
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Everything a renderer needs to draw one interaction.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### WhistleInteractionHost
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
type WhistleInteractionHost = Readonly<{
|
|
89
|
+
snapshot: () => WhistleInteractionSnapshot;
|
|
90
|
+
subscribe: (listener) => () => void;
|
|
91
|
+
begin: () => WhistleInteractionSession;
|
|
92
|
+
answer: (sequence, value) => boolean;
|
|
93
|
+
cancel: () => void;
|
|
94
|
+
}>;
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
A renderer-neutral store behind one interaction dialog or panel.
|
|
98
|
+
|
|
99
|
+
## Functions
|
|
100
|
+
|
|
101
|
+
### createWhistleInteractionHost()
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
function createWhistleInteractionHost(options): WhistleInteractionHost;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Own one interaction's state for any renderer. Prompts and notices are parsed
|
|
108
|
+
here, at the boundary where command-supplied data becomes UI.
|
|
109
|
+
|
|
110
|
+
#### Parameters
|
|
111
|
+
|
|
112
|
+
| Parameter | Type |
|
|
113
|
+
| --------- | ------------------------------------------------------------------- |
|
|
114
|
+
| `options` | `Readonly`\<\{ `title`: `string`; `onEnd?`: (`end`) => `void`; \}\> |
|
|
115
|
+
|
|
116
|
+
#### Returns
|
|
117
|
+
|
|
118
|
+
[`WhistleInteractionHost`](#whistleinteractionhost)
|
|
119
|
+
|
|
120
|
+
## References
|
|
121
|
+
|
|
122
|
+
### interactionTextLimit
|
|
123
|
+
|
|
124
|
+
Re-exports [interactionTextLimit](wire.md#interactiontextlimit)
|