@solidrt/flux-types 0.0.72 → 0.0.74

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/gui/camera.d.ts CHANGED
@@ -57,7 +57,9 @@ declare module "flux:camera" {
57
57
  /**
58
58
  * List the available camera devices. The first call also starts the camera
59
59
  * subsystem, which comes up asynchronously: expect an empty list until the
60
- * initial cameraDeviceChange events arrive.
60
+ * initial cameraDeviceChange events arrive. Under a test that installed an
61
+ * image as the camera (`app.camera` of `@solidrt/test`) the list is that
62
+ * one camera, id 0, and every open shows the image.
61
63
  */
62
64
  export function listCameras(): CameraDevice[]
63
65
  /**
@@ -1,6 +1,7 @@
1
1
  // Microphone capture (gui-enabled runtime only). The imperative primitive;
2
2
  // @solidrt/core's createMicrophone wraps it with SolidJS reactivity. `open`
3
- // returns a bound session object, so the raw handle never leaves the runtime.
3
+ // resolves to a bound session object: its methods are bound, and its `id` is
4
+ // what a runtime module takes a reader of its own by.
4
5
 
5
6
  declare module "flux:microphone" {
6
7
  /** A microphone device from {@link listMicrophones}. */
@@ -21,19 +22,38 @@ declare module "flux:microphone" {
21
22
 
22
23
  /** An opened microphone session with controls bound to it. */
23
24
  type MicrophoneSession = {
25
+ /**
26
+ * The session's id: what the app hands a runtime module that reads this
27
+ * microphone on a thread of its own (`microphone_tap` in the runtime).
28
+ */
29
+ id: number
24
30
  /** The actual capture sample rate in Hz. */
25
31
  sampleRate: number
26
- /** Drain the mono float samples captured since the last read. */
32
+ /**
33
+ * Drain the mono float samples captured since the last read. The session
34
+ * keeps a 10 s window of audio, so there is no obligation to poll: a read
35
+ * later than that gets the last 10 s and the older samples are lost (the
36
+ * runtime logs it). A runtime module reading the session hears every
37
+ * sample too; reads do not take from each other.
38
+ */
27
39
  read(): Float32Array
28
- /** Release the device. */
40
+ /** Release the device. Every reader of the session, a module's included, ends. */
29
41
  close(): void
30
42
  }
31
43
 
32
- /** List the available microphone devices. */
44
+ /**
45
+ * List the available microphone devices. Under a test that installed a
46
+ * clip as the microphone (`app.microphone` of `@solidrt/test`) the list is
47
+ * that one microphone, id 0.
48
+ */
33
49
  export function listMicrophones(): MicrophoneDevice[]
34
50
  /**
35
- * Open a microphone. Synchronous: current platforms expose no audio permission
36
- * prompt.
51
+ * Open a microphone. Opening is the permission request: on Android the
52
+ * RECORD_AUDIO prompt comes up and the app keeps running behind it; the
53
+ * other platforms show none. Resolves once capture runs. Rejects when the
54
+ * user denies the permission ("microphone permission denied"), when the
55
+ * device cannot be opened, and under a test when the sample rate differs
56
+ * from the installed clip's.
37
57
  */
38
- export function open(options?: MicrophoneOpenOptions): MicrophoneSession
58
+ export function open(options?: MicrophoneOpenOptions): Promise<MicrophoneSession>
39
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidrt/flux-types",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "license": "MIT",
5
5
  "funding": "https://github.com/sponsors/wellawaretech",
6
6
  "author": "Antoine van Wel",