effect-web-midi 0.2.3

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.
Files changed (232) hide show
  1. package/README.md +276 -0
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/src/EMIDIAccess.js +129 -0
  5. package/dist/src/EMIDIAccess.js.map +1 -0
  6. package/dist/src/EMIDIInput.js +226 -0
  7. package/dist/src/EMIDIInput.js.map +1 -0
  8. package/dist/src/EMIDIOutput.js +227 -0
  9. package/dist/src/EMIDIOutput.js.map +1 -0
  10. package/dist/src/EMIDIPort.js +218 -0
  11. package/dist/src/EMIDIPort.js.map +1 -0
  12. package/dist/src/MIDIErrors.js +4 -0
  13. package/dist/src/MIDIErrors.js.map +1 -0
  14. package/dist/src/MIDIEventStreams.js +2 -0
  15. package/dist/src/MIDIEventStreams.js.map +1 -0
  16. package/dist/src/Parsing.js +2 -0
  17. package/dist/src/Parsing.js.map +1 -0
  18. package/dist/src/StreamMaker.js +1 -0
  19. package/dist/src/StreamMaker.js.map +1 -0
  20. package/dist/src/Util.js +2 -0
  21. package/dist/src/Util.js.map +1 -0
  22. package/dist/src/index.js +10 -0
  23. package/dist/src/index.js.map +1 -0
  24. package/dist/src/internal/EMIDIAccess.js +634 -0
  25. package/dist/src/internal/EMIDIAccess.js.map +1 -0
  26. package/dist/src/internal/EMIDIInput.js +66 -0
  27. package/dist/src/internal/EMIDIInput.js.map +1 -0
  28. package/dist/src/internal/EMIDIOutput.js +120 -0
  29. package/dist/src/internal/EMIDIOutput.js.map +1 -0
  30. package/dist/src/internal/EMIDIPort.js +125 -0
  31. package/dist/src/internal/EMIDIPort.js.map +1 -0
  32. package/dist/src/internal/MIDIErrors.js +190 -0
  33. package/dist/src/internal/MIDIErrors.js.map +1 -0
  34. package/dist/src/internal/MIDIEventStreams.js +41 -0
  35. package/dist/src/internal/MIDIEventStreams.js.map +1 -0
  36. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.js +27 -0
  37. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.js.map +1 -0
  38. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.js +19 -0
  39. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.js.map +1 -0
  40. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.js +16 -0
  41. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.js.map +1 -0
  42. package/dist/src/internal/MIDIPortMethodCalls/actOnPort.js +17 -0
  43. package/dist/src/internal/MIDIPortMethodCalls/actOnPort.js.map +1 -0
  44. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.js +27 -0
  45. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.js.map +1 -0
  46. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.js +18 -0
  47. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.js.map +1 -0
  48. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.js +16 -0
  49. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.js.map +1 -0
  50. package/dist/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.js +21 -0
  51. package/dist/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.js.map +1 -0
  52. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.js +34 -0
  53. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.js.map +1 -0
  54. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.js +18 -0
  55. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.js.map +1 -0
  56. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.js +16 -0
  57. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.js.map +1 -0
  58. package/dist/src/internal/Parsing.js +119 -0
  59. package/dist/src/internal/Parsing.js.map +1 -0
  60. package/dist/src/internal/StreamMaker.js +105 -0
  61. package/dist/src/internal/StreamMaker.js.map +1 -0
  62. package/dist/src/internal/Util.js +59 -0
  63. package/dist/src/internal/Util.js.map +1 -0
  64. package/dist/src/internal/getPortByPortId/getPortByPortIdAndAccess.js +53 -0
  65. package/dist/src/internal/getPortByPortId/getPortByPortIdAndAccess.js.map +1 -0
  66. package/dist/src/internal/getPortByPortId/getPortByPortIdInContext.js +18 -0
  67. package/dist/src/internal/getPortByPortId/getPortByPortIdInContext.js.map +1 -0
  68. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.js +52 -0
  69. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.js.map +1 -0
  70. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.js +21 -0
  71. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.js.map +1 -0
  72. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.js +21 -0
  73. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.js.map +1 -0
  74. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.js +66 -0
  75. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.js.map +1 -0
  76. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.js +61 -0
  77. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.js.map +1 -0
  78. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.js +68 -0
  79. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.js.map +1 -0
  80. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.js +42 -0
  81. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.js.map +1 -0
  82. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.js +43 -0
  83. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.js.map +1 -0
  84. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.js +33 -0
  85. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.js.map +1 -0
  86. package/dist/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.js +6 -0
  87. package/dist/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.js.map +1 -0
  88. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.js +46 -0
  89. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.js.map +1 -0
  90. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.js +25 -0
  91. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.js.map +1 -0
  92. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.js +31 -0
  93. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.js.map +1 -0
  94. package/dist-types/index.d.ts +2 -0
  95. package/dist-types/index.d.ts.map +1 -0
  96. package/dist-types/src/EMIDIAccess.d.ts +18 -0
  97. package/dist-types/src/EMIDIAccess.d.ts.map +1 -0
  98. package/dist-types/src/EMIDIInput.d.ts +26 -0
  99. package/dist-types/src/EMIDIInput.d.ts.map +1 -0
  100. package/dist-types/src/EMIDIOutput.d.ts +26 -0
  101. package/dist-types/src/EMIDIOutput.d.ts.map +1 -0
  102. package/dist-types/src/EMIDIPort.d.ts +26 -0
  103. package/dist-types/src/EMIDIPort.d.ts.map +1 -0
  104. package/dist-types/src/MIDIErrors.d.ts +2 -0
  105. package/dist-types/src/MIDIErrors.d.ts.map +1 -0
  106. package/dist-types/src/MIDIEventStreams.d.ts +2 -0
  107. package/dist-types/src/MIDIEventStreams.d.ts.map +1 -0
  108. package/dist-types/src/Parsing.d.ts +2 -0
  109. package/dist-types/src/Parsing.d.ts.map +1 -0
  110. package/dist-types/src/StreamMaker.d.ts +2 -0
  111. package/dist-types/src/StreamMaker.d.ts.map +1 -0
  112. package/dist-types/src/Util.d.ts +2 -0
  113. package/dist-types/src/Util.d.ts.map +1 -0
  114. package/dist-types/src/index.d.ts +10 -0
  115. package/dist-types/src/index.d.ts.map +1 -0
  116. package/dist-types/src/internal/EMIDIAccess.d.ts +551 -0
  117. package/dist-types/src/internal/EMIDIAccess.d.ts.map +1 -0
  118. package/dist-types/src/internal/EMIDIInput.d.ts +50 -0
  119. package/dist-types/src/internal/EMIDIInput.d.ts.map +1 -0
  120. package/dist-types/src/internal/EMIDIOutput.d.ts +95 -0
  121. package/dist-types/src/internal/EMIDIOutput.d.ts.map +1 -0
  122. package/dist-types/src/internal/EMIDIPort.d.ts +90 -0
  123. package/dist-types/src/internal/EMIDIPort.d.ts.map +1 -0
  124. package/dist-types/src/internal/MIDIErrors.d.ts +270 -0
  125. package/dist-types/src/internal/MIDIErrors.d.ts.map +1 -0
  126. package/dist-types/src/internal/MIDIEventStreams.d.ts +74 -0
  127. package/dist-types/src/internal/MIDIEventStreams.d.ts.map +1 -0
  128. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.d.ts +16 -0
  129. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.d.ts.map +1 -0
  130. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.d.ts +15 -0
  131. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.d.ts.map +1 -0
  132. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.d.ts +13 -0
  133. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.d.ts.map +1 -0
  134. package/dist-types/src/internal/MIDIPortMethodCalls/actOnPort.d.ts +11 -0
  135. package/dist-types/src/internal/MIDIPortMethodCalls/actOnPort.d.ts.map +1 -0
  136. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.d.ts +23 -0
  137. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.d.ts.map +1 -0
  138. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.d.ts +15 -0
  139. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.d.ts.map +1 -0
  140. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.d.ts +13 -0
  141. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.d.ts.map +1 -0
  142. package/dist-types/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.d.ts +15 -0
  143. package/dist-types/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.d.ts.map +1 -0
  144. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.d.ts +21 -0
  145. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.d.ts.map +1 -0
  146. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.d.ts +15 -0
  147. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.d.ts.map +1 -0
  148. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.d.ts +13 -0
  149. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.d.ts.map +1 -0
  150. package/dist-types/src/internal/Parsing.d.ts +110 -0
  151. package/dist-types/src/internal/Parsing.d.ts.map +1 -0
  152. package/dist-types/src/internal/StreamMaker.d.ts +204 -0
  153. package/dist-types/src/internal/StreamMaker.d.ts.map +1 -0
  154. package/dist-types/src/internal/Util.d.ts +33 -0
  155. package/dist-types/src/internal/Util.d.ts.map +1 -0
  156. package/dist-types/src/internal/getPortByPortId/getPortByPortIdAndAccess.d.ts +27 -0
  157. package/dist-types/src/internal/getPortByPortId/getPortByPortIdAndAccess.d.ts.map +1 -0
  158. package/dist-types/src/internal/getPortByPortId/getPortByPortIdInContext.d.ts +20 -0
  159. package/dist-types/src/internal/getPortByPortId/getPortByPortIdInContext.d.ts.map +1 -0
  160. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.d.ts +76 -0
  161. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.d.ts.map +1 -0
  162. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.d.ts +39 -0
  163. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.d.ts.map +1 -0
  164. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.d.ts +29 -0
  165. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.d.ts.map +1 -0
  166. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.d.ts +62 -0
  167. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.d.ts.map +1 -0
  168. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.d.ts +16 -0
  169. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.d.ts.map +1 -0
  170. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.d.ts +65 -0
  171. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.d.ts.map +1 -0
  172. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.d.ts +36 -0
  173. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.d.ts.map +1 -0
  174. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.d.ts +23 -0
  175. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.d.ts.map +1 -0
  176. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.d.ts +35 -0
  177. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.d.ts.map +1 -0
  178. package/dist-types/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.d.ts +7 -0
  179. package/dist-types/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.d.ts.map +1 -0
  180. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.d.ts +71 -0
  181. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.d.ts.map +1 -0
  182. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.d.ts +7 -0
  183. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.d.ts.map +1 -0
  184. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.d.ts +28 -0
  185. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.d.ts.map +1 -0
  186. package/index.ts +1 -0
  187. package/package.json +87 -0
  188. package/src/EMIDIAccess.ts +285 -0
  189. package/src/EMIDIInput.ts +273 -0
  190. package/src/EMIDIOutput.ts +272 -0
  191. package/src/EMIDIPort.ts +270 -0
  192. package/src/MIDIErrors.ts +13 -0
  193. package/src/MIDIEventStreams.ts +36 -0
  194. package/src/Parsing.ts +32 -0
  195. package/src/StreamMaker.ts +12 -0
  196. package/src/Util.ts +19 -0
  197. package/src/index.ts +9 -0
  198. package/src/internal/EMIDIAccess.ts +1280 -0
  199. package/src/internal/EMIDIInput.ts +114 -0
  200. package/src/internal/EMIDIOutput.ts +231 -0
  201. package/src/internal/EMIDIPort.ts +239 -0
  202. package/src/internal/MIDIErrors.ts +260 -0
  203. package/src/internal/MIDIEventStreams.ts +255 -0
  204. package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.ts +48 -0
  205. package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.ts +31 -0
  206. package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.ts +28 -0
  207. package/src/internal/MIDIPortMethodCalls/actOnPort.ts +66 -0
  208. package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.ts +38 -0
  209. package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.ts +38 -0
  210. package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.ts +28 -0
  211. package/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.ts +68 -0
  212. package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.ts +48 -0
  213. package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.ts +38 -0
  214. package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.ts +28 -0
  215. package/src/internal/Parsing.ts +304 -0
  216. package/src/internal/StreamMaker.ts +416 -0
  217. package/src/internal/Util.ts +152 -0
  218. package/src/internal/getPortByPortId/getPortByPortIdAndAccess.ts +117 -0
  219. package/src/internal/getPortByPortId/getPortByPortIdInContext.ts +26 -0
  220. package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.ts +148 -0
  221. package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.ts +135 -0
  222. package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.ts +70 -0
  223. package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.ts +128 -0
  224. package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.ts +74 -0
  225. package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.ts +132 -0
  226. package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.ts +64 -0
  227. package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.ts +114 -0
  228. package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.ts +47 -0
  229. package/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.ts +12 -0
  230. package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.ts +182 -0
  231. package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.ts +29 -0
  232. package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.ts +87 -0
@@ -0,0 +1,551 @@
1
+ /** biome-ignore-all lint/style/useShorthandFunctionType: It's a nice way to
2
+ * preserve JSDoc comments attached to the function signature */
3
+ import * as Context from 'effect/Context';
4
+ import * as Effect from 'effect/Effect';
5
+ import * as Equal from 'effect/Equal';
6
+ import * as Inspectable from 'effect/Inspectable';
7
+ import * as Layer from 'effect/Layer';
8
+ import * as Pipeable from 'effect/Pipeable';
9
+ import type * as Types from 'effect/Types';
10
+ import * as EMIDIInput from './EMIDIInput.ts';
11
+ import * as EMIDIOutput from './EMIDIOutput.ts';
12
+ import type * as EMIDIPort from './EMIDIPort.ts';
13
+ import * as MIDIErrors from './MIDIErrors.ts';
14
+ import * as StreamMaker from './StreamMaker.ts';
15
+ import * as Util from './Util.ts';
16
+ /**
17
+ * Unique symbol used for distinguishing
18
+ * {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance}s from other objects at
19
+ * both runtime and type-level
20
+ * @internal
21
+ */
22
+ declare const TypeId: unique symbol;
23
+ /**
24
+ * Unique symbol used for distinguishing
25
+ * {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance}s from other objects at
26
+ * both runtime and type-level
27
+ */
28
+ export type TypeId = typeof TypeId;
29
+ declare const EMIDIAccess_base: Context.TagClass<EMIDIAccess, "effect-web-midi/EMIDIAccess", EMIDIAccessInstance>;
30
+ /**
31
+ * A tag that allows to provide
32
+ * {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance} once with e.g.
33
+ * {@linkcode layer}, {@linkcode layerSystemExclusiveSupported}, etc. and reuse
34
+ * it anywhere, instead of repeatedly {@linkcode request}ing it.
35
+ *
36
+ * The downside of using DI might be that in different places of the app it
37
+ * would be harder to maintain tight MIDI permission scopes.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * import * as EMIDIAccess from 'effect-web-midi/EMIDIAccess';
42
+ * import * as Effect from 'effect/Effect'
43
+ *
44
+ * const program = Effect.gen(function* () {
45
+ * // ^ Effect.Effect<
46
+ * // void,
47
+ * // | AbortError
48
+ * // | UnderlyingSystemError
49
+ * // | MIDIAccessNotAllowedError
50
+ * // | MIDIAccessNotSupportedError
51
+ * // never
52
+ * // >
53
+ *
54
+ * const access = yield* EMIDIAccess.EMIDIAccess
55
+ * // ^ EMIDIAccess.Instance
56
+ *
57
+ * console.log(access.sysexEnabled)
58
+ * // ^ true
59
+ * }).pipe(Effect.provide(EMIDIAccess.layerSystemExclusiveSupported))
60
+ * ```
61
+ *
62
+ * @see `navigator.requestMIDIAccess` {@link https://www.w3.org/TR/webmidi/#dom-navigator-requestmidiaccess|Web MIDI spec}, {@link https://developer.mozilla.org/en-US/docs/Web/API/Navigator/requestMIDIAccess|MDN reference}
63
+ */
64
+ export declare class EMIDIAccess extends EMIDIAccess_base {
65
+ }
66
+ export interface RequestMIDIAccessOptions {
67
+ /**
68
+ * This field informs the system whether the ability to send and receive
69
+ * `System Exclusive` messages is requested or allowed on a given
70
+ * {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance} object.
71
+ *
72
+ * If this field is set to `true`, but `System Exclusive` support is denied
73
+ * (either by policy or by user action), the access request will fail with a
74
+ * {@linkcode MIDIErrors.MIDIAccessNotAllowedError} error.
75
+ *
76
+ * If this support is not requested (and allowed), the system will throw
77
+ * exceptions if the user tries to send `System Exclusive` messages, and will
78
+ * silently mask out any `System Exclusive` messages received on the port.
79
+ *
80
+ * @default false
81
+ * @see {@link https://www.w3.org/TR/webmidi/#dom-midioptions-sysex|Web MIDI spec}, {@link https://developer.mozilla.org/en-US/docs/Web/API/Navigator/requestMIDIAccess#sysex|MDN reference}
82
+ */
83
+ readonly sysex?: boolean;
84
+ /**
85
+ * This field informs the system whether the ability to utilize any software
86
+ * synthesizers installed in the host system is requested or allowed on a
87
+ * given {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance} object.
88
+ *
89
+ * If this field is set to `true`, but software synthesizer support is denied
90
+ * (either by policy or by user action), the access request will fail with a
91
+ * {@linkcode MIDIErrors.MIDIAccessNotAllowedError} error.
92
+ *
93
+ * If this support is not requested,
94
+ * {@linkcode AllPortsRecord|EMIDIAccess.AllPortsRecord},
95
+ * {@linkcode getInputsRecord|EMIDIAccess.getInputsRecord},
96
+ * {@linkcode OutputsArray|EMIDIAccess.OutputsArray}, etc. would not include
97
+ * any software synthesizers.
98
+ *
99
+ * Note that may result in a two-step request procedure if software
100
+ * synthesizer support is desired but not required - software synthesizers may
101
+ * be disabled when MIDI hardware device access is allowed.
102
+ *
103
+ * @default false
104
+ * @see {@link https://www.w3.org/TR/webmidi/#dom-midioptions-software|Web MIDI spec}, {@link https://developer.mozilla.org/en-US/docs/Web/API/Navigator/requestMIDIAccess#software|MDN reference}
105
+ */
106
+ readonly software?: boolean;
107
+ }
108
+ /**
109
+ * Thin wrapper around raw {@linkcode MIDIAccess} instance. Will be seen in all the
110
+ * external code. Has a word `Instance` in the name to avoid confusion with
111
+ * {@linkcode EMIDIAccess|EMIDIAccess.EMIDIAccess} context tag.
112
+ */
113
+ export interface EMIDIAccessInstance extends Equal.Equal, Pipeable.Pipeable, Inspectable.Inspectable {
114
+ readonly [TypeId]: TypeId;
115
+ readonly _tag: 'EMIDIAccess';
116
+ /**
117
+ * The **`sysexEnabled`** read-only property of the MIDIAccess interface indicates whether system exclusive support is enabled on the current MIDIAccess instance.
118
+ *
119
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIAccess/sysexEnabled)
120
+ */
121
+ readonly sysexEnabled: boolean;
122
+ readonly softwareSynthEnabled: boolean;
123
+ }
124
+ /**
125
+ * Thin wrapper around raw {@linkcode MIDIAccess} instance giving access to the
126
+ * actual field storing it. Has a word `Instance` in the name to avoid confusion
127
+ * with {@linkcode EMIDIAccess|EMIDIAccess.EMIDIAccess} context tag.
128
+ * @internal
129
+ */
130
+ interface EMIDIAccessImplementationInstance extends EMIDIAccessInstance {
131
+ readonly _access: MIDIAccess;
132
+ readonly _config: Readonly<RequestMIDIAccessOptions>;
133
+ }
134
+ /**
135
+ * Asserts that an `unknown` value is a valid {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance}
136
+ * and casts it to the type. Throws an error if the assertion fails.
137
+ *
138
+ * @internal
139
+ * @example
140
+ * ```ts
141
+ * import * as EMIDIAccess from 'effect-web-midi/EMIDIAccess';
142
+ *
143
+ * const unknownValue: null | EMIDIAccess.Instance = null
144
+ *
145
+ * try {
146
+ * const validatedAccess = EMIDIAccess.assert(unknownValue);
147
+ * // validatedAccess is now known to be EMIDIAccess.Instance
148
+ * } catch (error) {
149
+ * console.error("Assertion failed:", error);
150
+ * }
151
+ * ```
152
+ *
153
+ * @see {@linkcode is|EMIDIAccess.is}
154
+ */
155
+ export declare const assert: (access: unknown) => EMIDIAccessInstance;
156
+ /**
157
+ * Purely a type-level typecast to expose internal fields. Does no runtime
158
+ * validation and assumes you provided
159
+ * {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance} acquired legitimately
160
+ * from `effect-web-midi`.
161
+ *
162
+ * @internal
163
+ * @example
164
+ * ```ts
165
+ * // Assume `accessInstance` is known to be an internal implementation
166
+ * declare const accessPublic: EMIDIAccessInstance;
167
+ * const accessInternal = assumeImpl(accessPublic);
168
+ * console.log('No type error here: ', accessInternal._config)
169
+ * ```
170
+ */
171
+ export declare const assumeImpl: (access: EMIDIAccessInstance) => EMIDIAccessImplementationInstance;
172
+ /**
173
+ * @example
174
+ * ```ts
175
+ * import * as EMIDIAccess from 'effect-web-midi/EMIDIAccess';
176
+ *
177
+ * const accessOrNot: null | EMIDIAccess.Instance = null
178
+ *
179
+ * if (EMIDIAccess.is(accessOrNot)) {
180
+ * const accessPublic = accessOrNot;
181
+ * // ts-expect-error You're exposed only to public facing fields
182
+ * console.log(accessPublic._config)
183
+ * // will not be logged
184
+ * } else {
185
+ * console.log('This will be logged because null is not EMIDIAccessInstance')
186
+ * }
187
+ * ```
188
+ *
189
+ * @see {@linkcode assert|EMIDIAccess.assert}
190
+ */
191
+ export declare const is: (access: unknown) => access is EMIDIAccessInstance;
192
+ /**
193
+ * This utility function is used internally to handle different ways MIDI access
194
+ * might be provided, ensuring a consistent type for further operations. It uses
195
+ * the public {@linkcode is|EMIDIAccess.is} type guard for validation. If an
196
+ * effect is passed, errors and requirements are passed-through without
197
+ * modifications.
198
+ *
199
+ * @internal
200
+ * @param polymorphicAccess Either just {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance}, or an
201
+ * Effect having it in the success channel.
202
+ * @returns An effect with type-asserted at runtime
203
+ * {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance}.
204
+ *
205
+ * @example
206
+ * ```ts
207
+ * import * as Effect from 'effect/Effect';
208
+ * import * as EMIDIAccess from 'effect-web-midi/EMIDIAccess';
209
+ *
210
+ * const getValidatedAccess = Effect.gen(function* () {
211
+ * // Assume `polymorphicAccess` is obtained elsewhere
212
+ * const polymorphicAccess = {} as EMIDIAccess.PolymorphicInstance;
213
+ * const validatedAccess = yield* EMIDIAccess.simplify(polymorphicAccess);
214
+ * // The operation above will throw a defect, because {} is not an access instance
215
+ * return validatedAccess;
216
+ * });
217
+ * ```
218
+ *
219
+ * @see {@linkcode Util.fromPolymorphic}
220
+ * @see {@linkcode PolymorphicAccessInstance|EMIDIAccess.PolymorphicInstance}
221
+ * @see {@linkcode PolymorphicAccessInstanceClean|EMIDIAccess.PolymorphicCleanInstance}
222
+ */
223
+ export declare const simplify: <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>) => Effect.Effect<EMIDIAccessInstance, E, R>;
224
+ /**
225
+ * Represents a MIDI access instance that can be provided polymorphically:
226
+ * directly as a value ({@linkcode EMIDIAccessInstance|EMIDIAccess.Instance}),
227
+ * or wrapped in effect. Typically processed by
228
+ * {@linkcode simplify|EMIDIAccess.simplify}.
229
+ *
230
+ * @template E The type of errors that can be thrown while acquiring the access.
231
+ * @template R The environment required to simplify the access.
232
+ *
233
+ * @example
234
+ * ```ts
235
+ * import * as Effect from 'effect/Effect';
236
+ * import * as EMIDIAccess from 'effect-web-midi/EMIDIAccess';
237
+ * import type * as MIDIErrors from 'effect-web-midi/MIDIErrors';
238
+ *
239
+ * let polymorphicAccess: EMIDIAccess.PolymorphicInstance<
240
+ * | MIDIErrors.MIDIAccessNotAllowedError
241
+ * | MIDIErrors.MIDIAccessNotSupportedError,
242
+ * never
243
+ * > = EMIDIAccess.request().pipe(
244
+ * Effect.catchTag('AbortError', 'UnderlyingSystemError', () =>
245
+ * Effect.dieMessage('YOLO'),
246
+ * ),
247
+ * )
248
+ *
249
+ * if (Effect.isEffect(polymorphicAccess)) {
250
+ * const access: EMIDIAccess.Instance = await Effect.runPromise(polymorphicAccess)
251
+ * // Assignment of plain instance works just fine
252
+ * polymorphicAccess = access
253
+ * }
254
+ * ```
255
+ *
256
+ * @see {@linkcode simplify|EMIDIAccess.simplify}
257
+ * @see {@linkcode PolymorphicAccessInstanceClean|EMIDIAccess.PolymorphicCleanInstance}
258
+ */
259
+ export type PolymorphicAccessInstance<E, R> = Util.PolymorphicEffect<EMIDIAccessInstance, E, R>;
260
+ /**
261
+ * Represents a MIDI access instance that can be provided polymorphically:
262
+ * directly as a value ({@linkcode EMIDIAccessInstance|EMIDIAccess.Instance}),
263
+ * or wrapped in effect that never fails and doesn't require any context.
264
+ * Typically processed by {@linkcode simplify|EMIDIAccess.simplify}.
265
+ *
266
+ * @example
267
+ * ```ts
268
+ * import * as Effect from 'effect/Effect';
269
+ * import * as EMIDIAccess from 'effect-web-midi/EMIDIAccess';
270
+ *
271
+ * let polymorphicAccess: EMIDIAccess.PolymorphicCleanInstance =
272
+ * Effect.orDie(EMIDIAccess.request())
273
+ *
274
+ * if (Effect.isEffect(polymorphicAccess)) {
275
+ * const access: EMIDIAccess.Instance =
276
+ * await Effect.runPromise(polymorphicAccess)
277
+ * // Assignment of plain instance works just fine
278
+ * polymorphicAccess = access
279
+ * }
280
+ * ```
281
+ *
282
+ * @see {@linkcode simplify|EMIDIAccess.simplify}
283
+ * @see {@linkcode PolymorphicAccessInstance|EMIDIAccess.PolymorphicInstance}
284
+ */
285
+ export type PolymorphicAccessInstanceClean = PolymorphicAccessInstance<never, never>;
286
+ /**
287
+ * Interface for functions that retrieve a port record from polymorphic access.
288
+ */
289
+ export interface GetPortRecordFromPolymorphicAccess<RecordEntries extends UnknownEntriesUnion> {
290
+ /**
291
+ * @param polymorphicAccess Optionally wrapped in effect {@linkcode EMIDIAccessInstance|EMIDIAccess.Instance}.
292
+ * @returns Effect with `Record` of MIDI port ids mapped to according effectful ports
293
+ */
294
+ <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>): Effect.Effect<EntriesToRecord<RecordEntries>, E, R>;
295
+ }
296
+ /**
297
+ * Utility type to convert union of entries to a record type.
298
+ *
299
+ * @template Entries The union of entry tuples.
300
+ */
301
+ export type EntriesToRecord<Entries extends UnknownEntriesUnion> = Types.UnionToIntersection<Entries extends unknown ? Record<Entries[0], Entries[1]> : never>;
302
+ /**
303
+ * Placeholder tuple representing `Record` entry
304
+ */
305
+ export type UnknownEntriesUnion = [string, unknown];
306
+ /**
307
+ * Because `MIDIInputMap` can potentially be a mutable object, meaning new
308
+ * devices can be added or removed at runtime, it is effectful.
309
+ *
310
+ * The **`inputs`** read-only property of the MIDIAccess interface provides
311
+ * access to any available MIDI input ports.
312
+ *
313
+ * [MDN
314
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIAccess/inputs)
315
+ */
316
+ export declare const getInputsRecord: GetPortRecordFromPolymorphicAccess<InputRecordEntry>;
317
+ type InputRecordEntry = [EMIDIInput.Id, EMIDIInput.EMIDIInput];
318
+ /**
319
+ * Because `MIDIOutputMap` can potentially be a mutable object, meaning new
320
+ * devices can be added or removed at runtime, it is effectful.
321
+ *
322
+ * The **`outputs`** read-only property of the MIDIAccess interface provides
323
+ * access to any available MIDI output ports.
324
+ *
325
+ * [MDN
326
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIAccess/outputs)
327
+ */
328
+ export declare const getOutputsRecord: GetPortRecordFromPolymorphicAccess<OutputRecordEntry>;
329
+ type OutputRecordEntry = [EMIDIOutput.Id, EMIDIOutput.EMIDIOutput];
330
+ /**
331
+ *
332
+ *
333
+ */
334
+ export declare const getAllPortsRecord: GetPortRecordFromPolymorphicAccess<AllPortEntryUnion>;
335
+ type AllPortEntryUnion = InputRecordEntry | OutputRecordEntry;
336
+ export interface InputsRecordInContextEffect extends Effect.Effect<EMIDIInput.InputIdToInstanceMap, never, EMIDIAccess> {
337
+ }
338
+ /**
339
+ *
340
+ *
341
+ */
342
+ export declare const InputsRecord: InputsRecordInContextEffect;
343
+ export interface OutputsRecordInContextEffect extends Effect.Effect<EMIDIOutput.OutputIdToInstanceMap, never, EMIDIAccess> {
344
+ }
345
+ /**
346
+ *
347
+ *
348
+ */
349
+ export declare const OutputsRecord: OutputsRecordInContextEffect;
350
+ export interface AllPortsRecordInContextEffect extends Effect.Effect<EMIDIPort.BothIdToBothInstanceMap, never, EMIDIAccess> {
351
+ }
352
+ /**
353
+ *
354
+ *
355
+ */
356
+ export declare const AllPortsRecord: AllPortsRecordInContextEffect;
357
+ export interface GetPortArrayFromPolymorphicAccess<Port> {
358
+ /**
359
+ *
360
+ */
361
+ <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>): Effect.Effect<Port[], E, R>;
362
+ }
363
+ /**
364
+ * Because `MIDIInputMap` can potentially be a mutable object, meaning new
365
+ * devices can be added or removed at runtime, it is effectful.
366
+ *
367
+ * The **`inputs`** read-only property of the MIDIAccess interface provides
368
+ * access to any available MIDI input ports.
369
+ *
370
+ * [MDN
371
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIAccess/inputs)
372
+ */
373
+ export declare const getInputsArray: GetPortArrayFromPolymorphicAccess<EMIDIInput.EMIDIInput>;
374
+ /**
375
+ * Because `MIDIOutputMap` can potentially be a mutable object, meaning new
376
+ * devices can be added or removed at runtime, it is effectful.
377
+ *
378
+ * The **`outputs`** read-only property of the MIDIAccess interface provides
379
+ * access to any available MIDI output ports.
380
+ *
381
+ * [MDN
382
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIAccess/outputs)
383
+ */
384
+ export declare const getOutputsArray: GetPortArrayFromPolymorphicAccess<EMIDIOutput.EMIDIOutput>;
385
+ /**
386
+ *
387
+ *
388
+ */
389
+ export declare const getAllPortsArray: GetPortArrayFromPolymorphicAccess<EMIDIOutput.EMIDIOutput | EMIDIInput.EMIDIInput>;
390
+ export interface InputsArrayInContextEffect extends Effect.Effect<EMIDIInput.EMIDIInput[], never, EMIDIAccess> {
391
+ }
392
+ /**
393
+ *
394
+ *
395
+ */
396
+ export declare const InputsArray: InputsArrayInContextEffect;
397
+ export interface OutputsArrayInContextEffect extends Effect.Effect<EMIDIOutput.EMIDIOutput[], never, EMIDIAccess> {
398
+ }
399
+ /**
400
+ *
401
+ *
402
+ */
403
+ export declare const OutputsArray: OutputsArrayInContextEffect;
404
+ export interface AllPortsArrayInContextEffect extends Effect.Effect<(EMIDIOutput.EMIDIOutput | EMIDIInput.EMIDIInput)[], never, EMIDIAccess> {
405
+ }
406
+ /**
407
+ *
408
+ *
409
+ */
410
+ export declare const AllPortsArray: AllPortsArrayInContextEffect;
411
+ /**
412
+ * [MIDIConnectionEvent MDN
413
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIConnectionEvent)
414
+ */
415
+ export declare const makeAllPortsStateChangesStream: StreamMaker.DualStreamMaker<EMIDIAccessInstance, "MIDIPortStateChange", {
416
+ readonly newState: {
417
+ readonly ofDevice: MIDIPortDeviceState;
418
+ readonly ofConnection: MIDIPortConnectionState;
419
+ } | null;
420
+ readonly port: EMIDIInput.EMIDIInput | EMIDIOutput.EMIDIOutput | null;
421
+ }>;
422
+ /**
423
+ * beware that it's not possible to ensure the messages will either be all
424
+ * delivered, or all not delivered, as in ACID transactions. There's not even a
425
+ * mechanism to remove a specific message (not all) from the sending queue
426
+ */
427
+ export declare const send: DualSendMIDIMessageFromAccess;
428
+ /**
429
+ * @param options Passing a value of a `boolean` type is equivalent to setting
430
+ * `options.capture` property
431
+ */
432
+ export declare const makeMessagesStreamByInputId: <const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined>(id: EMIDIInput.Id, options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>) => StreamMaker.BuiltStream<"MIDIMessage", EMIDIInput.EMIDIInput, {
433
+ midiMessage: Uint8Array<ArrayBuffer> | null;
434
+ }, TOnNullStrategy, MIDIErrors.PortNotFoundError, EMIDIAccess>;
435
+ export declare const makeMessagesStreamByInputIdAndAccess: () => never;
436
+ /**
437
+ *
438
+ */
439
+ export declare const sendToPortById: (id: EMIDIOutput.Id, ...args: EMIDIOutput.SendFromPortArgs) => Effect.Effect<void, MIDIErrors.CannotSendSysexMessageError | MIDIErrors.CannotSendToDisconnectedPortError | MIDIErrors.MalformedMIDIMessageError | MIDIErrors.PortNotFoundError, EMIDIAccess>;
440
+ /**
441
+ *
442
+ */
443
+ export declare const clearPortById: (id: string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"output">) => Effect.Effect<void, MIDIErrors.ClearingSendingQueueIsNotSupportedError | MIDIErrors.PortNotFoundError, EMIDIAccess>;
444
+ /**
445
+ * @param options Passing a value of a `boolean` type is equivalent to setting
446
+ * `options.capture` property
447
+ */
448
+ export declare const makeAllPortsStateChangesStreamInContext: <const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined>(options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>) => StreamMaker.BuiltStream<"MIDIPortStateChange", EMIDIAccessInstance, {
449
+ readonly newState: {
450
+ readonly ofDevice: MIDIPortDeviceState;
451
+ readonly ofConnection: MIDIPortConnectionState;
452
+ } | null;
453
+ readonly port: EMIDIInput.EMIDIInput | EMIDIOutput.EMIDIOutput | null;
454
+ }, TOnNullStrategy, never, EMIDIAccess>;
455
+ /**
456
+ *
457
+ *
458
+ */
459
+ export declare const sendInContext: (...args: SendFromAccessArgs) => Effect.Effect<void, MIDIErrors.CannotSendSysexMessageError | MIDIErrors.CannotSendToDisconnectedPortError | MIDIErrors.MalformedMIDIMessageError, EMIDIAccess>;
460
+ /**
461
+ * @param options
462
+ *
463
+ * @returns An Effect representing a request for access to MIDI devices on a
464
+ * user's system. Available only in secure contexts.
465
+ */
466
+ export declare const request: (options?: RequestMIDIAccessOptions | undefined) => Effect.Effect<EMIDIAccessInstance, MIDIErrors.AbortError | MIDIErrors.MIDIAccessNotAllowedError | MIDIErrors.MIDIAccessNotSupportedError | MIDIErrors.UnderlyingSystemError, never>;
467
+ /**
468
+ *
469
+ * **Errors:**
470
+ *
471
+ * - {@linkcode MIDIErrors.AbortError} Description
472
+ * - {@linkcode MIDIErrors.UnderlyingSystemError} Description
473
+ * - {@linkcode MIDIErrors.MIDIAccessNotSupportedError} Description
474
+ * - {@linkcode MIDIErrors.MIDIAccessNotAllowedError} Description
475
+ *
476
+ * @param config
477
+ * @returns
478
+ */
479
+ export declare const layer: (config?: RequestMIDIAccessOptions) => Layer.Layer<EMIDIAccess, MIDIErrors.AbortError | MIDIErrors.MIDIAccessNotAllowedError | MIDIErrors.MIDIAccessNotSupportedError | MIDIErrors.UnderlyingSystemError, never>;
480
+ /**
481
+ *
482
+ */
483
+ export declare const layerMostRestricted: Layer.Layer<EMIDIAccess, MIDIErrors.AbortError | MIDIErrors.MIDIAccessNotAllowedError | MIDIErrors.MIDIAccessNotSupportedError | MIDIErrors.UnderlyingSystemError, never>;
484
+ /**
485
+ *
486
+ */
487
+ export declare const layerSystemExclusiveSupported: Layer.Layer<EMIDIAccess, MIDIErrors.AbortError | MIDIErrors.MIDIAccessNotAllowedError | MIDIErrors.MIDIAccessNotSupportedError | MIDIErrors.UnderlyingSystemError, never>;
488
+ /**
489
+ *
490
+ */
491
+ export declare const layerSoftwareSynthSupported: Layer.Layer<EMIDIAccess, MIDIErrors.AbortError | MIDIErrors.MIDIAccessNotAllowedError | MIDIErrors.MIDIAccessNotSupportedError | MIDIErrors.UnderlyingSystemError, never>;
492
+ /**
493
+ *
494
+ */
495
+ export declare const layerSystemExclusiveAndSoftwareSynthSupported: Layer.Layer<EMIDIAccess, MIDIErrors.AbortError | MIDIErrors.MIDIAccessNotAllowedError | MIDIErrors.MIDIAccessNotSupportedError | MIDIErrors.UnderlyingSystemError, never>;
496
+ export interface SentMessageEffectFromAccess<E = never, R = never> extends Util.SentMessageEffectFrom<EMIDIAccessInstance, E, R> {
497
+ }
498
+ export type TargetPortSelector = 'all existing outputs at effect execution' | 'all open connections at effect execution' | EMIDIOutput.Id | EMIDIOutput.Id[];
499
+ export interface DualSendMIDIMessageFromAccess extends SendMIDIMessageAccessFirst, SendMIDIMessageAccessLast {
500
+ }
501
+ export type SendFromAccessArgs = [
502
+ targetPortSelector: TargetPortSelector,
503
+ ...args: EMIDIOutput.SendFromPortArgs
504
+ ];
505
+ export interface SendMIDIMessageAccessFirst {
506
+ /**
507
+ *
508
+ *
509
+ */
510
+ <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>, ...args: SendFromAccessArgs): SentMessageEffectFromAccess<E, R>;
511
+ }
512
+ export interface SendMIDIMessageAccessLast {
513
+ /**
514
+ *
515
+ *
516
+ */
517
+ (...args: SendFromAccessArgs): {
518
+ /**
519
+ *
520
+ *
521
+ */
522
+ <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>): SentMessageEffectFromAccess<E, R>;
523
+ };
524
+ }
525
+ export interface GetThingByPortId<TSuccess, TTypeOfPortId extends MIDIPortType, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> extends GetThingByPortIdAccessFirst<TSuccess, TTypeOfPortId, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement>, GetThingByPortIdAccessLast<TSuccess, TTypeOfPortId, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> {
526
+ }
527
+ export interface GetThingByPortIdAccessFirst<TSuccess, TTypeOfPortId extends MIDIPortType, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> {
528
+ /**
529
+ *
530
+ *
531
+ */
532
+ <TAccessGettingError = never, TAccessGettingRequirement = never>(polymorphicAccess: PolymorphicAccessInstance<TAccessGettingError, TAccessGettingRequirement>, id: EMIDIPort.Id<TTypeOfPortId>): AcquiredThing<TSuccess, TAccessGettingError, TAccessGettingRequirement, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement>;
533
+ }
534
+ export interface GetThingByPortIdAccessLast<TSuccess, TTypeOfPortId extends MIDIPortType, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> {
535
+ /**
536
+ *
537
+ *
538
+ */
539
+ (id: EMIDIPort.Id<TTypeOfPortId>): GetThingByPortIdAccessLastSecondHalf<TSuccess, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement>;
540
+ }
541
+ export interface GetThingByPortIdAccessLastSecondHalf<TSuccess, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> {
542
+ /**
543
+ *
544
+ *
545
+ */
546
+ <TAccessGettingError = never, TAccessGettingRequirement = never>(polymorphicAccess: PolymorphicAccessInstance<TAccessGettingError, TAccessGettingRequirement>): AcquiredThing<TSuccess, TAccessGettingError, TAccessGettingRequirement, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement>;
547
+ }
548
+ export interface AcquiredThing<TSuccess, TAccessGettingError, TAccessGettingRequirement, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> extends Effect.Effect<TSuccess, Util.FallbackOnUnknownOrAny<TAccessGettingError, TAccessGettingFallbackError> | TAdditionalError, Util.FallbackOnUnknownOrAny<TAccessGettingRequirement, TAccessGettingFallbackRequirement> | TAdditionalRequirement> {
549
+ }
550
+ export {};
551
+ //# sourceMappingURL=EMIDIAccess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EMIDIAccess.d.ts","sourceRoot":"","sources":["../../../src/internal/EMIDIAccess.ts"],"names":[],"mappings":"AAAA;gEACgE;AAGhE,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AAEjD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAI3C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAG1C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAEhD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAG7C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAuCjC;;;;;GAKG;AACH,QAAA,MAAM,MAAM,EAAE,OAAO,MAA0D,CAAA;AAE/E;;;;GAIG;AACH,MAAM,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AsB,CACvB,CAAA;CACF;AAED,MAAM,WAAW,oCAAoC,CACnD,QAAQ,EACR,2BAA2B,EAC3B,iCAAiC,EACjC,gBAAgB,EAChB,sBAAsB;IAEtB;;;OAGG;IACH,CAAC,mBAAmB,GAAG,KAAK,EAAE,yBAAyB,GAAG,KAAK,EAC7D,iBAAiB,EAAE,yBAAyB,CAC1C,mBAAmB,EACnB,yBAAyB,CAC1B,GACA,aAAa,CACd,QAAQ,EACR,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,iCAAiC,EACjC,gBAAgB,EAChB,sBAAsB,CACvB,CAAA;CACF;AAED,MAAM,WAAW,aAAa,CAC5B,QAAQ,EACR,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,iCAAiC,EACjC,gBAAgB,EAChB,sBAAsB,CACtB,SAAQ,MAAM,CAAC,MAAM,CACnB,QAAQ,EACN,IAAI,CAAC,sBAAsB,CACzB,mBAAmB,EACnB,2BAA2B,CAC5B,GACD,gBAAgB,EAChB,IAAI,CAAC,sBAAsB,CACzB,yBAAyB,EACzB,iCAAiC,CAClC,GACD,sBAAsB,CACzB;CAAG"}
@@ -0,0 +1,50 @@
1
+ import * as Brand from 'effect/Brand';
2
+ import * as EMIDIPort from './EMIDIPort.ts';
3
+ import * as StreamMaker from './StreamMaker.ts';
4
+ /**
5
+ * Thin wrapper around {@linkcode MIDIInput} instance. Will be seen in all
6
+ * external code.
7
+ */
8
+ export interface EMIDIInput extends EMIDIPort.EMIDIPort<'input'> {
9
+ }
10
+ /**
11
+ * Asserts an object to be valid EMIDIInput
12
+ */
13
+ export declare const assert: (input: unknown) => EMIDIInput;
14
+ /**
15
+ *
16
+ *
17
+ * @internal
18
+ */
19
+ export declare const make: (rawInput: MIDIInput) => EMIDIInput;
20
+ /**
21
+ *
22
+ *
23
+ */
24
+ export declare const is: (input: unknown) => input is EMIDIInput;
25
+ /**
26
+ * [MIDIMessageEvent MDN
27
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIMessageEvent)
28
+ *
29
+ * MIDI spec says that synthetically built `MIDIMessageEvent`s can have `data`
30
+ * field equal to `null`, but when coming from the browser, they won't. The
31
+ * default behavior is to defect on `null`.
32
+ */
33
+ export declare const makeMessagesStreamByPort: StreamMaker.DualStreamMaker<EMIDIInput, "MIDIMessage", {
34
+ midiMessage: Uint8Array<ArrayBuffer> | null;
35
+ }>;
36
+ /**
37
+ *
38
+ *
39
+ */
40
+ export type PolymorphicInput<E, R> = EMIDIPort.PolymorphicPort<E, R, 'input'>;
41
+ /**
42
+ *
43
+ *
44
+ */
45
+ export type PolymorphicInputClean = EMIDIPort.PolymorphicPortClean<'input'>;
46
+ export type Id = EMIDIPort.Id<'input'>;
47
+ export declare const Id: Brand.Brand.Constructor<string & Brand.Brand<"MIDIPortId"> & Brand.Brand<"input">>;
48
+ export interface InputIdToInstanceMap extends Record<Id, EMIDIInput> {
49
+ }
50
+ //# sourceMappingURL=EMIDIInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EMIDIInput.d.ts","sourceRoot":"","sources":["../../../src/internal/EMIDIInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAQ/C;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC;CAAG;AA6BnE;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,UAAuB,CAAA;AAOhE;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,UAAqB,CAAA;AAUjE;;;GAGG;AACH,eAAO,MAAM,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,UAAmB,CAAA;AAEjE;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;EAalC,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAA;AAE7E;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;AAE3E,MAAM,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;AACtC,eAAO,MAAM,EAAE,oFAAsB,CAAA;AAErC,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC;CAAG"}