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.
- package/README.md +276 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/src/EMIDIAccess.js +129 -0
- package/dist/src/EMIDIAccess.js.map +1 -0
- package/dist/src/EMIDIInput.js +226 -0
- package/dist/src/EMIDIInput.js.map +1 -0
- package/dist/src/EMIDIOutput.js +227 -0
- package/dist/src/EMIDIOutput.js.map +1 -0
- package/dist/src/EMIDIPort.js +218 -0
- package/dist/src/EMIDIPort.js.map +1 -0
- package/dist/src/MIDIErrors.js +4 -0
- package/dist/src/MIDIErrors.js.map +1 -0
- package/dist/src/MIDIEventStreams.js +2 -0
- package/dist/src/MIDIEventStreams.js.map +1 -0
- package/dist/src/Parsing.js +2 -0
- package/dist/src/Parsing.js.map +1 -0
- package/dist/src/StreamMaker.js +1 -0
- package/dist/src/StreamMaker.js.map +1 -0
- package/dist/src/Util.js +2 -0
- package/dist/src/Util.js.map +1 -0
- package/dist/src/index.js +10 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/internal/EMIDIAccess.js +634 -0
- package/dist/src/internal/EMIDIAccess.js.map +1 -0
- package/dist/src/internal/EMIDIInput.js +66 -0
- package/dist/src/internal/EMIDIInput.js.map +1 -0
- package/dist/src/internal/EMIDIOutput.js +120 -0
- package/dist/src/internal/EMIDIOutput.js.map +1 -0
- package/dist/src/internal/EMIDIPort.js +125 -0
- package/dist/src/internal/EMIDIPort.js.map +1 -0
- package/dist/src/internal/MIDIErrors.js +190 -0
- package/dist/src/internal/MIDIErrors.js.map +1 -0
- package/dist/src/internal/MIDIEventStreams.js +41 -0
- package/dist/src/internal/MIDIEventStreams.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.js +27 -0
- package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.js +19 -0
- package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.js +16 -0
- package/dist/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/actOnPort.js +17 -0
- package/dist/src/internal/MIDIPortMethodCalls/actOnPort.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.js +27 -0
- package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.js +18 -0
- package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.js +16 -0
- package/dist/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.js +21 -0
- package/dist/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.js +34 -0
- package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.js +18 -0
- package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.js +16 -0
- package/dist/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.js.map +1 -0
- package/dist/src/internal/Parsing.js +119 -0
- package/dist/src/internal/Parsing.js.map +1 -0
- package/dist/src/internal/StreamMaker.js +105 -0
- package/dist/src/internal/StreamMaker.js.map +1 -0
- package/dist/src/internal/Util.js +59 -0
- package/dist/src/internal/Util.js.map +1 -0
- package/dist/src/internal/getPortByPortId/getPortByPortIdAndAccess.js +53 -0
- package/dist/src/internal/getPortByPortId/getPortByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/getPortByPortId/getPortByPortIdInContext.js +18 -0
- package/dist/src/internal/getPortByPortId/getPortByPortIdInContext.js.map +1 -0
- package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.js +52 -0
- package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.js.map +1 -0
- package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.js +21 -0
- package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.js +21 -0
- package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.js +66 -0
- package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.js +61 -0
- package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.js +68 -0
- package/dist/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.js +42 -0
- package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.js +43 -0
- package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.js +33 -0
- package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.js +6 -0
- package/dist/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.js +46 -0
- package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.js +25 -0
- package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.js +31 -0
- package/dist/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.js.map +1 -0
- package/dist-types/index.d.ts +2 -0
- package/dist-types/index.d.ts.map +1 -0
- package/dist-types/src/EMIDIAccess.d.ts +18 -0
- package/dist-types/src/EMIDIAccess.d.ts.map +1 -0
- package/dist-types/src/EMIDIInput.d.ts +26 -0
- package/dist-types/src/EMIDIInput.d.ts.map +1 -0
- package/dist-types/src/EMIDIOutput.d.ts +26 -0
- package/dist-types/src/EMIDIOutput.d.ts.map +1 -0
- package/dist-types/src/EMIDIPort.d.ts +26 -0
- package/dist-types/src/EMIDIPort.d.ts.map +1 -0
- package/dist-types/src/MIDIErrors.d.ts +2 -0
- package/dist-types/src/MIDIErrors.d.ts.map +1 -0
- package/dist-types/src/MIDIEventStreams.d.ts +2 -0
- package/dist-types/src/MIDIEventStreams.d.ts.map +1 -0
- package/dist-types/src/Parsing.d.ts +2 -0
- package/dist-types/src/Parsing.d.ts.map +1 -0
- package/dist-types/src/StreamMaker.d.ts +2 -0
- package/dist-types/src/StreamMaker.d.ts.map +1 -0
- package/dist-types/src/Util.d.ts +2 -0
- package/dist-types/src/Util.d.ts.map +1 -0
- package/dist-types/src/index.d.ts +10 -0
- package/dist-types/src/index.d.ts.map +1 -0
- package/dist-types/src/internal/EMIDIAccess.d.ts +551 -0
- package/dist-types/src/internal/EMIDIAccess.d.ts.map +1 -0
- package/dist-types/src/internal/EMIDIInput.d.ts +50 -0
- package/dist-types/src/internal/EMIDIInput.d.ts.map +1 -0
- package/dist-types/src/internal/EMIDIOutput.d.ts +95 -0
- package/dist-types/src/internal/EMIDIOutput.d.ts.map +1 -0
- package/dist-types/src/internal/EMIDIPort.d.ts +90 -0
- package/dist-types/src/internal/EMIDIPort.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIErrors.d.ts +270 -0
- package/dist-types/src/internal/MIDIErrors.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIEventStreams.d.ts +74 -0
- package/dist-types/src/internal/MIDIEventStreams.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.d.ts +16 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.d.ts +15 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.d.ts +13 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/actOnPort.d.ts +11 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/actOnPort.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.d.ts +23 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.d.ts +15 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.d.ts +13 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.d.ts +15 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.d.ts +21 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.d.ts +15 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.d.ts +13 -0
- package/dist-types/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.d.ts.map +1 -0
- package/dist-types/src/internal/Parsing.d.ts +110 -0
- package/dist-types/src/internal/Parsing.d.ts.map +1 -0
- package/dist-types/src/internal/StreamMaker.d.ts +204 -0
- package/dist-types/src/internal/StreamMaker.d.ts.map +1 -0
- package/dist-types/src/internal/Util.d.ts +33 -0
- package/dist-types/src/internal/Util.d.ts.map +1 -0
- package/dist-types/src/internal/getPortByPortId/getPortByPortIdAndAccess.d.ts +27 -0
- package/dist-types/src/internal/getPortByPortId/getPortByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/getPortByPortId/getPortByPortIdInContext.d.ts +20 -0
- package/dist-types/src/internal/getPortByPortId/getPortByPortIdInContext.d.ts.map +1 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.d.ts +76 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.d.ts.map +1 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.d.ts +39 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.d.ts +29 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.d.ts +62 -0
- package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.d.ts +16 -0
- package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.d.ts +65 -0
- package/dist-types/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.d.ts +36 -0
- package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.d.ts +23 -0
- package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.d.ts +35 -0
- package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.d.ts +7 -0
- package/dist-types/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.d.ts +71 -0
- package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.d.ts +7 -0
- package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.d.ts +28 -0
- package/dist-types/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.d.ts.map +1 -0
- package/index.ts +1 -0
- package/package.json +87 -0
- package/src/EMIDIAccess.ts +285 -0
- package/src/EMIDIInput.ts +273 -0
- package/src/EMIDIOutput.ts +272 -0
- package/src/EMIDIPort.ts +270 -0
- package/src/MIDIErrors.ts +13 -0
- package/src/MIDIEventStreams.ts +36 -0
- package/src/Parsing.ts +32 -0
- package/src/StreamMaker.ts +12 -0
- package/src/Util.ts +19 -0
- package/src/index.ts +9 -0
- package/src/internal/EMIDIAccess.ts +1280 -0
- package/src/internal/EMIDIInput.ts +114 -0
- package/src/internal/EMIDIOutput.ts +231 -0
- package/src/internal/EMIDIPort.ts +239 -0
- package/src/internal/MIDIErrors.ts +260 -0
- package/src/internal/MIDIEventStreams.ts +255 -0
- package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.ts +48 -0
- package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.ts +31 -0
- package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.ts +28 -0
- package/src/internal/MIDIPortMethodCalls/actOnPort.ts +66 -0
- package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPort.ts +38 -0
- package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdAndAccess.ts +38 -0
- package/src/internal/MIDIPortMethodCalls/closePortConnection/closePortConnectionByPortIdInContext.ts +28 -0
- package/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.ts +68 -0
- package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.ts +48 -0
- package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.ts +38 -0
- package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.ts +28 -0
- package/src/internal/Parsing.ts +304 -0
- package/src/internal/StreamMaker.ts +416 -0
- package/src/internal/Util.ts +152 -0
- package/src/internal/getPortByPortId/getPortByPortIdAndAccess.ts +117 -0
- package/src/internal/getPortByPortId/getPortByPortIdInContext.ts +26 -0
- package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.ts +148 -0
- package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.ts +135 -0
- package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.ts +70 -0
- package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.ts +128 -0
- package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.ts +74 -0
- package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.ts +132 -0
- package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.ts +64 -0
- package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.ts +114 -0
- package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.ts +47 -0
- package/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.ts +12 -0
- package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.ts +182 -0
- package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.ts +29 -0
- package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.ts +87 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/** biome-ignore-all lint/style/useShorthandFunctionType: It's a nice way to
|
|
2
|
+
* preserve JSDoc comments attached to the function signature */
|
|
3
|
+
|
|
4
|
+
import * as EMIDIInput from '../EMIDIInput.ts'
|
|
5
|
+
import * as EMIDIOutput from '../EMIDIOutput.ts'
|
|
6
|
+
import * as EMIDIPort from '../EMIDIPort.ts'
|
|
7
|
+
import * as StreamMaker from '../StreamMaker.ts'
|
|
8
|
+
import * as Util from '../Util.ts'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export const makePortStateChangesStreamFactory = <
|
|
15
|
+
THighLevelPortType extends MIDIPortType,
|
|
16
|
+
>(
|
|
17
|
+
is: (port: unknown) => port is EMIDIPort.EMIDIPort<THighLevelPortType>,
|
|
18
|
+
) =>
|
|
19
|
+
StreamMaker.createStreamMakerFrom<MIDIPortEventMap>()(
|
|
20
|
+
is,
|
|
21
|
+
port => ({
|
|
22
|
+
tag: 'MIDIPortStateChange',
|
|
23
|
+
eventListener: {
|
|
24
|
+
target: EMIDIPort.assumeImpl(port)._port,
|
|
25
|
+
type: 'statechange',
|
|
26
|
+
},
|
|
27
|
+
spanAttributes: {
|
|
28
|
+
spanTargetName: 'MIDI port',
|
|
29
|
+
port: Util.getStaticMIDIPortInfo(port),
|
|
30
|
+
},
|
|
31
|
+
nullableFieldName: 'port',
|
|
32
|
+
}),
|
|
33
|
+
rawPort =>
|
|
34
|
+
({
|
|
35
|
+
newState: rawPort
|
|
36
|
+
? ({
|
|
37
|
+
ofDevice: rawPort.state,
|
|
38
|
+
ofConnection: rawPort.connection,
|
|
39
|
+
} as const)
|
|
40
|
+
: null,
|
|
41
|
+
}) as const,
|
|
42
|
+
// TODO: check this type is actually needed
|
|
43
|
+
) as DualMakeStateChangesStreamByPort<THighLevelPortType>
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Function to create a stream of remapped {@linkcode MIDIConnectionEvent}s
|
|
47
|
+
*
|
|
48
|
+
* [MDN
|
|
49
|
+
* Reference](https://developer.mozilla.org/docs/Web/API/MIDIConnectionEvent)
|
|
50
|
+
*/
|
|
51
|
+
export const makePortStateChangesStreamByPort =
|
|
52
|
+
makePortStateChangesStreamFactory(EMIDIPort.is)
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Function to create a stream of remapped {@linkcode MIDIConnectionEvent}s
|
|
56
|
+
*
|
|
57
|
+
* [MDN
|
|
58
|
+
* Reference](https://developer.mozilla.org/docs/Web/API/MIDIConnectionEvent)
|
|
59
|
+
*/
|
|
60
|
+
export const makeInputStateChangesStreamByPort =
|
|
61
|
+
makePortStateChangesStreamFactory(EMIDIInput.is)
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Function to create a stream of remapped {@linkcode MIDIConnectionEvent}s
|
|
65
|
+
*
|
|
66
|
+
* [MDN
|
|
67
|
+
* Reference](https://developer.mozilla.org/docs/Web/API/MIDIConnectionEvent)
|
|
68
|
+
*/
|
|
69
|
+
export const makeOutputStateChangesStreamByPort =
|
|
70
|
+
makePortStateChangesStreamFactory(EMIDIOutput.is)
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A custom type is needed because the port type will be generic, but this is
|
|
74
|
+
* not possible if using just {@linkcode StreamMaker.createStreamMakerFrom}
|
|
75
|
+
*/
|
|
76
|
+
export interface DualMakeStateChangesStreamByPort<
|
|
77
|
+
THighLevelPortType extends MIDIPortType = MIDIPortType,
|
|
78
|
+
> extends MakeStateChangesStreamPortFirst<THighLevelPortType>,
|
|
79
|
+
MakeStateChangesStreamPortLast<THighLevelPortType> {}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A custom type is needed because the port type will be generic, but this is
|
|
83
|
+
* not possible if using just {@linkcode StreamMaker.createStreamMakerFrom}
|
|
84
|
+
*/
|
|
85
|
+
export interface MakeStateChangesStreamPortFirst<
|
|
86
|
+
THighLevelPortType extends MIDIPortType = MIDIPortType,
|
|
87
|
+
> {
|
|
88
|
+
/**
|
|
89
|
+
* @param options Passing a value of a `boolean` type is equivalent to setting `options.capture`
|
|
90
|
+
* property
|
|
91
|
+
*/
|
|
92
|
+
<
|
|
93
|
+
TPortType extends THighLevelPortType,
|
|
94
|
+
const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined,
|
|
95
|
+
E = never,
|
|
96
|
+
R = never,
|
|
97
|
+
>(
|
|
98
|
+
polymorphicPort: EMIDIPort.PolymorphicPort<E, R, TPortType>,
|
|
99
|
+
options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>,
|
|
100
|
+
): StateChangesStream<TOnNullStrategy, TPortType, E, R>
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A custom type is needed because the port type will be generic, but this is
|
|
105
|
+
* not possible if using just {@linkcode StreamMaker.createStreamMakerFrom}
|
|
106
|
+
*/
|
|
107
|
+
export interface MakeStateChangesStreamPortLast<
|
|
108
|
+
THighLevelPortType extends MIDIPortType = MIDIPortType,
|
|
109
|
+
> {
|
|
110
|
+
/**
|
|
111
|
+
* @param options Passing a value of a `boolean` type is equivalent to setting `options.capture`
|
|
112
|
+
* property
|
|
113
|
+
*/
|
|
114
|
+
<const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined>(
|
|
115
|
+
options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>,
|
|
116
|
+
): {
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
*
|
|
120
|
+
*/
|
|
121
|
+
<TPortType extends THighLevelPortType, E = never, R = never>(
|
|
122
|
+
polymorphicPort: EMIDIPort.PolymorphicPort<E, R, TPortType>,
|
|
123
|
+
): StateChangesStream<TOnNullStrategy, TPortType, E, R>
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* A custom type is needed because the port type will be generic, but this is
|
|
129
|
+
* not possible if using just {@linkcode StreamMaker.createStreamMakerFrom}
|
|
130
|
+
*/
|
|
131
|
+
export interface StateChangesStream<
|
|
132
|
+
TOnNullStrategy extends StreamMaker.OnNullStrategy,
|
|
133
|
+
TPortType extends MIDIPortType,
|
|
134
|
+
E = never,
|
|
135
|
+
R = never,
|
|
136
|
+
> extends StreamMaker.BuiltStream<
|
|
137
|
+
'MIDIPortStateChange',
|
|
138
|
+
EMIDIPort.EMIDIPort<TPortType>,
|
|
139
|
+
{
|
|
140
|
+
readonly newState: {
|
|
141
|
+
readonly ofDevice: MIDIPortDeviceState
|
|
142
|
+
readonly ofConnection: MIDIPortConnectionState
|
|
143
|
+
} | null
|
|
144
|
+
},
|
|
145
|
+
TOnNullStrategy,
|
|
146
|
+
E,
|
|
147
|
+
R
|
|
148
|
+
> {}
|
package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.ts
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/** biome-ignore-all lint/style/useShorthandFunctionType: It's a nice way to
|
|
2
|
+
* preserve JSDoc comments attached to the function signature */
|
|
3
|
+
|
|
4
|
+
import * as EFunction from 'effect/Function'
|
|
5
|
+
|
|
6
|
+
import * as EMIDIAccess from '../EMIDIAccess.ts'
|
|
7
|
+
import type * as EMIDIPort from '../EMIDIPort.ts'
|
|
8
|
+
import * as Get from '../getPortByPortId/getPortByPortIdAndAccess.ts'
|
|
9
|
+
import type * as MIDIErrors from '../MIDIErrors.ts'
|
|
10
|
+
import type * as StreamMaker from '../StreamMaker.ts'
|
|
11
|
+
import * as Util from '../Util.ts'
|
|
12
|
+
import * as Make from './makePortStateChangesStreamByPort.ts'
|
|
13
|
+
|
|
14
|
+
const wrap = <
|
|
15
|
+
TTypeOfPortId extends MIDIPortType,
|
|
16
|
+
TPortGettingError = never,
|
|
17
|
+
TPortGettingRequirement = never,
|
|
18
|
+
>(
|
|
19
|
+
makePortStateChangesStream: Make.DualMakeStateChangesStreamByPort<TTypeOfPortId>,
|
|
20
|
+
getPortFromAccessAndPortId: Get.GetPortById<
|
|
21
|
+
TTypeOfPortId,
|
|
22
|
+
TTypeOfPortId,
|
|
23
|
+
never,
|
|
24
|
+
never,
|
|
25
|
+
TPortGettingError,
|
|
26
|
+
TPortGettingRequirement
|
|
27
|
+
>,
|
|
28
|
+
): MakePortStateChangesStreamByIdAndAccess<
|
|
29
|
+
TTypeOfPortId,
|
|
30
|
+
TPortGettingError,
|
|
31
|
+
TPortGettingRequirement
|
|
32
|
+
> =>
|
|
33
|
+
EFunction.dual(
|
|
34
|
+
Util.polymorphicCheckInDual(EMIDIAccess.is),
|
|
35
|
+
(polymorphicAccess, id, options) =>
|
|
36
|
+
makePortStateChangesStream(
|
|
37
|
+
getPortFromAccessAndPortId(polymorphicAccess, id),
|
|
38
|
+
options,
|
|
39
|
+
),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
export const makePortStateChangesStreamByPortIdAndAccess = wrap(
|
|
46
|
+
Make.makePortStateChangesStreamByPort,
|
|
47
|
+
Get.getPortByPortIdAndAccess,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
export const makeInputStateChangesStreamByPortIdAndAccess = wrap(
|
|
54
|
+
Make.makeInputStateChangesStreamByPort,
|
|
55
|
+
Get.getInputByPortIdAndAccess,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
export const makeOutputStateChangesStreamByPortIdAndAccess = wrap(
|
|
62
|
+
Make.makeOutputStateChangesStreamByPort,
|
|
63
|
+
Get.getOutputByPortIdAndAccess,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
export interface MakePortStateChangesStreamByIdAndAccess<
|
|
67
|
+
TTypeOfPortId extends MIDIPortType,
|
|
68
|
+
TPortGettingError,
|
|
69
|
+
TPortGettingRequirement,
|
|
70
|
+
> extends MakePortStateChangesStreamByIdAccessLast<
|
|
71
|
+
TTypeOfPortId,
|
|
72
|
+
TPortGettingError,
|
|
73
|
+
TPortGettingRequirement
|
|
74
|
+
>,
|
|
75
|
+
MakePortStateChangesStreamByIdAccessFirst<
|
|
76
|
+
TTypeOfPortId,
|
|
77
|
+
TPortGettingError,
|
|
78
|
+
TPortGettingRequirement
|
|
79
|
+
> {}
|
|
80
|
+
|
|
81
|
+
export interface MakePortStateChangesStreamByIdAccessFirst<
|
|
82
|
+
TTypeOfPortId extends MIDIPortType,
|
|
83
|
+
TPortGettingError,
|
|
84
|
+
TPortGettingRequirement,
|
|
85
|
+
> {
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
*/
|
|
89
|
+
<
|
|
90
|
+
TAccessError = never,
|
|
91
|
+
TAccessRequirement = never,
|
|
92
|
+
const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined,
|
|
93
|
+
>(
|
|
94
|
+
polymorphicAccess: EMIDIAccess.PolymorphicAccessInstance<
|
|
95
|
+
TAccessError,
|
|
96
|
+
TAccessRequirement
|
|
97
|
+
>,
|
|
98
|
+
id: EMIDIPort.Id<TTypeOfPortId>,
|
|
99
|
+
options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>,
|
|
100
|
+
): Make.StateChangesStream<
|
|
101
|
+
TOnNullStrategy,
|
|
102
|
+
TTypeOfPortId,
|
|
103
|
+
MIDIErrors.PortNotFoundError | TAccessError | TPortGettingError,
|
|
104
|
+
TAccessRequirement | TPortGettingRequirement
|
|
105
|
+
>
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface MakePortStateChangesStreamByIdAccessLast<
|
|
109
|
+
TTypeOfPortId extends MIDIPortType,
|
|
110
|
+
TPortGettingError,
|
|
111
|
+
TPortGettingRequirement,
|
|
112
|
+
> {
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
<const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined>(
|
|
117
|
+
id: EMIDIPort.Id<TTypeOfPortId>,
|
|
118
|
+
options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>,
|
|
119
|
+
): {
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
<TAccessError = never, TAccessRequirement = never>(
|
|
124
|
+
polymorphicAccess: EMIDIAccess.PolymorphicAccessInstance<
|
|
125
|
+
TAccessError,
|
|
126
|
+
TAccessRequirement
|
|
127
|
+
>,
|
|
128
|
+
): Make.StateChangesStream<
|
|
129
|
+
TOnNullStrategy,
|
|
130
|
+
TTypeOfPortId,
|
|
131
|
+
MIDIErrors.PortNotFoundError | TAccessError | TPortGettingError,
|
|
132
|
+
TAccessRequirement | TPortGettingRequirement
|
|
133
|
+
>
|
|
134
|
+
}
|
|
135
|
+
}
|
package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** biome-ignore-all lint/style/useShorthandFunctionType: It's a nice way to
|
|
2
|
+
* preserve JSDoc comments attached to the function signature */
|
|
3
|
+
|
|
4
|
+
import type * as EMIDIPort from '../../EMIDIPort.ts'
|
|
5
|
+
import * as EMIDIAccess from '../EMIDIAccess.ts'
|
|
6
|
+
import type * as MIDIErrors from '../MIDIErrors.ts'
|
|
7
|
+
import type * as StreamMaker from '../StreamMaker.ts'
|
|
8
|
+
import * as Make from './makePortStateChangesStreamByPortIdAndAccess.ts'
|
|
9
|
+
|
|
10
|
+
const wrap =
|
|
11
|
+
<
|
|
12
|
+
TTypeOfPortId extends MIDIPortType,
|
|
13
|
+
TPortGettingError,
|
|
14
|
+
TPortGettingRequirement,
|
|
15
|
+
>(
|
|
16
|
+
makeStream: Make.MakePortStateChangesStreamByIdAndAccess<
|
|
17
|
+
TTypeOfPortId,
|
|
18
|
+
TPortGettingError,
|
|
19
|
+
TPortGettingRequirement
|
|
20
|
+
>,
|
|
21
|
+
): MakePortStateChangesStreamByPortIdInContext<
|
|
22
|
+
TTypeOfPortId,
|
|
23
|
+
TPortGettingError,
|
|
24
|
+
TPortGettingRequirement
|
|
25
|
+
> =>
|
|
26
|
+
(id, options) =>
|
|
27
|
+
makeStream(EMIDIAccess.EMIDIAccess, id, options)
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param options Passing a value of a `boolean` type is equivalent to setting
|
|
31
|
+
* `options.capture` property
|
|
32
|
+
*/
|
|
33
|
+
export const makePortStateChangesStreamByPortIdInContext = wrap(
|
|
34
|
+
Make.makePortStateChangesStreamByPortIdAndAccess,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param options Passing a value of a `boolean` type is equivalent to setting
|
|
39
|
+
* `options.capture` property
|
|
40
|
+
*/
|
|
41
|
+
export const makeInputStateChangesStreamByPortIdInContext = wrap(
|
|
42
|
+
Make.makeInputStateChangesStreamByPortIdAndAccess,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param options Passing a value of a `boolean` type is equivalent to setting
|
|
47
|
+
* `options.capture` property
|
|
48
|
+
*/
|
|
49
|
+
export const makeOutputStateChangesStreamByPortIdInContext = wrap(
|
|
50
|
+
Make.makeOutputStateChangesStreamByPortIdAndAccess,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
interface MakePortStateChangesStreamByPortIdInContext<
|
|
54
|
+
TTypeOfPortId extends MIDIPortType,
|
|
55
|
+
TPortGettingError,
|
|
56
|
+
TPortGettingRequirement,
|
|
57
|
+
> {
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
<const TOnNullStrategy extends StreamMaker.OnNullStrategy = undefined>(
|
|
62
|
+
id: EMIDIPort.Id<TTypeOfPortId>,
|
|
63
|
+
options?: StreamMaker.StreamMakerOptions<TOnNullStrategy>,
|
|
64
|
+
): EMIDIPort.StateChangesStream<
|
|
65
|
+
TOnNullStrategy,
|
|
66
|
+
TTypeOfPortId,
|
|
67
|
+
TPortGettingError | MIDIErrors.PortNotFoundError,
|
|
68
|
+
TPortGettingRequirement | EMIDIAccess.EMIDIAccess
|
|
69
|
+
>
|
|
70
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as EFunction from 'effect/Function'
|
|
2
|
+
|
|
3
|
+
import * as Util from '../../Util.ts'
|
|
4
|
+
import * as Get from '../getMutablePortProperty/getMutablePortPropertyByPort.ts'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export const isPortDeviceConnectedByPort = EFunction.flow(
|
|
10
|
+
Get.getPortDeviceStateByPort,
|
|
11
|
+
Util.isDeviceConnected,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export const isPortDeviceDisconnectedByPort = EFunction.flow(
|
|
18
|
+
Get.getPortDeviceStateByPort,
|
|
19
|
+
Util.isDeviceDisconnected,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export const isPortConnectionOpenByPort = EFunction.flow(
|
|
26
|
+
Get.getPortConnectionStateByPort,
|
|
27
|
+
Util.isConnectionOpen,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
export const isPortConnectionPendingByPort = EFunction.flow(
|
|
34
|
+
Get.getPortConnectionStateByPort,
|
|
35
|
+
Util.isConnectionPending,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
export const isPortConnectionClosedByPort = EFunction.flow(
|
|
42
|
+
Get.getPortConnectionStateByPort,
|
|
43
|
+
Util.isConnectionClosed,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
//////////////////////////////
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
export const isInputDeviceConnectedByPort = EFunction.flow(
|
|
52
|
+
Get.getInputDeviceStateByPort,
|
|
53
|
+
Util.isDeviceConnected,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export const isInputDeviceDisconnectedByPort = EFunction.flow(
|
|
60
|
+
Get.getInputDeviceStateByPort,
|
|
61
|
+
Util.isDeviceDisconnected,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
export const isInputConnectionOpenByPort = EFunction.flow(
|
|
68
|
+
Get.getInputConnectionStateByPort,
|
|
69
|
+
Util.isConnectionOpen,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
export const isInputConnectionPendingByPort = EFunction.flow(
|
|
76
|
+
Get.getInputConnectionStateByPort,
|
|
77
|
+
Util.isConnectionPending,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
export const isInputConnectionClosedByPort = EFunction.flow(
|
|
84
|
+
Get.getInputConnectionStateByPort,
|
|
85
|
+
Util.isConnectionClosed,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
//////////////////////////////
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
export const isOutputDeviceConnectedByPort = EFunction.flow(
|
|
94
|
+
Get.getOutputDeviceStateByPort,
|
|
95
|
+
Util.isDeviceConnected,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
export const isOutputDeviceDisconnectedByPort = EFunction.flow(
|
|
102
|
+
Get.getOutputDeviceStateByPort,
|
|
103
|
+
Util.isDeviceDisconnected,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
export const isOutputConnectionOpenByPort = EFunction.flow(
|
|
110
|
+
Get.getOutputConnectionStateByPort,
|
|
111
|
+
Util.isConnectionOpen,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
*/
|
|
117
|
+
export const isOutputConnectionPendingByPort = EFunction.flow(
|
|
118
|
+
Get.getOutputConnectionStateByPort,
|
|
119
|
+
Util.isConnectionPending,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
125
|
+
export const isOutputConnectionClosedByPort = EFunction.flow(
|
|
126
|
+
Get.getOutputConnectionStateByPort,
|
|
127
|
+
Util.isConnectionClosed,
|
|
128
|
+
)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// TODO: isInputConnectionClosedByPortIdAndAccess
|
|
2
|
+
export const isInputConnectionClosedByPortIdAndAccess = () => {
|
|
3
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// TODO: isInputConnectionOpenByPortIdAndAccess
|
|
7
|
+
export const isInputConnectionOpenByPortIdAndAccess = () => {
|
|
8
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// TODO: isInputConnectionPendingByPortIdAndAccess
|
|
12
|
+
export const isInputConnectionPendingByPortIdAndAccess = () => {
|
|
13
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// TODO: isInputDeviceConnectedByPortIdAndAccess
|
|
17
|
+
export const isInputDeviceConnectedByPortIdAndAccess = () => {
|
|
18
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// TODO: isInputDeviceDisconnectedByPortIdAndAccess
|
|
22
|
+
export const isInputDeviceDisconnectedByPortIdAndAccess = () => {
|
|
23
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// TODO: isOutputConnectionClosedByPortIdAndAccess
|
|
27
|
+
export const isOutputConnectionClosedByPortIdAndAccess = () => {
|
|
28
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// TODO: isOutputConnectionOpenByPortIdAndAccess
|
|
32
|
+
export const isOutputConnectionOpenByPortIdAndAccess = () => {
|
|
33
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// TODO: isOutputConnectionPendingByPortIdAndAccess
|
|
37
|
+
export const isOutputConnectionPendingByPortIdAndAccess = () => {
|
|
38
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// TODO: isOutputDeviceConnectedByPortIdAndAccess
|
|
42
|
+
export const isOutputDeviceConnectedByPortIdAndAccess = () => {
|
|
43
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// TODO: isOutputDeviceDisconnectedByPortIdAndAccess
|
|
47
|
+
export const isOutputDeviceDisconnectedByPortIdAndAccess = () => {
|
|
48
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// TODO: isPortConnectionClosedByPortIdAndAccess
|
|
52
|
+
export const isPortConnectionClosedByPortIdAndAccess = () => {
|
|
53
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// TODO: isPortConnectionOpenByPortIdAndAccess
|
|
57
|
+
export const isPortConnectionOpenByPortIdAndAccess = () => {
|
|
58
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// TODO: isPortConnectionPendingByPortIdAndAccess
|
|
62
|
+
export const isPortConnectionPendingByPortIdAndAccess = () => {
|
|
63
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// TODO: isPortDeviceConnectedByPortIdAndAccess
|
|
67
|
+
export const isPortDeviceConnectedByPortIdAndAccess = () => {
|
|
68
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// TODO: isPortDeviceDisconnectedByPortIdAndAccess
|
|
72
|
+
export const isPortDeviceDisconnectedByPortIdAndAccess = () => {
|
|
73
|
+
throw new Error('Not implemented 😿 YET!! 🤩')
|
|
74
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as EFunction from 'effect/Function'
|
|
2
|
+
|
|
3
|
+
import * as Get from '../../getPortByPortId/getPortByPortIdInContext.ts'
|
|
4
|
+
import * as Check from './doesMutablePortPropertyHaveSpecificValueByPort.ts'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export const closePortConnectionByPortIdInContext = EFunction.flow(
|
|
10
|
+
Get.getInputByPortIdInContext,
|
|
11
|
+
Check.isInputConnectionClosedByPort,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export const isInputConnectionClosedByPortIdInContext = EFunction.flow(
|
|
18
|
+
Get.getInputByPortIdInContext,
|
|
19
|
+
Check.isInputConnectionClosedByPort,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export const isInputConnectionOpenByPortIdInContext = EFunction.flow(
|
|
26
|
+
Get.getInputByPortIdInContext,
|
|
27
|
+
Check.isInputConnectionClosedByPort,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
export const isInputConnectionPendingByPortIdInContext = EFunction.flow(
|
|
34
|
+
Get.getInputByPortIdInContext,
|
|
35
|
+
Check.isInputConnectionClosedByPort,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
export const isInputDeviceConnectedByPortIdInContext = EFunction.flow(
|
|
42
|
+
Get.getInputByPortIdInContext,
|
|
43
|
+
Check.isInputConnectionClosedByPort,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
export const isInputDeviceDisconnectedByPortIdInContext = EFunction.flow(
|
|
50
|
+
Get.getInputByPortIdInContext,
|
|
51
|
+
Check.isInputConnectionClosedByPort,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
export const isOutputConnectionClosedByPortIdInContext = EFunction.flow(
|
|
58
|
+
Get.getOutputByPortIdInContext,
|
|
59
|
+
Check.isOutputConnectionClosedByPort,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
export const isOutputConnectionOpenByPortIdInContext = EFunction.flow(
|
|
66
|
+
Get.getOutputByPortIdInContext,
|
|
67
|
+
Check.isOutputConnectionClosedByPort,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
export const isOutputConnectionPendingByPortIdInContext = EFunction.flow(
|
|
74
|
+
Get.getOutputByPortIdInContext,
|
|
75
|
+
Check.isOutputConnectionClosedByPort,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
export const isOutputDeviceConnectedByPortIdInContext = EFunction.flow(
|
|
82
|
+
Get.getOutputByPortIdInContext,
|
|
83
|
+
Check.isOutputConnectionClosedByPort,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
*/
|
|
89
|
+
export const isOutputDeviceDisconnectedByPortIdInContext = EFunction.flow(
|
|
90
|
+
Get.getOutputByPortIdInContext,
|
|
91
|
+
Check.isOutputConnectionClosedByPort,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
*/
|
|
97
|
+
export const isPortConnectionClosedByPortIdInContext = EFunction.flow(
|
|
98
|
+
Get.getPortByPortIdInContext,
|
|
99
|
+
Check.isPortConnectionClosedByPort,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
export const isPortConnectionOpenByPortIdInContext = EFunction.flow(
|
|
106
|
+
Get.getPortByPortIdInContext,
|
|
107
|
+
Check.isPortConnectionClosedByPort,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
export const isPortConnectionPendingByPortIdInContext = EFunction.flow(
|
|
114
|
+
Get.getPortByPortIdInContext,
|
|
115
|
+
Check.isPortConnectionClosedByPort,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
*/
|
|
121
|
+
export const isPortDeviceConnectedByPortIdInContext = EFunction.flow(
|
|
122
|
+
Get.getPortByPortIdInContext,
|
|
123
|
+
Check.isPortConnectionClosedByPort,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
export const isPortDeviceDisconnectedByPortIdInContext = EFunction.flow(
|
|
130
|
+
Get.getPortByPortIdInContext,
|
|
131
|
+
Check.isPortConnectionClosedByPort,
|
|
132
|
+
)
|