@ersbeth/picoflow 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/.vscode/settings.json +5 -0
- package/README.md +151 -0
- package/api/doc/index.md +31 -0
- package/api/doc/picoflow.derivation.md +55 -0
- package/api/doc/picoflow.effect.md +55 -0
- package/api/doc/picoflow.flowderivation._constructor_.md +49 -0
- package/api/doc/picoflow.flowderivation.get.md +23 -0
- package/api/doc/picoflow.flowderivation.md +86 -0
- package/api/doc/picoflow.flowdisposer.md +13 -0
- package/api/doc/picoflow.floweffect._constructor_.md +49 -0
- package/api/doc/picoflow.floweffect.dispose.md +21 -0
- package/api/doc/picoflow.floweffect.disposed.md +13 -0
- package/api/doc/picoflow.floweffect.md +131 -0
- package/api/doc/picoflow.flowgetter.md +15 -0
- package/api/doc/picoflow.flowmap._lastdeleted.md +21 -0
- package/api/doc/picoflow.flowmap._lastset.md +21 -0
- package/api/doc/picoflow.flowmap.delete.md +57 -0
- package/api/doc/picoflow.flowmap.md +135 -0
- package/api/doc/picoflow.flowmap.setat.md +73 -0
- package/api/doc/picoflow.flowobservable.get.md +19 -0
- package/api/doc/picoflow.flowobservable.md +54 -0
- package/api/doc/picoflow.flowresource._constructor_.md +65 -0
- package/api/doc/picoflow.flowresource.fetch.md +27 -0
- package/api/doc/picoflow.flowresource.get.md +23 -0
- package/api/doc/picoflow.flowresource.md +100 -0
- package/api/doc/picoflow.flowsetter.md +13 -0
- package/api/doc/picoflow.flowsignal.dispose.md +25 -0
- package/api/doc/picoflow.flowsignal.disposed.md +18 -0
- package/api/doc/picoflow.flowsignal.md +111 -0
- package/api/doc/picoflow.flowsignal.trigger.md +25 -0
- package/api/doc/picoflow.flowstate._constructor_.md +49 -0
- package/api/doc/picoflow.flowstate.get.md +23 -0
- package/api/doc/picoflow.flowstate.md +100 -0
- package/api/doc/picoflow.flowstate.set.md +61 -0
- package/api/doc/picoflow.flowstream._constructor_.md +65 -0
- package/api/doc/picoflow.flowstream.dispose.md +21 -0
- package/api/doc/picoflow.flowstream.get.md +23 -0
- package/api/doc/picoflow.flowstream.md +100 -0
- package/api/doc/picoflow.flowupdater.md +19 -0
- package/api/doc/picoflow.flowwatcher.md +15 -0
- package/api/doc/picoflow.map.md +59 -0
- package/api/doc/picoflow.md +287 -0
- package/api/doc/picoflow.resource.md +71 -0
- package/api/doc/picoflow.signal.md +19 -0
- package/api/doc/picoflow.state.md +55 -0
- package/api/doc/picoflow.stream.md +71 -0
- package/api/picoflow.api.md +145 -0
- package/api-extractor.json +60 -0
- package/biome.json +34 -0
- package/dist/picoflow.js +572 -0
- package/dist/types/creators.d.ts +70 -0
- package/dist/types/creators.d.ts.map +1 -0
- package/dist/types/derivation.d.ts +58 -0
- package/dist/types/derivation.d.ts.map +1 -0
- package/dist/types/effect.d.ts +108 -0
- package/dist/types/effect.d.ts.map +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/map.d.ts +75 -0
- package/dist/types/map.d.ts.map +1 -0
- package/dist/types/observable.d.ts +40 -0
- package/dist/types/observable.d.ts.map +1 -0
- package/dist/types/resource.d.ts +46 -0
- package/dist/types/resource.d.ts.map +1 -0
- package/dist/types/signal.d.ts +111 -0
- package/dist/types/signal.d.ts.map +1 -0
- package/dist/types/state.d.ts +39 -0
- package/dist/types/state.d.ts.map +1 -0
- package/dist/types/stream.d.ts +71 -0
- package/dist/types/stream.d.ts.map +1 -0
- package/package.json +40 -0
- package/src/creators.ts +101 -0
- package/src/derivation.ts +96 -0
- package/src/effect.ts +152 -0
- package/src/index.ts +30 -0
- package/src/map.ts +83 -0
- package/src/observable.ts +50 -0
- package/src/resource.ts +64 -0
- package/src/signal.ts +166 -0
- package/src/state.ts +52 -0
- package/src/stream.ts +99 -0
- package/test/derivation.test.ts +422 -0
- package/test/map.test.ts +106 -0
- package/test/resource.test.ts +127 -0
- package/test/signal.test.ts +59 -0
- package/test/state.test.ts +89 -0
- package/test/stream.test.ts +171 -0
- package/tsconfig.json +22 -0
- package/vite.config.ts +26 -0
- package/vitest.config.ts +11 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md)
|
|
4
|
+
|
|
5
|
+
## picoflow package
|
|
6
|
+
|
|
7
|
+
PicoFlow is a lightweight reactive dataflow library that provides a set of reactive primitives such as signals, state, resources, streams, derivations, effects, and reactive maps.
|
|
8
|
+
|
|
9
|
+
## Classes
|
|
10
|
+
|
|
11
|
+
<table><thead><tr><th>
|
|
12
|
+
|
|
13
|
+
Class
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
</th><th>
|
|
17
|
+
|
|
18
|
+
Description
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
</th></tr></thead>
|
|
22
|
+
<tbody><tr><td>
|
|
23
|
+
|
|
24
|
+
[FlowDerivation](./picoflow.flowderivation.md)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</td><td>
|
|
28
|
+
|
|
29
|
+
Represents a reactive derivation whose value is computed based on other reactive signals.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
</td></tr>
|
|
33
|
+
<tr><td>
|
|
34
|
+
|
|
35
|
+
[FlowEffect](./picoflow.floweffect.md)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
Represents a reactive effect that executes a side‐effect function based on its tracked dependencies.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td></tr>
|
|
44
|
+
<tr><td>
|
|
45
|
+
|
|
46
|
+
[FlowMap](./picoflow.flowmap.md)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</td><td>
|
|
50
|
+
|
|
51
|
+
Represents a reactive map of states that extends [FlowState](./picoflow.flowstate.md) for a Map of key/value pairs.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</td></tr>
|
|
55
|
+
<tr><td>
|
|
56
|
+
|
|
57
|
+
[FlowResource](./picoflow.flowresource.md)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
</td><td>
|
|
61
|
+
|
|
62
|
+
Represents a reactive resource that asynchronously fetches its value.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</td></tr>
|
|
66
|
+
<tr><td>
|
|
67
|
+
|
|
68
|
+
[FlowSignal](./picoflow.flowsignal.md)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
</td><td>
|
|
72
|
+
|
|
73
|
+
Represents a reactive signal.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
</td></tr>
|
|
77
|
+
<tr><td>
|
|
78
|
+
|
|
79
|
+
[FlowState](./picoflow.flowstate.md)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
</td><td>
|
|
83
|
+
|
|
84
|
+
Represents a reactive state that holds a mutable value.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
</td></tr>
|
|
88
|
+
<tr><td>
|
|
89
|
+
|
|
90
|
+
[FlowStream](./picoflow.flowstream.md)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</td><td>
|
|
94
|
+
|
|
95
|
+
Represents a reactive stream that updates its value based on an updater function.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</td></tr>
|
|
99
|
+
</tbody></table>
|
|
100
|
+
|
|
101
|
+
## Abstract Classes
|
|
102
|
+
|
|
103
|
+
<table><thead><tr><th>
|
|
104
|
+
|
|
105
|
+
Abstract Class
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
</th><th>
|
|
109
|
+
|
|
110
|
+
Description
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</th></tr></thead>
|
|
114
|
+
<tbody><tr><td>
|
|
115
|
+
|
|
116
|
+
[FlowObservable](./picoflow.flowobservable.md)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
</td><td>
|
|
120
|
+
|
|
121
|
+
Represents a reactive observable that carries a value.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
</td></tr>
|
|
125
|
+
</tbody></table>
|
|
126
|
+
|
|
127
|
+
## Functions
|
|
128
|
+
|
|
129
|
+
<table><thead><tr><th>
|
|
130
|
+
|
|
131
|
+
Function
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
</th><th>
|
|
135
|
+
|
|
136
|
+
Description
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
</th></tr></thead>
|
|
140
|
+
<tbody><tr><td>
|
|
141
|
+
|
|
142
|
+
[derivation(fn)](./picoflow.derivation.md)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
</td><td>
|
|
146
|
+
|
|
147
|
+
Creates a new reactive derivation whose value is computed based on other reactive signals.
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
</td></tr>
|
|
151
|
+
<tr><td>
|
|
152
|
+
|
|
153
|
+
[effect(fn)](./picoflow.effect.md)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
</td><td>
|
|
157
|
+
|
|
158
|
+
Creates a new reactive effect that executes a side-effect function based on its dependencies.
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</td></tr>
|
|
162
|
+
<tr><td>
|
|
163
|
+
|
|
164
|
+
[map(initial)](./picoflow.map.md)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
</td><td>
|
|
168
|
+
|
|
169
|
+
Creates a new reactive map state.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
</td></tr>
|
|
173
|
+
<tr><td>
|
|
174
|
+
|
|
175
|
+
[resource(fn, initial)](./picoflow.resource.md)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
</td><td>
|
|
179
|
+
|
|
180
|
+
Creates a new reactive resource that asynchronously fetches its value.
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
</td></tr>
|
|
184
|
+
<tr><td>
|
|
185
|
+
|
|
186
|
+
[signal()](./picoflow.signal.md)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
</td><td>
|
|
190
|
+
|
|
191
|
+
Creates a new reactive signal.
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
</td></tr>
|
|
195
|
+
<tr><td>
|
|
196
|
+
|
|
197
|
+
[state(value)](./picoflow.state.md)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
</td><td>
|
|
201
|
+
|
|
202
|
+
Creates a new reactive state holding a value.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</td></tr>
|
|
206
|
+
<tr><td>
|
|
207
|
+
|
|
208
|
+
[stream(updater, initial)](./picoflow.stream.md)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
</td><td>
|
|
212
|
+
|
|
213
|
+
Creates a new reactive stream.
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
</td></tr>
|
|
217
|
+
</tbody></table>
|
|
218
|
+
|
|
219
|
+
## Type Aliases
|
|
220
|
+
|
|
221
|
+
<table><thead><tr><th>
|
|
222
|
+
|
|
223
|
+
Type Alias
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
</th><th>
|
|
227
|
+
|
|
228
|
+
Description
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
</th></tr></thead>
|
|
232
|
+
<tbody><tr><td>
|
|
233
|
+
|
|
234
|
+
[FlowDisposer](./picoflow.flowdisposer.md)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
</td><td>
|
|
238
|
+
|
|
239
|
+
A function that disposes of a resource.
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
</td></tr>
|
|
243
|
+
<tr><td>
|
|
244
|
+
|
|
245
|
+
[FlowGetter](./picoflow.flowgetter.md)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
</td><td>
|
|
249
|
+
|
|
250
|
+
A function for retrieving the current value from a FlowObservable.
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
</td></tr>
|
|
254
|
+
<tr><td>
|
|
255
|
+
|
|
256
|
+
[FlowSetter](./picoflow.flowsetter.md)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
</td><td>
|
|
260
|
+
|
|
261
|
+
A function that sets a new value.
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
</td></tr>
|
|
265
|
+
<tr><td>
|
|
266
|
+
|
|
267
|
+
[FlowUpdater](./picoflow.flowupdater.md)
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
</td><td>
|
|
271
|
+
|
|
272
|
+
A function that performs updates on a stream.
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
</td></tr>
|
|
276
|
+
<tr><td>
|
|
277
|
+
|
|
278
|
+
[FlowWatcher](./picoflow.flowwatcher.md)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
</td><td>
|
|
282
|
+
|
|
283
|
+
A function for watching a FlowSignal.
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
</td></tr>
|
|
287
|
+
</tbody></table>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [resource](./picoflow.resource.md)
|
|
4
|
+
|
|
5
|
+
## resource() function
|
|
6
|
+
|
|
7
|
+
Creates a new reactive resource that asynchronously fetches its value.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function resource<T>(fn: () => Promise<T>, initial: T): FlowResource<T>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
<table><thead><tr><th>
|
|
18
|
+
|
|
19
|
+
Parameter
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</th><th>
|
|
23
|
+
|
|
24
|
+
Type
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</th><th>
|
|
28
|
+
|
|
29
|
+
Description
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
</th></tr></thead>
|
|
33
|
+
<tbody><tr><td>
|
|
34
|
+
|
|
35
|
+
fn
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
() => Promise<T>
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
An asynchronous function that fetches the resource value.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</td></tr>
|
|
49
|
+
<tr><td>
|
|
50
|
+
|
|
51
|
+
initial
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</td><td>
|
|
55
|
+
|
|
56
|
+
T
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
The initial value of the resource.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
</td></tr>
|
|
65
|
+
</tbody></table>
|
|
66
|
+
**Returns:**
|
|
67
|
+
|
|
68
|
+
[FlowResource](./picoflow.flowresource.md)<!-- --><T>
|
|
69
|
+
|
|
70
|
+
A new instance of [FlowResource](./picoflow.flowresource.md)<!-- -->.
|
|
71
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [signal](./picoflow.signal.md)
|
|
4
|
+
|
|
5
|
+
## signal() function
|
|
6
|
+
|
|
7
|
+
Creates a new reactive signal.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function signal(): FlowSignal;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
[FlowSignal](./picoflow.flowsignal.md)
|
|
17
|
+
|
|
18
|
+
A new instance of [FlowSignal](./picoflow.flowsignal.md)<!-- -->.
|
|
19
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [state](./picoflow.state.md)
|
|
4
|
+
|
|
5
|
+
## state() function
|
|
6
|
+
|
|
7
|
+
Creates a new reactive state holding a value.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function state<T>(value: T): FlowState<T>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
<table><thead><tr><th>
|
|
18
|
+
|
|
19
|
+
Parameter
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</th><th>
|
|
23
|
+
|
|
24
|
+
Type
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</th><th>
|
|
28
|
+
|
|
29
|
+
Description
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
</th></tr></thead>
|
|
33
|
+
<tbody><tr><td>
|
|
34
|
+
|
|
35
|
+
value
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
T
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
The initial value for the state.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</td></tr>
|
|
49
|
+
</tbody></table>
|
|
50
|
+
**Returns:**
|
|
51
|
+
|
|
52
|
+
[FlowState](./picoflow.flowstate.md)<!-- --><T>
|
|
53
|
+
|
|
54
|
+
A new instance of [FlowState](./picoflow.flowstate.md)<!-- -->.
|
|
55
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [stream](./picoflow.stream.md)
|
|
4
|
+
|
|
5
|
+
## stream() function
|
|
6
|
+
|
|
7
|
+
Creates a new reactive stream.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function stream<T>(updater: (set: (value: T) => void) => () => void, initial: T): FlowStream<T>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
<table><thead><tr><th>
|
|
18
|
+
|
|
19
|
+
Parameter
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</th><th>
|
|
23
|
+
|
|
24
|
+
Type
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</th><th>
|
|
28
|
+
|
|
29
|
+
Description
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
</th></tr></thead>
|
|
33
|
+
<tbody><tr><td>
|
|
34
|
+
|
|
35
|
+
updater
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
(set: (value: T) => void) => () => void
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
A function that receives a setter to update the stream's value. It should return a disposer function to clean up resources.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</td></tr>
|
|
49
|
+
<tr><td>
|
|
50
|
+
|
|
51
|
+
initial
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</td><td>
|
|
55
|
+
|
|
56
|
+
T
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
The initial value of the stream.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
</td></tr>
|
|
65
|
+
</tbody></table>
|
|
66
|
+
**Returns:**
|
|
67
|
+
|
|
68
|
+
[FlowStream](./picoflow.flowstream.md)<!-- --><T>
|
|
69
|
+
|
|
70
|
+
A new instance of [FlowStream](./picoflow.flowstream.md)<!-- -->.
|
|
71
|
+
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
## API Report File for "picoflow"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
// @public
|
|
8
|
+
export function derivation<T>(fn: (get: FlowGetter, watch: FlowWatcher) => T): FlowDerivation<T>;
|
|
9
|
+
|
|
10
|
+
// @public
|
|
11
|
+
export function effect(fn: (get: FlowGetter, watch: FlowWatcher) => void): FlowEffect;
|
|
12
|
+
|
|
13
|
+
// @public
|
|
14
|
+
export class FlowDerivation<T> extends FlowObservable<T> {
|
|
15
|
+
constructor(compute: (get: FlowGetter, watch: FlowWatcher) => T);
|
|
16
|
+
// @internal
|
|
17
|
+
_exec(): void;
|
|
18
|
+
get(): T;
|
|
19
|
+
// @internal
|
|
20
|
+
_notify(): void;
|
|
21
|
+
// @internal
|
|
22
|
+
_watch(): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// @public
|
|
26
|
+
export type FlowDisposer = () => void;
|
|
27
|
+
|
|
28
|
+
// @public
|
|
29
|
+
export class FlowEffect {
|
|
30
|
+
constructor(apply: (get: FlowGetter, watch: FlowWatcher) => void);
|
|
31
|
+
dispose(): void;
|
|
32
|
+
get disposed(): boolean;
|
|
33
|
+
// @internal
|
|
34
|
+
_exec(): void;
|
|
35
|
+
// @internal
|
|
36
|
+
_registerDependency(dependency: FlowSignal): void;
|
|
37
|
+
// @internal
|
|
38
|
+
_unregisterDependency(dependency: FlowSignal): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// @public
|
|
42
|
+
export type FlowGetter = <T>(observable: FlowObservable<T>) => T;
|
|
43
|
+
|
|
44
|
+
// @public
|
|
45
|
+
export class FlowMap<K, V> extends FlowState<Map<K, V>> {
|
|
46
|
+
$lastDeleted: FlowState<{
|
|
47
|
+
key?: K;
|
|
48
|
+
value?: V;
|
|
49
|
+
}>;
|
|
50
|
+
$lastSet: FlowState<{
|
|
51
|
+
key?: K;
|
|
52
|
+
value?: V;
|
|
53
|
+
}>;
|
|
54
|
+
delete(key: K): void;
|
|
55
|
+
setAt(key: K, value: V): void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// @public
|
|
59
|
+
export abstract class FlowObservable<T> extends FlowSignal {
|
|
60
|
+
abstract get(): T;
|
|
61
|
+
// @internal
|
|
62
|
+
_getFrom(listener: FlowObservable<unknown> | FlowEffect): T;
|
|
63
|
+
// @internal
|
|
64
|
+
protected _value: T;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// @public
|
|
68
|
+
export class FlowResource<T> extends FlowObservable<T> {
|
|
69
|
+
constructor(fetch: () => Promise<T>, initial: T);
|
|
70
|
+
fetch(): Promise<void>;
|
|
71
|
+
get(): T;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// @public
|
|
75
|
+
export type FlowSetter<T> = (value: T) => void;
|
|
76
|
+
|
|
77
|
+
// @public
|
|
78
|
+
export class FlowSignal {
|
|
79
|
+
// @internal (undocumented)
|
|
80
|
+
protected _dependencies: Set<FlowSignal>;
|
|
81
|
+
dispose(): void;
|
|
82
|
+
get disposed(): boolean;
|
|
83
|
+
// @internal (undocumented)
|
|
84
|
+
protected _disposed: boolean;
|
|
85
|
+
// @internal (undocumented)
|
|
86
|
+
protected _effects: Set<FlowEffect>;
|
|
87
|
+
// @internal (undocumented)
|
|
88
|
+
protected _listeners: Set<FlowSignal>;
|
|
89
|
+
// @internal
|
|
90
|
+
_notify(): void;
|
|
91
|
+
// @internal
|
|
92
|
+
_registerDependency(dependency: FlowSignal): void;
|
|
93
|
+
// @internal
|
|
94
|
+
_registerEffect(effect: FlowEffect): void;
|
|
95
|
+
// @internal
|
|
96
|
+
_registerListener(signal: FlowSignal): void;
|
|
97
|
+
trigger(): void;
|
|
98
|
+
// @internal
|
|
99
|
+
_unregisterDependency(dependency: FlowSignal): void;
|
|
100
|
+
// @internal
|
|
101
|
+
_unregisterEffect(effect: FlowEffect): void;
|
|
102
|
+
// @internal
|
|
103
|
+
_unregisterListener(signal: FlowSignal): void;
|
|
104
|
+
// @internal
|
|
105
|
+
_watch(): void;
|
|
106
|
+
// @internal
|
|
107
|
+
_watchFrom(listener: FlowSignal | FlowEffect): void;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// @public
|
|
111
|
+
export class FlowState<T> extends FlowObservable<T> {
|
|
112
|
+
constructor(value: T);
|
|
113
|
+
get(): T;
|
|
114
|
+
set(value: T): void;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// @public
|
|
118
|
+
export class FlowStream<T> extends FlowObservable<T> {
|
|
119
|
+
constructor(updater: FlowUpdater<T>, initial: T);
|
|
120
|
+
dispose(): void;
|
|
121
|
+
get(): T;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// @public
|
|
125
|
+
export type FlowUpdater<T> = (set: FlowSetter<T>) => FlowDisposer;
|
|
126
|
+
|
|
127
|
+
// @public
|
|
128
|
+
export type FlowWatcher = (signal: FlowSignal) => void;
|
|
129
|
+
|
|
130
|
+
// @public
|
|
131
|
+
export function map<K extends string | number | symbol, V>(initial?: Record<K, V>): FlowMap<K, V>;
|
|
132
|
+
|
|
133
|
+
// @public
|
|
134
|
+
export function resource<T>(fn: () => Promise<T>, initial: T): FlowResource<T>;
|
|
135
|
+
|
|
136
|
+
// @public
|
|
137
|
+
export function signal(): FlowSignal;
|
|
138
|
+
|
|
139
|
+
// @public
|
|
140
|
+
export function state<T>(value: T): FlowState<T>;
|
|
141
|
+
|
|
142
|
+
// @public
|
|
143
|
+
export function stream<T>(updater: (set: (value: T) => void) => () => void, initial: T): FlowStream<T>;
|
|
144
|
+
|
|
145
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/types/index.d.ts",
|
|
4
|
+
"newlineKind": "lf",
|
|
5
|
+
|
|
6
|
+
"apiReport": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"reportFolder": "<projectFolder>/api/",
|
|
9
|
+
"reportTempFolder": "<projectFolder>/api/temp/"
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
"docModel": {
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"apiJsonFilePath": "<projectFolder>/api/temp/<unscopedPackageName>.api.json",
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The base URL where the project's source code can be viewed on a website such as GitHub or
|
|
18
|
+
* Azure DevOps. This URL path corresponds to the `<projectFolder>` path on disk.
|
|
19
|
+
*
|
|
20
|
+
* This URL is concatenated with the file paths serialized to the doc model to produce URL file paths to individual API items.
|
|
21
|
+
* For example, if the `projectFolderUrl` is "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor" and an API
|
|
22
|
+
* item's file path is "api/ExtractorConfig.ts", the full URL file path would be
|
|
23
|
+
* "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor/api/ExtractorConfig.js".
|
|
24
|
+
*
|
|
25
|
+
* This setting can be omitted if you don't need source code links in your API documentation reference.
|
|
26
|
+
*
|
|
27
|
+
* SUPPORTED TOKENS: none
|
|
28
|
+
* DEFAULT VALUE: ""
|
|
29
|
+
*/
|
|
30
|
+
"projectFolderUrl": "https://gitlab.com/ersbeth-web/picomachine"
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
"dtsRollup": {
|
|
34
|
+
"enabled": false
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
"tsdocMetadata": {
|
|
38
|
+
"enabled": false
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
"messages": {
|
|
42
|
+
"compilerMessageReporting": {
|
|
43
|
+
"default": {
|
|
44
|
+
"logLevel": "warning"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"extractorMessageReporting": {
|
|
49
|
+
"default": {
|
|
50
|
+
"logLevel": "warning"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
"tsdocMessageReporting": {
|
|
55
|
+
"default": {
|
|
56
|
+
"logLevel": "warning"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|