effect-web-midi 0.1.0

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 (222) hide show
  1. package/README.md +7 -0
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/src/EMIDIAccess.js +68 -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 +225 -0
  9. package/dist/src/EMIDIOutput.js.map +1 -0
  10. package/dist/src/EMIDIPort.js +213 -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/Parsing.js +2 -0
  15. package/dist/src/Parsing.js.map +1 -0
  16. package/dist/src/StreamMaker.js +1 -0
  17. package/dist/src/StreamMaker.js.map +1 -0
  18. package/dist/src/Util.js +4 -0
  19. package/dist/src/Util.js.map +1 -0
  20. package/dist/src/index.js +9 -0
  21. package/dist/src/index.js.map +1 -0
  22. package/dist/src/internal/EMIDIAccess.js +409 -0
  23. package/dist/src/internal/EMIDIAccess.js.map +1 -0
  24. package/dist/src/internal/EMIDIInput.js +69 -0
  25. package/dist/src/internal/EMIDIInput.js.map +1 -0
  26. package/dist/src/internal/EMIDIOutput.js +120 -0
  27. package/dist/src/internal/EMIDIOutput.js.map +1 -0
  28. package/dist/src/internal/EMIDIPort.js +125 -0
  29. package/dist/src/internal/EMIDIPort.js.map +1 -0
  30. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.js +27 -0
  31. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.js.map +1 -0
  32. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.js +19 -0
  33. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.js.map +1 -0
  34. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.js +16 -0
  35. package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.js.map +1 -0
  36. package/dist/src/internal/MIDIPortMethodCalls/actOnPort.js +18 -0
  37. package/dist/src/internal/MIDIPortMethodCalls/actOnPort.js.map +1 -0
  38. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.js +27 -0
  39. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.js.map +1 -0
  40. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.js +18 -0
  41. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.js.map +1 -0
  42. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.js +16 -0
  43. package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.js.map +1 -0
  44. package/dist/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.js +21 -0
  45. package/dist/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.js.map +1 -0
  46. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.js +30 -0
  47. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.js.map +1 -0
  48. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.js +18 -0
  49. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.js.map +1 -0
  50. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.js +16 -0
  51. package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.js.map +1 -0
  52. package/dist/src/internal/StreamMaker.js +101 -0
  53. package/dist/src/internal/StreamMaker.js.map +1 -0
  54. package/dist/src/internal/errors.js +161 -0
  55. package/dist/src/internal/errors.js.map +1 -0
  56. package/dist/src/internal/getPortByPortId/getPortByPortIdAndAccess.js +53 -0
  57. package/dist/src/internal/getPortByPortId/getPortByPortIdAndAccess.js.map +1 -0
  58. package/dist/src/internal/getPortByPortId/getPortByPortIdInContext.js +18 -0
  59. package/dist/src/internal/getPortByPortId/getPortByPortIdInContext.js.map +1 -0
  60. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.js +52 -0
  61. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.js.map +1 -0
  62. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.js +13 -0
  63. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.js.map +1 -0
  64. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.js +18 -0
  65. package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.js.map +1 -0
  66. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.js +66 -0
  67. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.js.map +1 -0
  68. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.js +61 -0
  69. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.js.map +1 -0
  70. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.js +61 -0
  71. package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.js.map +1 -0
  72. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.js +42 -0
  73. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.js.map +1 -0
  74. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.js +42 -0
  75. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.js.map +1 -0
  76. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.js +29 -0
  77. package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.js.map +1 -0
  78. package/dist/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.js +6 -0
  79. package/dist/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.js.map +1 -0
  80. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.js +46 -0
  81. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.js.map +1 -0
  82. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.js +25 -0
  83. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.js.map +1 -0
  84. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.js +31 -0
  85. package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.js.map +1 -0
  86. package/dist/src/internal/parsing.js +117 -0
  87. package/dist/src/internal/parsing.js.map +1 -0
  88. package/dist/src/internal/util.js +59 -0
  89. package/dist/src/internal/util.js.map +1 -0
  90. package/dist-types/index.d.ts +2 -0
  91. package/dist-types/index.d.ts.map +1 -0
  92. package/dist-types/src/EMIDIAccess.d.ts +27 -0
  93. package/dist-types/src/EMIDIAccess.d.ts.map +1 -0
  94. package/dist-types/src/EMIDIInput.d.ts +26 -0
  95. package/dist-types/src/EMIDIInput.d.ts.map +1 -0
  96. package/dist-types/src/EMIDIOutput.d.ts +26 -0
  97. package/dist-types/src/EMIDIOutput.d.ts.map +1 -0
  98. package/dist-types/src/EMIDIPort.d.ts +26 -0
  99. package/dist-types/src/EMIDIPort.d.ts.map +1 -0
  100. package/dist-types/src/MIDIErrors.d.ts +2 -0
  101. package/dist-types/src/MIDIErrors.d.ts.map +1 -0
  102. package/dist-types/src/Parsing.d.ts +2 -0
  103. package/dist-types/src/Parsing.d.ts.map +1 -0
  104. package/dist-types/src/StreamMaker.d.ts +2 -0
  105. package/dist-types/src/StreamMaker.d.ts.map +1 -0
  106. package/dist-types/src/Util.d.ts +2 -0
  107. package/dist-types/src/Util.d.ts.map +1 -0
  108. package/dist-types/src/index.d.ts +9 -0
  109. package/dist-types/src/index.d.ts.map +1 -0
  110. package/dist-types/src/internal/EMIDIAccess.d.ts +339 -0
  111. package/dist-types/src/internal/EMIDIAccess.d.ts.map +1 -0
  112. package/dist-types/src/internal/EMIDIInput.d.ts +48 -0
  113. package/dist-types/src/internal/EMIDIInput.d.ts.map +1 -0
  114. package/dist-types/src/internal/EMIDIOutput.d.ts +93 -0
  115. package/dist-types/src/internal/EMIDIOutput.d.ts.map +1 -0
  116. package/dist-types/src/internal/EMIDIPort.d.ts +87 -0
  117. package/dist-types/src/internal/EMIDIPort.d.ts.map +1 -0
  118. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.d.ts +16 -0
  119. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.d.ts.map +1 -0
  120. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.d.ts +15 -0
  121. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.d.ts.map +1 -0
  122. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.d.ts +13 -0
  123. package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.d.ts.map +1 -0
  124. package/dist-types/src/internal/MIDIPortMethodCalls/actOnPort.d.ts +11 -0
  125. package/dist-types/src/internal/MIDIPortMethodCalls/actOnPort.d.ts.map +1 -0
  126. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.d.ts +23 -0
  127. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.d.ts.map +1 -0
  128. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.d.ts +15 -0
  129. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.d.ts.map +1 -0
  130. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.d.ts +13 -0
  131. package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.d.ts.map +1 -0
  132. package/dist-types/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.d.ts +15 -0
  133. package/dist-types/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.d.ts.map +1 -0
  134. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.d.ts +21 -0
  135. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.d.ts.map +1 -0
  136. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.d.ts +15 -0
  137. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.d.ts.map +1 -0
  138. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.d.ts +13 -0
  139. package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.d.ts.map +1 -0
  140. package/dist-types/src/internal/StreamMaker.d.ts +202 -0
  141. package/dist-types/src/internal/StreamMaker.d.ts.map +1 -0
  142. package/dist-types/src/internal/errors.d.ts +260 -0
  143. package/dist-types/src/internal/errors.d.ts.map +1 -0
  144. package/dist-types/src/internal/getPortByPortId/getPortByPortIdAndAccess.d.ts +27 -0
  145. package/dist-types/src/internal/getPortByPortId/getPortByPortIdAndAccess.d.ts.map +1 -0
  146. package/dist-types/src/internal/getPortByPortId/getPortByPortIdInContext.d.ts +20 -0
  147. package/dist-types/src/internal/getPortByPortId/getPortByPortIdInContext.d.ts.map +1 -0
  148. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.d.ts +71 -0
  149. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.d.ts.map +1 -0
  150. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.d.ts +4 -0
  151. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.d.ts.map +1 -0
  152. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.d.ts +20 -0
  153. package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.d.ts.map +1 -0
  154. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.d.ts +62 -0
  155. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.d.ts.map +1 -0
  156. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.d.ts +16 -0
  157. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.d.ts.map +1 -0
  158. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.d.ts +16 -0
  159. package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.d.ts.map +1 -0
  160. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.d.ts +36 -0
  161. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.d.ts.map +1 -0
  162. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.d.ts +22 -0
  163. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.d.ts.map +1 -0
  164. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.d.ts +17 -0
  165. package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.d.ts.map +1 -0
  166. package/dist-types/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.d.ts +7 -0
  167. package/dist-types/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.d.ts.map +1 -0
  168. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.d.ts +71 -0
  169. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.d.ts.map +1 -0
  170. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.d.ts +7 -0
  171. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.d.ts.map +1 -0
  172. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.d.ts +28 -0
  173. package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.d.ts.map +1 -0
  174. package/dist-types/src/internal/parsing.d.ts +72 -0
  175. package/dist-types/src/internal/parsing.d.ts.map +1 -0
  176. package/dist-types/src/internal/util.d.ts +33 -0
  177. package/dist-types/src/internal/util.d.ts.map +1 -0
  178. package/index.ts +1 -0
  179. package/package.json +83 -0
  180. package/src/EMIDIAccess.ts +271 -0
  181. package/src/EMIDIInput.ts +270 -0
  182. package/src/EMIDIOutput.ts +269 -0
  183. package/src/EMIDIPort.ts +267 -0
  184. package/src/MIDIErrors.ts +13 -0
  185. package/src/Parsing.ts +12 -0
  186. package/src/StreamMaker.ts +12 -0
  187. package/src/Util.ts +19 -0
  188. package/src/index.ts +8 -0
  189. package/src/internal/EMIDIAccess.ts +893 -0
  190. package/src/internal/EMIDIInput.ts +114 -0
  191. package/src/internal/EMIDIOutput.ts +228 -0
  192. package/src/internal/EMIDIPort.ts +233 -0
  193. package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.ts +43 -0
  194. package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.ts +39 -0
  195. package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.ts +27 -0
  196. package/src/internal/MIDIPortMethodCalls/actOnPort.ts +66 -0
  197. package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.ts +38 -0
  198. package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.ts +38 -0
  199. package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.ts +27 -0
  200. package/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.ts +73 -0
  201. package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.ts +44 -0
  202. package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.ts +38 -0
  203. package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.ts +27 -0
  204. package/src/internal/StreamMaker.ts +414 -0
  205. package/src/internal/errors.ts +220 -0
  206. package/src/internal/getPortByPortId/getPortByPortIdAndAccess.ts +116 -0
  207. package/src/internal/getPortByPortId/getPortByPortIdInContext.ts +26 -0
  208. package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.ts +148 -0
  209. package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.ts +14 -0
  210. package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.ts +51 -0
  211. package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.ts +127 -0
  212. package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.ts +74 -0
  213. package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.ts +74 -0
  214. package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.ts +63 -0
  215. package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.ts +110 -0
  216. package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.ts +37 -0
  217. package/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.ts +12 -0
  218. package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.ts +183 -0
  219. package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.ts +29 -0
  220. package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.ts +86 -0
  221. package/src/internal/parsing.ts +219 -0
  222. package/src/internal/util.ts +152 -0
@@ -0,0 +1,2 @@
1
+ export { AbortError, CantSendSysexMessagesError, ClearingSendingQueueIsNotSupportedError, DisconnectedPortError, MalformedMidiMessageError, MIDIAccessNotAllowedError, MIDIAccessNotSupportedError, PortNotFoundError, UnavailablePortError, UnderlyingSystemError, } from './internal/errors.ts';
2
+ //# sourceMappingURL=MIDIErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MIDIErrors.d.ts","sourceRoot":"","sources":["../../src/MIDIErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,0BAA0B,EAC1B,uCAAuC,EACvC,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EAEjB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { type ControlChange, type NotePress, type NoteRelease, type ParsedMIDIMessages, type PitchBendChange, type TouchpadPositionUpdate, type TouchpadRelease, type UnknownReply, withParsedDataField, withTouchpadPositionUpdates, } from './internal/parsing.ts';
2
+ //# sourceMappingURL=Parsing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Parsing.d.ts","sourceRoot":"","sources":["../../src/Parsing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export type { BuiltStream, DualStreamMaker, MakeStreamTargetFirst, MakeStreamTargetLast, OnNullStrategy, StreamError, StreamMakerOptions, StreamMakerOptionsObject, StreamMakerOptionsWellknown, StreamValue, } from './internal/StreamMaker.ts';
2
+ //# sourceMappingURL=StreamMaker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StreamMaker.d.ts","sourceRoot":"","sources":["../../src/StreamMaker.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,2BAA2B,EAC3B,WAAW,GACZ,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { type FallbackOnUnknownOrAny, getStaticMIDIPortInfo, type IsEqualFlag, isCertainConnectionState, isCertainDeviceState, isConnectionClosed, isConnectionOpen, isConnectionPending, isDeviceConnected, isDeviceDisconnected, type MIDIPortStaticFields, mapToGlidingStringLogOfLimitedEntriesCount, midiPortStaticFields, type PolymorphicEffect, type SentMessageEffectFrom, } from './internal/util.ts';
2
+ //# sourceMappingURL=Util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../src/Util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAE3B,qBAAqB,EACrB,KAAK,WAAW,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,0CAA0C,EAC1C,oBAAoB,EACpB,KAAK,iBAAiB,EAEtB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,9 @@
1
+ export * as EMIDIAccess from './EMIDIAccess.ts';
2
+ export * as EMIDIInput from './EMIDIInput.ts';
3
+ export * as EMIDIOutput from './EMIDIOutput.ts';
4
+ export * as EMIDIPort from './EMIDIPort.ts';
5
+ export * as MIDIErrors from './MIDIErrors.ts';
6
+ export * as Parsing from './Parsing.ts';
7
+ export * as StreamMaker from './StreamMaker.ts';
8
+ export * as Util from './Util.ts';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA"}
@@ -0,0 +1,339 @@
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 * as EMIDIInput from './EMIDIInput.ts';
10
+ import * as EMIDIOutput from './EMIDIOutput.ts';
11
+ import type * as EMIDIPort from './EMIDIPort.ts';
12
+ import * as Errors from './errors.ts';
13
+ import * as StreamMaker from './StreamMaker.ts';
14
+ import * as Util from './util.ts';
15
+ /**
16
+ * Unique symbol used for distinguishing {@linkcode EMIDIAccessInstance}
17
+ * instances from other objects at both runtime and type-level
18
+ * @internal
19
+ */
20
+ declare const TypeId: unique symbol;
21
+ /**
22
+ * Unique symbol used for distinguishing {@linkcode EMIDIAccessInstance}
23
+ * instances from other objects at both runtime and type-level
24
+ */
25
+ export type TypeId = typeof TypeId;
26
+ declare const EMIDIAccess_base: Context.TagClass<EMIDIAccess, "effect-web-midi/EMIDIAccess", EMIDIAccessInstance>;
27
+ /**
28
+ * A tag that allows to provide
29
+ * {@linkcode EMIDIAccessInstance|access instance} once with e.g.
30
+ * {@linkcode layer}, {@linkcode layerSystemExclusiveSupported}, etc. and reuse
31
+ * it anywhere, instead of repeatedly {@linkcode request}ing it.
32
+ *
33
+ * The downside of using DI might be that in different places of the app it
34
+ * would be harder to maintain tight MIDI permission scopes.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * import { EMIDIAccess } from 'effect-web-midi'
39
+ * import * as Effect from 'effect/Effect'
40
+ *
41
+ * const program = Effect.gen(function* () {
42
+ * // ^ Effect.Effect<
43
+ * // void,
44
+ * // | AbortError
45
+ * // | UnderlyingSystemError
46
+ * // | MIDIAccessNotAllowedError
47
+ * // | MIDIAccessNotSupportedError
48
+ * // never
49
+ * // >
50
+ *
51
+ * const access = yield* EMIDIAccess.EMIDIAccess
52
+ * // ^ EMIDIAccessInstance
53
+ *
54
+ * console.log(access.sysexEnabled)
55
+ * // ^ true
56
+ * }).pipe(Effect.provide(EMIDIAccess.layerSystemExclusiveSupported))
57
+ * ```
58
+ *
59
+ * @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}
60
+ */
61
+ export declare class EMIDIAccess extends EMIDIAccess_base {
62
+ }
63
+ export interface RequestMIDIAccessOptions {
64
+ /**
65
+ * This field informs the system whether the ability to send and receive
66
+ * `System Exclusive` messages is requested or allowed on a given
67
+ * {@linkcode EMIDIAccessInstance} object.
68
+ *
69
+ * If this field is set to `true`, but `System Exclusive` support is denied
70
+ * (either by policy or by user action), the access request will fail with a
71
+ * {@linkcode Errors.MIDIAccessNotAllowedError} error.
72
+ *
73
+ * If this support is not requested (and allowed), the system will throw
74
+ * exceptions if the user tries to send `System Exclusive` messages, and will
75
+ * silently mask out any `System Exclusive` messages received on the port.
76
+ *
77
+ * @default false
78
+ * @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}
79
+ */
80
+ readonly sysex?: boolean;
81
+ /**
82
+ * This field informs the system whether the ability to utilize any software
83
+ * synthesizers installed in the host system is requested or allowed on a
84
+ * given {@linkcode EMIDIAccessInstance} object.
85
+ *
86
+ * If this field is set to `true`, but software synthesizer support is denied
87
+ * (either by policy or by user action), the access request will fail with a
88
+ * {@linkcode Errors.MIDIAccessNotAllowedError} error.
89
+ *
90
+ * If this support is not requested, {@linkcode AllPortsRecord},
91
+ * {@linkcode getInputsRecord}, {@linkcode OutputsRecord}, etc. would
92
+ * not include any software synthesizers.
93
+ *
94
+ * Note that may result in a two-step request procedure if software
95
+ * synthesizer support is desired but not required - software synthesizers may
96
+ * be disabled when MIDI hardware device access is allowed.
97
+ *
98
+ * @default false
99
+ * @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}
100
+ */
101
+ readonly software?: boolean;
102
+ }
103
+ /**
104
+ * Thin wrapper around {@linkcode MIDIAccess} instance. Will be seen in all the
105
+ * external code.
106
+ */
107
+ export interface EMIDIAccessInstance extends Equal.Equal, Pipeable.Pipeable, Inspectable.Inspectable {
108
+ readonly [TypeId]: TypeId;
109
+ readonly _tag: 'EMIDIAccess';
110
+ /**
111
+ * The **`sysexEnabled`** read-only property of the MIDIAccess interface indicates whether system exclusive support is enabled on the current MIDIAccess instance.
112
+ *
113
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIAccess/sysexEnabled)
114
+ */
115
+ readonly sysexEnabled: boolean;
116
+ readonly softwareSynthEnabled: boolean;
117
+ }
118
+ /**
119
+ * Thin wrapper around {@linkcode MIDIAccess} instance giving access to the
120
+ * actual field storing it.
121
+ * @internal
122
+ */
123
+ interface EMIDIAccessImplementationInstance extends EMIDIAccessInstance {
124
+ readonly _access: MIDIAccess;
125
+ readonly _config: Readonly<RequestMIDIAccessOptions>;
126
+ }
127
+ /**
128
+ * Asserts an object to be valid `EMIDIAccess`
129
+ *
130
+ * @internal
131
+ */
132
+ export declare const assert: (access: unknown) => EMIDIAccessInstance;
133
+ /**
134
+ * @internal
135
+ */
136
+ export declare const assumeImpl: (access: EMIDIAccessInstance) => EMIDIAccessImplementationInstance;
137
+ /**
138
+ *
139
+ *
140
+ */
141
+ export declare const is: (access: unknown) => access is EMIDIAccessInstance;
142
+ /**
143
+ *
144
+ * @internal
145
+ */
146
+ export declare const resolve: <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>) => Effect.Effect<EMIDIAccessInstance, E, R>;
147
+ /**
148
+ *
149
+ *
150
+ */
151
+ export type PolymorphicAccessInstance<E, R> = Util.PolymorphicEffect<EMIDIAccessInstance, E, R>;
152
+ /**
153
+ *
154
+ *
155
+ */
156
+ export type PolymorphicAccessInstanceClean = PolymorphicAccessInstance<never, never>;
157
+ /**
158
+ * Because `MIDIInputMap` can potentially be a mutable object, meaning new
159
+ * devices can be added or removed at runtime, it is effectful.
160
+ *
161
+ * The **`inputs`** read-only property of the MIDIAccess interface provides
162
+ * access to any available MIDI input ports.
163
+ *
164
+ * [MDN
165
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIAccess/inputs)
166
+ */
167
+ export declare const getInputsRecord: <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>) => Effect.Effect<Record<string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"input">, EMIDIPort.EMIDIPort<"input">>, E, R>;
168
+ /**
169
+ * Because `MIDIOutputMap` can potentially be a mutable object, meaning new
170
+ * devices can be added or removed at runtime, it is effectful.
171
+ *
172
+ * The **`outputs`** read-only property of the MIDIAccess interface provides
173
+ * access to any available MIDI output ports.
174
+ *
175
+ * [MDN
176
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIAccess/outputs)
177
+ */
178
+ export declare const getOutputsRecord: <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>) => Effect.Effect<Record<string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"output">, EMIDIPort.EMIDIPort<"output">>, E, R>;
179
+ /**
180
+ *
181
+ *
182
+ */
183
+ export declare const getAllPortsRecord: <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>) => Effect.Effect<Record<string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"input">, EMIDIPort.EMIDIPort<"input">> & Record<string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"output">, EMIDIPort.EMIDIPort<"output">>, E, R>;
184
+ /**
185
+ *
186
+ *
187
+ */
188
+ export declare const InputsRecord: Effect.Effect<Record<string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"input">, EMIDIPort.EMIDIPort<"input">>, never, EMIDIAccess>;
189
+ /**
190
+ *
191
+ *
192
+ */
193
+ export declare const OutputsRecord: Effect.Effect<Record<string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"output">, EMIDIPort.EMIDIPort<"output">>, never, EMIDIAccess>;
194
+ /**
195
+ *
196
+ *
197
+ */
198
+ export declare const AllPortsRecord: Effect.Effect<Record<string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"input">, EMIDIPort.EMIDIPort<"input">> & Record<string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"output">, EMIDIPort.EMIDIPort<"output">>, never, EMIDIAccess>;
199
+ /**
200
+ * [MIDIConnectionEvent MDN
201
+ * Reference](https://developer.mozilla.org/docs/Web/API/MIDIConnectionEvent)
202
+ */
203
+ export declare const makeAllPortsStateChangesStream: StreamMaker.DualStreamMaker<EMIDIAccessInstance, "MIDIPortStateChange", {
204
+ readonly newState: {
205
+ readonly ofDevice: MIDIPortDeviceState;
206
+ readonly ofConnection: MIDIPortConnectionState;
207
+ } | null;
208
+ readonly port: EMIDIOutput.EMIDIOutput | EMIDIInput.EMIDIInput | null;
209
+ }>;
210
+ /**
211
+ * beware that it's not possible to ensure the messages will either be all
212
+ * delivered, or all not delivered, as in ACID transactions. There's not even a
213
+ * mechanism to remove a specific message (not all) from the sending queue
214
+ */
215
+ export declare const send: DualSendMIDIMessageFromAccess;
216
+ /**
217
+ * @param options Passing a value of a `boolean` type is equivalent to setting
218
+ * `options.capture` property
219
+ */
220
+ export declare const makeMessagesStreamByInputId: <const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined>(id: EMIDIInput.Id, options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>) => StreamMaker.BuiltStream<"MIDIMessage", EMIDIInput.EMIDIInput, {
221
+ midiMessage: Uint8Array<ArrayBuffer> | null;
222
+ }, TOnNullStrategy, Errors.PortNotFoundError, EMIDIAccess>;
223
+ export declare const makeMessagesStreamByInputIdAndAccess: () => never;
224
+ /**
225
+ *
226
+ */
227
+ export declare const sendToPortById: (id: EMIDIOutput.Id, ...args: EMIDIOutput.SendFromPortArgs) => Effect.Effect<void, Errors.DisconnectedPortError | Errors.CantSendSysexMessagesError | Errors.MalformedMidiMessageError | Errors.PortNotFoundError, EMIDIAccess>;
228
+ /**
229
+ *
230
+ */
231
+ export declare const clearPortById: (id: string & import("effect/Brand").Brand<"MIDIPortId"> & import("effect/Brand").Brand<"output">) => Effect.Effect<void, Errors.ClearingSendingQueueIsNotSupportedError | Errors.PortNotFoundError, EMIDIAccess>;
232
+ /**
233
+ * @param options Passing a value of a `boolean` type is equivalent to setting
234
+ * `options.capture` property
235
+ */
236
+ export declare const makeAllPortsStateChangesStreamInContext: <const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined>(options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>) => StreamMaker.BuiltStream<"MIDIPortStateChange", EMIDIAccessInstance, {
237
+ readonly newState: {
238
+ readonly ofDevice: MIDIPortDeviceState;
239
+ readonly ofConnection: MIDIPortConnectionState;
240
+ } | null;
241
+ readonly port: EMIDIOutput.EMIDIOutput | EMIDIInput.EMIDIInput | null;
242
+ }, TOnNullStrategy, never, EMIDIAccess>;
243
+ /**
244
+ *
245
+ *
246
+ */
247
+ export declare const sendInContext: (...args: SendFromAccessArgs) => Effect.Effect<void, Errors.DisconnectedPortError | Errors.CantSendSysexMessagesError | Errors.MalformedMidiMessageError, EMIDIAccess>;
248
+ /**
249
+ * @param options
250
+ *
251
+ * @returns An Effect representing a request for access to MIDI devices on a
252
+ * user's system. Available only in secure contexts.
253
+ */
254
+ export declare const request: (options?: RequestMIDIAccessOptions | undefined) => Effect.Effect<EMIDIAccessInstance, Errors.AbortError | Errors.UnderlyingSystemError | Errors.MIDIAccessNotSupportedError | Errors.MIDIAccessNotAllowedError, never>;
255
+ /**
256
+ *
257
+ * **Errors:**
258
+ *
259
+ * - {@linkcode Errors.AbortError} Argument x must be non-zero
260
+ * - {@linkcode Errors.UnderlyingSystemError} Argument x must be non-zero
261
+ * - {@linkcode Errors.MIDIAccessNotSupportedError} Argument x must be non-zero
262
+ * - {@linkcode Errors.MIDIAccessNotAllowedError} Argument x must be non-zero
263
+ *
264
+ * @param config
265
+ * @returns
266
+ */
267
+ export declare const layer: (config?: RequestMIDIAccessOptions) => Layer.Layer<EMIDIAccess, Errors.AbortError | Errors.UnderlyingSystemError | Errors.MIDIAccessNotSupportedError | Errors.MIDIAccessNotAllowedError, never>;
268
+ /**
269
+ *
270
+ */
271
+ export declare const layerMostRestricted: Layer.Layer<EMIDIAccess, Errors.AbortError | Errors.UnderlyingSystemError | Errors.MIDIAccessNotSupportedError | Errors.MIDIAccessNotAllowedError, never>;
272
+ /**
273
+ *
274
+ */
275
+ export declare const layerSystemExclusiveSupported: Layer.Layer<EMIDIAccess, Errors.AbortError | Errors.UnderlyingSystemError | Errors.MIDIAccessNotSupportedError | Errors.MIDIAccessNotAllowedError, never>;
276
+ /**
277
+ *
278
+ */
279
+ export declare const layerSoftwareSynthSupported: Layer.Layer<EMIDIAccess, Errors.AbortError | Errors.UnderlyingSystemError | Errors.MIDIAccessNotSupportedError | Errors.MIDIAccessNotAllowedError, never>;
280
+ /**
281
+ *
282
+ */
283
+ export declare const layerSystemExclusiveAndSoftwareSynthSupported: Layer.Layer<EMIDIAccess, Errors.AbortError | Errors.UnderlyingSystemError | Errors.MIDIAccessNotSupportedError | Errors.MIDIAccessNotAllowedError, never>;
284
+ export interface SentMessageEffectFromAccess<E = never, R = never> extends Util.SentMessageEffectFrom<EMIDIAccessInstance, E, R> {
285
+ }
286
+ export type TargetPortSelector = 'all existing outputs at effect execution' | 'all open connections at effect execution' | EMIDIOutput.Id | EMIDIOutput.Id[];
287
+ export interface DualSendMIDIMessageFromAccess extends SendMIDIMessageAccessFirst, SendMIDIMessageAccessLast {
288
+ }
289
+ export type SendFromAccessArgs = [
290
+ targetPortSelector: TargetPortSelector,
291
+ ...args: EMIDIOutput.SendFromPortArgs
292
+ ];
293
+ export interface SendMIDIMessageAccessFirst {
294
+ /**
295
+ *
296
+ *
297
+ */
298
+ <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>, ...args: SendFromAccessArgs): SentMessageEffectFromAccess<E, R>;
299
+ }
300
+ export interface SendMIDIMessageAccessLast {
301
+ /**
302
+ *
303
+ *
304
+ */
305
+ (...args: SendFromAccessArgs): {
306
+ /**
307
+ *
308
+ *
309
+ */
310
+ <E = never, R = never>(polymorphicAccess: PolymorphicAccessInstance<E, R>): SentMessageEffectFromAccess<E, R>;
311
+ };
312
+ }
313
+ 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> {
314
+ }
315
+ export interface GetThingByPortIdAccessFirst<TSuccess, TTypeOfPortId extends MIDIPortType, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> {
316
+ /**
317
+ *
318
+ *
319
+ */
320
+ <TAccessGettingError = never, TAccessGettingRequirement = never>(polymorphicAccess: PolymorphicAccessInstance<TAccessGettingError, TAccessGettingRequirement>, id: EMIDIPort.Id<TTypeOfPortId>): AcquiredThing<TSuccess, TAccessGettingError, TAccessGettingRequirement, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement>;
321
+ }
322
+ export interface GetThingByPortIdAccessLast<TSuccess, TTypeOfPortId extends MIDIPortType, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> {
323
+ /**
324
+ *
325
+ *
326
+ */
327
+ (id: EMIDIPort.Id<TTypeOfPortId>): GetThingByPortIdAccessLastSecondHalf<TSuccess, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement>;
328
+ }
329
+ export interface GetThingByPortIdAccessLastSecondHalf<TSuccess, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> {
330
+ /**
331
+ *
332
+ *
333
+ */
334
+ <TAccessGettingError = never, TAccessGettingRequirement = never>(polymorphicAccess: PolymorphicAccessInstance<TAccessGettingError, TAccessGettingRequirement>): AcquiredThing<TSuccess, TAccessGettingError, TAccessGettingRequirement, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement>;
335
+ }
336
+ export interface AcquiredThing<TSuccess, TAccessGettingError, TAccessGettingRequirement, TAccessGettingFallbackError, TAccessGettingFallbackRequirement, TAdditionalError, TAdditionalRequirement> extends Effect.Effect<TSuccess, Util.FallbackOnUnknownOrAny<TAccessGettingError, TAccessGettingFallbackError> | TAdditionalError, Util.FallbackOnUnknownOrAny<TAccessGettingRequirement, TAccessGettingFallbackRequirement> | TAdditionalRequirement> {
337
+ }
338
+ export {};
339
+ //# 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;AAM3C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAIrC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AA2BjC;;;;GAIG;AACH,QAAA,MAAM,MAAM,EAAE,OAAO,MAA0D,CAAA;AAE/E;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAA;;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,WAAY,SAAQ,gBAG9B;CAAG;AAEN,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IAExB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC5B;AAwCD;;;GAGG;AACH,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,KAAK,EACjB,QAAQ,CAAC,QA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,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,48 @@
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
+ //# 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;AACrC,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;;EAgBlC,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"}
@@ -0,0 +1,93 @@
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 Brand from 'effect/Brand';
4
+ import * as Effect from 'effect/Effect';
5
+ import * as EMIDIPort from './EMIDIPort.ts';
6
+ import * as Errors from './errors.ts';
7
+ import * as Util from './util.ts';
8
+ /**
9
+ * Thin wrapper around {@linkcode MIDIOutput} instance. Will be seen in all
10
+ * external code.
11
+ */
12
+ export interface EMIDIOutput extends EMIDIPort.EMIDIPort<'output'> {
13
+ }
14
+ /**
15
+ * Asserts an object to be valid EMIDIOutput
16
+ */
17
+ export declare const assert: (output: unknown) => EMIDIOutput;
18
+ /**
19
+ *
20
+ * @internal
21
+ */
22
+ export declare const make: (rawOutput: MIDIOutput) => EMIDIOutput;
23
+ /**
24
+ *
25
+ */
26
+ export declare const is: (output: unknown) => output is EMIDIOutput;
27
+ /**
28
+ * If `midiMessage` is a System Exclusive message, and the `MIDIAccess` did not
29
+ * enable System Exclusive access, an `InvalidAccessError` exception will be
30
+ * thrown
31
+ *
32
+ * If the port is `"connected"` and the connection is `"closed"`, asynchronously
33
+ * tries to open the port. It's unclear in the spec if potential error of `open`
34
+ * call would result in an `InvalidAccessError` error coming from the `send`
35
+ * method itself.
36
+ *
37
+ * @returns An effect with the same port for easier chaining of operations
38
+ */
39
+ export declare const send: DualSendMIDIMessageFromPort;
40
+ /**
41
+ * Clears any enqueued send data that has not yet been sent from the
42
+ * `MIDIOutput`'s queue. The browser will ensure the MIDI stream is left in a
43
+ * good state, and if the output port is in the middle of a sysex message, a
44
+ * sysex termination byte (`0xf7`) will be sent.
45
+ *
46
+ * @param polymorphicOutput An effectful output port
47
+ *
48
+ * @returns An effect with the same port for easier chaining of operations
49
+ * @experimental Supported only in Firefox. {@link https://caniuse.com/mdn-api_midioutput_clear|Can I use - MIDIOutput API: clear}
50
+ * @see {@link https://www.w3.org/TR/webmidi/#dom-midioutput-clear|Web MIDI spec}, {@link https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutput/clear|MDN reference}
51
+ */
52
+ export declare const clear: <E = never, R = never>(polymorphicOutput: PolymorphicOutput<E, R>) => Effect.Effect<EMIDIPort.EMIDIPort<"output">, Errors.ClearingSendingQueueIsNotSupportedError | E, R>;
53
+ /**
54
+ *
55
+ *
56
+ */
57
+ export type PolymorphicOutput<E, R> = EMIDIPort.PolymorphicPort<E, R, 'output'>;
58
+ /**
59
+ *
60
+ *
61
+ */
62
+ export type PolymorphicOutputClean = EMIDIPort.PolymorphicPortClean<'output'>;
63
+ export type SendFromPortArgs = [
64
+ midiMessage: Iterable<number>,
65
+ timestamp?: DOMHighResTimeStamp
66
+ ];
67
+ export interface DualSendMIDIMessageFromPort extends SendMIDIMessagePortLast, SendMIDIMessagePortFirst {
68
+ }
69
+ export interface SendMIDIMessagePortLast {
70
+ /**
71
+ *
72
+ */
73
+ (...args: SendFromPortArgs): {
74
+ /**
75
+ *
76
+ */
77
+ <E = never, R = never>(polymorphicOutput: PolymorphicOutput<E, R>): SentMessageEffectFromPort<E, R>;
78
+ };
79
+ }
80
+ export interface SendMIDIMessagePortFirst {
81
+ /**
82
+ *
83
+ */
84
+ <E = never, R = never>(polymorphicOutput: PolymorphicOutput<E, R>, ...args: SendFromPortArgs): SentMessageEffectFromPort<E, R>;
85
+ }
86
+ /**
87
+ *
88
+ */
89
+ export interface SentMessageEffectFromPort<E = never, R = never> extends Util.SentMessageEffectFrom<EMIDIOutput, E, R> {
90
+ }
91
+ export type Id = EMIDIPort.Id<'output'>;
92
+ export declare const Id: Brand.Brand.Constructor<string & Brand.Brand<"MIDIPortId"> & Brand.Brand<"output">>;
93
+ //# sourceMappingURL=EMIDIOutput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EMIDIOutput.d.ts","sourceRoot":"","sources":["../../../src/internal/EMIDIOutput.ts"],"names":[],"mappings":"AAAA;gEACgE;AAEhE,OAAO,KAAK,KAA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C,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,EACnB,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GACzC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;KACnC,CAAA;CACF;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,EACnB,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1C,GAAG,IAAI,EAAE,gBAAgB,GACxB,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,CAC7D,SAAQ,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;CAAG;AAE1D,MAAM,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;AACvC,eAAO,MAAM,EAAE,qFAAsB,CAAA"}
@@ -0,0 +1,87 @@
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 Brand from 'effect/Brand';
4
+ import * as Equal from 'effect/Equal';
5
+ import * as Inspectable from 'effect/Inspectable';
6
+ import * as Pipeable from 'effect/Pipeable';
7
+ import type * as Util from './util.ts';
8
+ /**
9
+ * Unique symbol used for distinguishing {@linkcode EMIDIPort} instances
10
+ * from other objects at both runtime and type-level
11
+ * @internal
12
+ */
13
+ declare const TypeId: unique symbol;
14
+ /**
15
+ * Unique symbol used for distinguishing {@linkcode EMIDIPort} instances
16
+ * from other objects at both runtime and type-level
17
+ */
18
+ export type TypeId = typeof TypeId;
19
+ /**
20
+ * Thin wrapper around {@linkcode MIDIPort} instance. Will be seen in all
21
+ * external code.
22
+ */
23
+ export interface EMIDIPort<TMIDIPortType extends MIDIPortType = MIDIPortType> extends Equal.Equal, Pipeable.Pipeable, Inspectable.Inspectable, Pick<MIDIPort, 'version' | 'name' | 'manufacturer'> {
24
+ /**
25
+ * The **`id`** read-only property of the MIDIPort interface returns the unique ID of the port.
26
+ *
27
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIPort/id)
28
+ */
29
+ readonly id: Id<TMIDIPortType>;
30
+ readonly [TypeId]: TypeId;
31
+ readonly _tag: 'EMIDIPort';
32
+ readonly type: TMIDIPortType;
33
+ }
34
+ /**
35
+ * Thin wrapper around {@linkcode MIDIPort} instance giving access to the
36
+ * actual field storing it.
37
+ * @internal
38
+ */
39
+ export interface EMIDIPortImpl<TPort extends MIDIPort = MIDIPort, TPortType extends MIDIPortType = MIDIPortType> extends EMIDIPort<TPortType> {
40
+ readonly _port: TPort;
41
+ }
42
+ /**
43
+ *
44
+ *
45
+ * @internal
46
+ */
47
+ export declare const makeImpl: <TPort extends MIDIPort, TPortType extends MIDIPortType>(port: NoInfer<TPort>, type: TPortType, ClassToAssertInheritance: new (...args: unknown[]) => TPort) => EMIDIPortImpl<TPort, TPortType>;
48
+ /**
49
+ * Asserts an object to be valid EMIDIPort
50
+ */
51
+ export declare const assert: (port: unknown) => EMIDIPort;
52
+ /**
53
+ * @internal
54
+ */
55
+ export declare const assumeImpl: (port: EMIDIPort) => EMIDIPortImpl;
56
+ /**
57
+ *
58
+ *
59
+ */
60
+ export type PolymorphicPort<EPort, RPort, TMIDIPortType extends MIDIPortType = MIDIPortType> = Util.PolymorphicEffect<EMIDIPort<TMIDIPortType>, EPort, RPort>;
61
+ /**
62
+ *
63
+ *
64
+ */
65
+ export type PolymorphicPortClean<TMIDIPortType extends MIDIPortType = MIDIPortType> = Util.PolymorphicEffect<EMIDIPort<TMIDIPortType>, never, never>;
66
+ export type ExtractTypeFromPort<TPort extends EMIDIPort> = TPort extends EMIDIPort<infer TPortType> ? TPortType : never;
67
+ /**
68
+ *
69
+ *
70
+ * @internal
71
+ */
72
+ export declare const isImplOfSpecificType: <const TPortType extends MIDIPortType, TPort extends MIDIPort>(type: TPortType, ClassToAssertInheritance: new (...args: unknown[]) => TPort) => (port: unknown) => port is EMIDIPortImpl<TPort, TPortType>;
73
+ /**
74
+ *
75
+ *
76
+ */
77
+ export declare const is: (port: unknown) => port is EMIDIPort;
78
+ /**
79
+ * Unique identifier of the MIDI port.
80
+ *
81
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIPort/id)
82
+ */
83
+ export type Id<TPortType extends MIDIPortType> = TPortType extends MIDIPortType ? string & Brand.Brand<'MIDIPortId'> & Brand.Brand<TPortType> : never;
84
+ export type BothId = Id<MIDIPortType>;
85
+ export declare const BothId: Brand.Brand.Constructor<BothId>;
86
+ export {};
87
+ //# sourceMappingURL=EMIDIPort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EMIDIPort.d.ts","sourceRoot":"","sources":["../../../src/internal/EMIDIPort.ts"],"names":[],"mappings":"AAAA;gEACgE;AAEhE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AAEtC;;;;GAIG;AACH,QAAA,MAAM,MAAM,EAAE,OAAO,MAAgD,CAAA;AAErE;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAA;AA4DlC;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,aAAa,SAAS,YAAY,GAAG,YAAY,CAC1E,SAAQ,KAAK,CAAC,KAAK,EACjB,QAAQ,CAAC,QAAQ,EACjB,WAAW,CAAC,WAAW,EACvB,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,MAAM,GAAG,cAAc,CAAC;IACrD;;;;OAIG;IACH,QAAQ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