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.
- package/README.md +7 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/src/EMIDIAccess.js +68 -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 +225 -0
- package/dist/src/EMIDIOutput.js.map +1 -0
- package/dist/src/EMIDIPort.js +213 -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/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 +4 -0
- package/dist/src/Util.js.map +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/internal/EMIDIAccess.js +409 -0
- package/dist/src/internal/EMIDIAccess.js.map +1 -0
- package/dist/src/internal/EMIDIInput.js +69 -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/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 +18 -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 +30 -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/StreamMaker.js +101 -0
- package/dist/src/internal/StreamMaker.js.map +1 -0
- package/dist/src/internal/errors.js +161 -0
- package/dist/src/internal/errors.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 +13 -0
- package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.js +18 -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 +61 -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 +42 -0
- package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.js.map +1 -0
- package/dist/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.js +29 -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/src/internal/parsing.js +117 -0
- package/dist/src/internal/parsing.js.map +1 -0
- package/dist/src/internal/util.js +59 -0
- package/dist/src/internal/util.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 +27 -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/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 +9 -0
- package/dist-types/src/index.d.ts.map +1 -0
- package/dist-types/src/internal/EMIDIAccess.d.ts +339 -0
- package/dist-types/src/internal/EMIDIAccess.d.ts.map +1 -0
- package/dist-types/src/internal/EMIDIInput.d.ts +48 -0
- package/dist-types/src/internal/EMIDIInput.d.ts.map +1 -0
- package/dist-types/src/internal/EMIDIOutput.d.ts +93 -0
- package/dist-types/src/internal/EMIDIOutput.d.ts.map +1 -0
- package/dist-types/src/internal/EMIDIPort.d.ts +87 -0
- package/dist-types/src/internal/EMIDIPort.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/StreamMaker.d.ts +202 -0
- package/dist-types/src/internal/StreamMaker.d.ts.map +1 -0
- package/dist-types/src/internal/errors.d.ts +260 -0
- package/dist-types/src/internal/errors.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 +71 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.d.ts.map +1 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.d.ts +4 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.d.ts +20 -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 +16 -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 +22 -0
- package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.d.ts.map +1 -0
- package/dist-types/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.d.ts +17 -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/dist-types/src/internal/parsing.d.ts +72 -0
- package/dist-types/src/internal/parsing.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/index.ts +1 -0
- package/package.json +83 -0
- package/src/EMIDIAccess.ts +271 -0
- package/src/EMIDIInput.ts +270 -0
- package/src/EMIDIOutput.ts +269 -0
- package/src/EMIDIPort.ts +267 -0
- package/src/MIDIErrors.ts +13 -0
- package/src/Parsing.ts +12 -0
- package/src/StreamMaker.ts +12 -0
- package/src/Util.ts +19 -0
- package/src/index.ts +8 -0
- package/src/internal/EMIDIAccess.ts +893 -0
- package/src/internal/EMIDIInput.ts +114 -0
- package/src/internal/EMIDIOutput.ts +228 -0
- package/src/internal/EMIDIPort.ts +233 -0
- package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPort.ts +43 -0
- package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdAndAccess.ts +39 -0
- package/src/internal/MIDIPortMethodCalls/acquireReleasePortConnection/acquireReleasePortConnectionByPortIdInContext.ts +27 -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 +27 -0
- package/src/internal/MIDIPortMethodCalls/makeMIDIPortMethodCallerFactory.ts +73 -0
- package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPort.ts +44 -0
- package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdAndAccess.ts +38 -0
- package/src/internal/MIDIPortMethodCalls/openPortConnection/openPortConnectionByPortIdInContext.ts +27 -0
- package/src/internal/StreamMaker.ts +414 -0
- package/src/internal/errors.ts +220 -0
- package/src/internal/getPortByPortId/getPortByPortIdAndAccess.ts +116 -0
- package/src/internal/getPortByPortId/getPortByPortIdInContext.ts +26 -0
- package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.ts +148 -0
- package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.ts +14 -0
- package/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.ts +51 -0
- package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.ts +127 -0
- package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.ts +74 -0
- package/src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.ts +74 -0
- package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.ts +63 -0
- package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdAndAccess.ts +110 -0
- package/src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPortIdInContext.ts +37 -0
- package/src/internal/mutablePropertyTools/getValueInRawPortFieldUnsafe.ts +12 -0
- package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPort.ts +183 -0
- package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdAndAccess.ts +29 -0
- package/src/internal/mutablePropertyTools/matchMutablePortProperty/matchMutablePortPropertyByPortIdInContext.ts +86 -0
- package/src/internal/parsing.ts +219 -0
- package/src/internal/util.ts +152 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import * as EMIDIPort from "./EMIDIPort.js";
|
|
3
|
+
// NOTE: stacks are properly extracted from error instances into structs, while
|
|
4
|
+
// decoding
|
|
5
|
+
const PortId = Schema.fromBrand(EMIDIPort.BothId)(Schema.NonEmptyTrimmedString);
|
|
6
|
+
const ErrorSchema = (nameSchema) => Schema.Struct({
|
|
7
|
+
name: (nameSchema ??
|
|
8
|
+
Schema.NonEmptyTrimmedString),
|
|
9
|
+
message: Schema.NonEmptyTrimmedString,
|
|
10
|
+
stack: Schema.NonEmptyTrimmedString.pipe(Schema.optionalWith({ exact: true })),
|
|
11
|
+
cause: Schema.Unknown.pipe(Schema.optionalWith({ exact: true })),
|
|
12
|
+
});
|
|
13
|
+
const midiAccessFailureFields = {
|
|
14
|
+
whileAskingForPermissions: Schema.Struct({
|
|
15
|
+
sysex: Schema.optional(Schema.Boolean),
|
|
16
|
+
software: Schema.optional(Schema.Boolean),
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Thrown if the document or page is going to be closed due to user navigation.
|
|
21
|
+
*
|
|
22
|
+
* Wraps `DOMException { name: 'AbortError' }`
|
|
23
|
+
*
|
|
24
|
+
* @see {@link https://webidl.spec.whatwg.org/#aborterror|Web IDL spec}
|
|
25
|
+
*/
|
|
26
|
+
export class AbortError extends Schema.TaggedError()('AbortError', {
|
|
27
|
+
cause: ErrorSchema(Schema.Literal('AbortError')),
|
|
28
|
+
}) {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Thrown if the underlying system raises any errors when trying to open the
|
|
32
|
+
* port.
|
|
33
|
+
*
|
|
34
|
+
* Wraps `DOMException { name: 'InvalidStateError' }`
|
|
35
|
+
*
|
|
36
|
+
* @see {@link https://webidl.spec.whatwg.org/#invalidstateerror|Web IDL spec}
|
|
37
|
+
*/
|
|
38
|
+
export class UnderlyingSystemError extends Schema.TaggedError()('UnderlyingSystemError', {
|
|
39
|
+
cause: ErrorSchema(Schema.Literal('InvalidStateError')),
|
|
40
|
+
...midiAccessFailureFields,
|
|
41
|
+
}) {
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Thrown if the MIDI API, or a certain configuration of it is not supported by
|
|
45
|
+
* the system.
|
|
46
|
+
*
|
|
47
|
+
* Wraps `ReferenceError | TypeError | DOMException { name: 'NotSupportedError' }`
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://webidl.spec.whatwg.org/#notsupportederror|Web IDL spec}
|
|
50
|
+
*/
|
|
51
|
+
export class MIDIAccessNotSupportedError extends Schema.TaggedError()('MIDIAccessNotSupportedError', {
|
|
52
|
+
cause: ErrorSchema(Schema.Literal('ReferenceError', 'TypeError', 'NotSupportedError')),
|
|
53
|
+
...midiAccessFailureFields,
|
|
54
|
+
}) {
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Thrown on platforms where `.clear()` method of output ports is not supported
|
|
58
|
+
* (currently supported only in Firefox)
|
|
59
|
+
*
|
|
60
|
+
* Wraps `TypeError | DOMException { name: 'NotSupportedError' }`
|
|
61
|
+
*
|
|
62
|
+
* @see {@link https://webidl.spec.whatwg.org/#notsupportederror|Web IDL spec}
|
|
63
|
+
*/
|
|
64
|
+
export class ClearingSendingQueueIsNotSupportedError extends Schema.TaggedError()('ClearingSendingQueueIsNotSupportedError', {
|
|
65
|
+
cause: ErrorSchema(Schema.Literal('TypeError', 'NotSupportedError')),
|
|
66
|
+
portId: PortId,
|
|
67
|
+
}) {
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Thrown when attempt to open the port failed because it is unavailable (e.g.
|
|
71
|
+
* is already in use by another process and cannot be opened, or is
|
|
72
|
+
* disconnected).
|
|
73
|
+
*
|
|
74
|
+
* Wraps `DOMException { name: 'InvalidAccessError' | 'NotAllowedError' | 'InvalidStateError' }`
|
|
75
|
+
*
|
|
76
|
+
* @see Web IDL specs: {@link https://webidl.spec.whatwg.org/#invalidaccesserror|InvalidAccessError}, {@link https://webidl.spec.whatwg.org/#notallowederror|NotAllowedError}, {@link https://webidl.spec.whatwg.org/#invalidstateerror|InvalidStateError}
|
|
77
|
+
*/
|
|
78
|
+
export class UnavailablePortError extends Schema.TaggedError()('UnavailablePortError', {
|
|
79
|
+
cause: ErrorSchema(Schema.Literal('InvalidAccessError', 'NotAllowedError', 'InvalidStateError')),
|
|
80
|
+
portId: PortId,
|
|
81
|
+
}) {
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Thrown when `.send` operation was called on a disconnected port.
|
|
85
|
+
*
|
|
86
|
+
* Wraps `DOMException { name: 'InvalidStateError' }`
|
|
87
|
+
*
|
|
88
|
+
* @see {@link https://webidl.spec.whatwg.org/#invalidaccesserror|Web IDL spec}
|
|
89
|
+
*/
|
|
90
|
+
export class DisconnectedPortError extends Schema.TaggedError()('DisconnectedPortError', {
|
|
91
|
+
cause: ErrorSchema(Schema.Literal('InvalidStateError')),
|
|
92
|
+
portId: PortId,
|
|
93
|
+
}) {
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Thrown when trying to send system exclusive message from the access handle,
|
|
97
|
+
* that doesn't have this permission
|
|
98
|
+
*
|
|
99
|
+
* Wraps `DOMException { name: 'InvalidAccessError' | 'NotAllowedError' }`
|
|
100
|
+
*
|
|
101
|
+
* @see Web IDL specs: {@link https://webidl.spec.whatwg.org/#invalidaccesserror|InvalidAccessError}, {@link https://webidl.spec.whatwg.org/#notallowederror|NotAllowedError}
|
|
102
|
+
*/
|
|
103
|
+
export class CantSendSysexMessagesError extends Schema.TaggedError()('CantSendSysexMessagesError', {
|
|
104
|
+
cause: ErrorSchema(Schema.Literal('InvalidAccessError', 'NotAllowedError')),
|
|
105
|
+
portId: PortId,
|
|
106
|
+
}) {
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Thrown if the user, the system or their security settings denied the
|
|
110
|
+
* application from creating an {@linkcode EMIDIAccess.EMIDIAccessInstance} object
|
|
111
|
+
* with the requested {@linkcode EMIDIAccess.RequestMIDIAccessOptions|options}, or if the
|
|
112
|
+
* document is not allowed to use the feature (for example, because of a
|
|
113
|
+
* Permission Policy, or because the user previously denied a permission
|
|
114
|
+
* request).
|
|
115
|
+
*
|
|
116
|
+
* Wraps `DOMException { name: 'NotAllowedError' | 'SecurityError' }`
|
|
117
|
+
*
|
|
118
|
+
* @see Web IDL specs: {@link https://webidl.spec.whatwg.org/#notallowederror|NotAllowedError}, {@link https://webidl.spec.whatwg.org/#securityerror|SecurityError}
|
|
119
|
+
*/
|
|
120
|
+
export class MIDIAccessNotAllowedError extends Schema.TaggedError()('MIDIAccessNotAllowedError', {
|
|
121
|
+
cause: ErrorSchema(Schema.Literal('NotAllowedError', 'SecurityError')),
|
|
122
|
+
...midiAccessFailureFields,
|
|
123
|
+
}) {
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Thrown when data to be sent is not a valid sequence or does not contain a
|
|
127
|
+
* valid MIDI message
|
|
128
|
+
*
|
|
129
|
+
* Wraps `TypeError`
|
|
130
|
+
*/
|
|
131
|
+
export class MalformedMidiMessageError extends Schema.TaggedError()('MalformedMidiMessageError', {
|
|
132
|
+
cause: ErrorSchema(Schema.Literal('TypeError')),
|
|
133
|
+
portId: PortId,
|
|
134
|
+
midiMessage: Schema.Array(Schema.Int),
|
|
135
|
+
}) {
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Keep in mind that if port isn't found, it might not mean it's disconnected.
|
|
139
|
+
* For example, virtual ports created by software won't show up in the list of
|
|
140
|
+
* available inputs/outputs of MIDI Access handle with disabled
|
|
141
|
+
* {@linkcode EMIDIAccess.RequestMIDIAccessOptions.software} flag.
|
|
142
|
+
*/
|
|
143
|
+
export class PortNotFoundError extends Schema.TaggedError()('PortNotFound', { portId: PortId }) {
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
export const remapErrorByName =
|
|
150
|
+
// biome-ignore lint/suspicious/noExplicitAny: I don't care
|
|
151
|
+
(map, absurdMessage, rest) => (cause) => {
|
|
152
|
+
if (!(cause instanceof Error && cause.name in map))
|
|
153
|
+
throw new Error(absurdMessage);
|
|
154
|
+
// biome-ignore lint/style/noNonNullAssertion: Because we checked it above with `cause.name in map`
|
|
155
|
+
const Class = map[cause.name];
|
|
156
|
+
return new Class({
|
|
157
|
+
cause,
|
|
158
|
+
...rest,
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/internal/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KA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B,SAAQ,MAAM,CAAC,WAAW,EAA6B,CAC5F,2BAA2B,EAC3B;IACE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;IACtE,GAAG,uBAAuB;CAC3B,CACF;CAAG;AAEJ;;;;;GAKG;AACH,MAAM,OAAO,yBAA0B,SAAQ,MAAM,CAAC,WAAW,EAA6B,CAC5F,2BAA2B,EAC3B;IACE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;CACtC,CACF;CAAG;AAEJ;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,EAAqB,CAC5E,cAAc,EACd,EAAE,MAAM,EAAE,MAAM,EAAE,CACnB;CAAG;AAEJ;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB;AAC3B,2DAA2D;AACzD,CACE,GAAyC,EACzC,aAAqB,EACrB,IAMC,EACD,EAAE,CACJ,CAAC,KAAc,EAAE,EAAE;IACjB,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;IAChC,mGAAmG;IACnG,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAE,CAAA;IAC9B,OAAO,IAAI,KAAK,CAAC;QACf,KAAK;QACL,GAAG,IAAI;KACR,CAAmC,CAAA;AACtC,CAAC,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 Effect from 'effect/Effect';
|
|
4
|
+
import * as EFunction from 'effect/Function';
|
|
5
|
+
import * as EMIDIAccess from "../EMIDIAccess.js";
|
|
6
|
+
import * as EMIDIInput from "../EMIDIInput.js";
|
|
7
|
+
import * as EMIDIOutput from "../EMIDIOutput.js";
|
|
8
|
+
import * as Errors from "../errors.js";
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
const getPortByIdAndRemap = (handlers) => EFunction.dual(2, (polymorphicAccess, portId) => Effect.flatMap(EMIDIAccess.resolve(polymorphicAccess), e => {
|
|
14
|
+
const rawAccess = EMIDIAccess.assumeImpl(e)._access;
|
|
15
|
+
let rawPort = rawAccess.inputs.get(portId);
|
|
16
|
+
if (rawPort)
|
|
17
|
+
return handlers.onInputFound(rawPort);
|
|
18
|
+
rawPort = rawAccess.outputs.get(portId);
|
|
19
|
+
if (rawPort)
|
|
20
|
+
return handlers.onOutputFound(rawPort);
|
|
21
|
+
return new Errors.PortNotFoundError({
|
|
22
|
+
portId,
|
|
23
|
+
});
|
|
24
|
+
}));
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* If you want to ensure the type of returned port match the type of ID, use
|
|
28
|
+
* type-specific getters {@linkcode getInputByPortIdAndAccess} and
|
|
29
|
+
* {@linkcode getOutputByPortIdAndAccess}, because in runtime, these branded
|
|
30
|
+
* port IDs passed as function arguments, are just strings and cannot ensure
|
|
31
|
+
* soundness
|
|
32
|
+
*/
|
|
33
|
+
export const getPortByPortIdAndAccess = getPortByIdAndRemap({
|
|
34
|
+
onInputFound: EFunction.flow(EMIDIInput.make, Effect.succeed),
|
|
35
|
+
onOutputFound: EFunction.flow(EMIDIOutput.make, Effect.succeed),
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
export const getInputByPortIdAndAccess = getPortByIdAndRemap({
|
|
42
|
+
onInputFound: EFunction.flow(EMIDIInput.make, Effect.succeed),
|
|
43
|
+
onOutputFound: rawOutput => Effect.dieMessage(`Assertion failed: getInputById found output port with the id=${rawOutput.id}`),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
export const getOutputByPortIdAndAccess = getPortByIdAndRemap({
|
|
50
|
+
onInputFound: rawInput => Effect.dieMessage(`Assertion failed: getOutputById found output port with the id=${rawInput.id}`),
|
|
51
|
+
onOutputFound: EFunction.flow(EMIDIOutput.make, Effect.succeed),
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=getPortByPortIdAndAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPortByPortIdAndAccess.js","sourceRoot":"","sources":["../../../../src/internal/getPortByPortId/getPortByPortIdAndAccess.ts"],"names":[],"mappings":"AAAA;gEACgE;AAEhE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAEhD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAEtC;;;GAGG;AACH,MAAM,mBAAmB,GAAG,CAO1B,QAOD,EAOC,EAAE,CACF,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,EAAE,CAC9C,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE;IACzD,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAEnD,IAAI,OAAO,GACT,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAE9B,IAAI,OAAO;QAAE,OAAO,QAAQ,CAAC,YAAY,C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
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export const getPortByPortIdInContext = (id) => Get.getPortByPortIdAndAccess(EMIDIAccess.EMIDIAccess, id);
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export const getInputByPortIdInContext = (id) => Get.getInputByPortIdAndAccess(EMIDIAccess.EMIDIAccess, id);
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export const getOutputByPortIdInContext = (id) => Get.getOutputByPortIdAndAccess(EMIDIAccess.EMIDIAccess, id);
|
|
18
|
+
//# sourceMappingURL=getPortByPortIdInContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPortByPortIdInContext.js","sourceRoot":"","sources":["../../../../src/internal/getPortByPortId/getPortByPortIdInContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAIhD,OAAO,KAAK,GAAG,MAAM,+BAA+B,CAAA;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EAAoB,EAAE,EAAE,CAC/D,GAAG,CAAC,wBAAwB,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAE3D;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EAAiB,EAAE,EAAE,CAC7D,GAAG,CAAC,yBAAyB,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,EAAkB,EAAE,EAAE,CAC/D,GAAG,CAAC,0BAA0B,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 EMIDIInput from "../EMIDIInput.js";
|
|
4
|
+
import * as EMIDIOutput from "../EMIDIOutput.js";
|
|
5
|
+
import * as EMIDIPort from "../EMIDIPort.js";
|
|
6
|
+
import * as StreamMaker from "../StreamMaker.js";
|
|
7
|
+
import * as Util from "../util.js";
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
const makePortStateChangesStreamFactory = (is) => StreamMaker.createStreamMakerFrom()(is, port => ({
|
|
13
|
+
tag: 'MIDIPortStateChange',
|
|
14
|
+
eventListener: {
|
|
15
|
+
target: EMIDIPort.assumeImpl(port)._port,
|
|
16
|
+
type: 'statechange',
|
|
17
|
+
},
|
|
18
|
+
spanAttributes: {
|
|
19
|
+
spanTargetName: 'MIDI port',
|
|
20
|
+
port: Util.getStaticMIDIPortInfo(port),
|
|
21
|
+
},
|
|
22
|
+
nullableFieldName: 'port',
|
|
23
|
+
}), rawPort => ({
|
|
24
|
+
newState: rawPort
|
|
25
|
+
? {
|
|
26
|
+
ofDevice: rawPort.state,
|
|
27
|
+
ofConnection: rawPort.connection,
|
|
28
|
+
}
|
|
29
|
+
: null,
|
|
30
|
+
}));
|
|
31
|
+
/**
|
|
32
|
+
* Function to create a stream of remapped {@linkcode MIDIConnectionEvent}s
|
|
33
|
+
*
|
|
34
|
+
* [MDN
|
|
35
|
+
* Reference](https://developer.mozilla.org/docs/Web/API/MIDIConnectionEvent)
|
|
36
|
+
*/
|
|
37
|
+
export const makePortStateChangesStreamByPort = makePortStateChangesStreamFactory(EMIDIPort.is);
|
|
38
|
+
/**
|
|
39
|
+
* Function to create a stream of remapped {@linkcode MIDIConnectionEvent}s
|
|
40
|
+
*
|
|
41
|
+
* [MDN
|
|
42
|
+
* Reference](https://developer.mozilla.org/docs/Web/API/MIDIConnectionEvent)
|
|
43
|
+
*/
|
|
44
|
+
export const makeInputStateChangesStreamByPort = makePortStateChangesStreamFactory(EMIDIInput.is);
|
|
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 makeOutputStateChangesStreamByPort = makePortStateChangesStreamFactory(EMIDIOutput.is);
|
|
52
|
+
//# sourceMappingURL=makePortStateChangesStreamByPort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makePortStateChangesStreamByPort.js","sourceRoot":"","sources":["../../../../src/internal/makePortStateChangesStream/makePortStateChangesStreamByPort.ts"],"names":[],"mappings":"AAAA;gEACgE;AAEhE,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,IAAI,MAAM,YAAY,CAAA;AAElC;;;GAGG;AACH,MAAM,iCAAiC,GAAG,CAGxC,EAAsE,EACtE,EAAE,CACF,WAAW,CAAC,qBAAqB,EAAoB,CACnD,EAAE,EACF,IAAI,CAAC,EAAE,CAAC,CAAC;IACP,GAAG,EAAE,qBAAqB;IAC1B,aAAa,EAAE;QACb,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK;QACxC,IAAI,EAAE,aAAa;KACpB;IACD,cAAc,EAAE;QACd,cAAc,EAAE,WAAW;QAC3B,IAAI,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;KACvC;IACD,iBAAiB,EAAE,MAAM;CAC1B,CAAC,EACF,OAAO,CAAC,EAAE,CACR,CAAC;IACC,QAAQ,EAAE,OAAO;QACf,CAAC,CAAE;YACC,QAAQ,EAAE,OAAO,CAAC,KAAK;YACvB,YAAY,EAAE,OAAO,CAAC,UAAU;SACvB;QACb,CAAC,CAAC,IAAI;CACT,CAAU,CAEoC,CAAA;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAC3C,iCAAiC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAC5C,iCAAiC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,iCAAiC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA"}
|
package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// TODO: makeInputStateChangesStreamByPortIdAndAccess
|
|
2
|
+
export const makeInputStateChangesStreamByPortIdAndAccess = () => {
|
|
3
|
+
throw new Error('not implemented');
|
|
4
|
+
};
|
|
5
|
+
// TODO: makeOutputStateChangesStreamByPortIdAndAccess
|
|
6
|
+
export const makeOutputStateChangesStreamByPortIdAndAccess = () => {
|
|
7
|
+
throw new Error('not implemented');
|
|
8
|
+
};
|
|
9
|
+
// TODO: makePortStateChangesStreamByPortIdAndAccess
|
|
10
|
+
export const makePortStateChangesStreamByPortIdAndAccess = () => {
|
|
11
|
+
throw new Error('not implemented');
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=makePortStateChangesStreamByPortIdAndAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makePortStateChangesStreamByPortIdAndAccess.js","sourceRoot":"","sources":["../../../../src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdAndAccess.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,MAAM,CAAC,MAAM,4CAA4C,GAAG,GAAG,EAAE;IAC/D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,6CAA6C,GAAG,GAAG,EAAE;IAChE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,oDAAoD;AACpD,MAAM,CAAC,MAAM,2CAA2C,GAAG,GAAG,EAAE;IAC9D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA"}
|
package/dist/src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Get from "../getPortByPortId/getPortByPortIdInContext.js";
|
|
2
|
+
import * as Make from "./makePortStateChangesStreamByPort.js";
|
|
3
|
+
/**
|
|
4
|
+
* @param options Passing a value of a `boolean` type is equivalent to setting
|
|
5
|
+
* `options.capture` property
|
|
6
|
+
*/
|
|
7
|
+
export const makePortStateChangesStreamByPortIdInContext = (id, options) => Make.makePortStateChangesStreamByPort(Get.getPortByPortIdInContext(id), options);
|
|
8
|
+
/**
|
|
9
|
+
* @param options Passing a value of a `boolean` type is equivalent to setting
|
|
10
|
+
* `options.capture` property
|
|
11
|
+
*/
|
|
12
|
+
export const makeInputStateChangesStreamByPortIdInContext = (id, options) => Make.makeInputStateChangesStreamByPort(Get.getInputByPortIdInContext(id), options);
|
|
13
|
+
/**
|
|
14
|
+
* @param options Passing a value of a `boolean` type is equivalent to setting
|
|
15
|
+
* `options.capture` property
|
|
16
|
+
*/
|
|
17
|
+
export const makeOutputStateChangesStreamByPortIdInContext = (id, options) => Make.makeOutputStateChangesStreamByPort(Get.getOutputByPortIdInContext(id), options);
|
|
18
|
+
//# sourceMappingURL=makePortStateChangesStreamByPortIdInContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makePortStateChangesStreamByPortIdInContext.js","sourceRoot":"","sources":["../../../../src/internal/makePortStateChangesStream/makePortStateChangesStreamByPortIdInContext.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,GAAG,MAAM,gDAAgD,CAAA;AAErE,OAAO,KAAK,IAAI,MAAM,uCAAuC,CAAA;AAE7D;;;GAGG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAGzD,EAAoB,EACpB,OAAyD,EACzD,EAAE,CACF,IAAI,CAAC,gCAAgC,CACnC,GAAG,CAAC,wBAAwB,CAAC,EAAE,CAAC,EAChC,OAAO,CACR,CAAA;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,4CAA4C,GAAG,CAG1D,EAAiB,EACjB,OAAyD,EACzD,EAAE,CACF,IAAI,CAAC,iCAAiC,CACpC,GAAG,CAAC,yBAAyB,CAAC,EAAE,CAAC,EACjC,OAAO,CACR,CAAA;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,6CAA6C,GAAG,CAG3D,EAAkB,EAClB,OAAyD,EACzD,EAAE,CACF,IAAI,CAAC,kCAAkC,CACrC,GAAG,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAClC,OAAO,CACR,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as EFunction from 'effect/Function';
|
|
2
|
+
import * as Util from "../../util.js";
|
|
3
|
+
import * as Get from "../getMutablePortProperty/getMutablePortPropertyByPort.js";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export const isPortDeviceConnectedByPort = EFunction.flow(Get.getPortDeviceStateByPort, Util.isDeviceConnected);
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export const isPortDeviceDisconnectedByPort = EFunction.flow(Get.getPortDeviceStateByPort, Util.isDeviceDisconnected);
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export const isPortConnectionOpenByPort = EFunction.flow(Get.getPortConnectionStateByPort, Util.isConnectionOpen);
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export const isPortConnectionPendingByPort = EFunction.flow(Get.getPortConnectionStateByPort, Util.isConnectionPending);
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export const isPortConnectionClosedByPort = EFunction.flow(Get.getPortConnectionStateByPort, Util.isConnectionClosed);
|
|
24
|
+
//////////////////////////////
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export const isInputDeviceConnectedByPort = EFunction.flow(Get.getInputDeviceStateByPort, Util.isDeviceConnected);
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export const isInputDeviceDisconnectedByPort = EFunction.flow(Get.getInputDeviceStateByPort, Util.isDeviceDisconnected);
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export const isInputConnectionOpenByPort = EFunction.flow(Get.getInputConnectionStateByPort, Util.isConnectionOpen);
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
export const isInputConnectionPendingByPort = EFunction.flow(Get.getInputConnectionStateByPort, Util.isConnectionPending);
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
export const isInputConnectionClosedByPort = EFunction.flow(Get.getInputConnectionStateByPort, Util.isConnectionClosed);
|
|
45
|
+
//////////////////////////////
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
export const isOutputDeviceConnectedByPort = EFunction.flow(Get.getOutputDeviceStateByPort, Util.isDeviceConnected);
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
export const isOutputDeviceDisconnectedByPort = EFunction.flow(Get.getOutputDeviceStateByPort, Util.isDeviceDisconnected);
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
export const isOutputConnectionOpenByPort = EFunction.flow(Get.getOutputConnectionStateByPort, Util.isConnectionOpen);
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
export const isOutputConnectionPendingByPort = EFunction.flow(Get.getOutputConnectionStateByPort, Util.isConnectionPending);
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
export const isOutputConnectionClosedByPort = EFunction.flow(Get.getOutputConnectionStateByPort, Util.isConnectionClosed);
|
|
66
|
+
//# sourceMappingURL=doesMutablePortPropertyHaveSpecificValueByPort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doesMutablePortPropertyHaveSpecificValueByPort.js","sourceRoot":"","sources":["../../../../../src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,2DAA2D,CAAA;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC,IAAI,CACvD,GAAG,CAAC,wBAAwB,EAC5B,IAAI,CAAC,iBAAiB,CACvB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAS,CAAC,IAAI,CAC1D,GAAG,CAAC,wBAAwB,EAC5B,IAAI,CAAC,oBAAoB,CAC1B,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,SAAS,CAAC,IAAI,CACtD,GAAG,CAAC,4BAA4B,EAChC,IAAI,CAAC,gBAAgB,CACtB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,SAAS,CAAC,IAAI,CACzD,GAAG,CAAC,4BAA4B,EAChC,IAAI,CAAC,mBAAmB,CACzB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC,IAAI,CACxD,GAAG,CAAC,4BAA4B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8B,EAClC,IAAI,CAAC,mBAAmB,CACzB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAS,CAAC,IAAI,CAC1D,GAAG,CAAC,8BAA8B,EAClC,IAAI,CAAC,kBAAkB,CACxB,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// TODO: isInputConnectionClosedByPortIdAndAccess
|
|
2
|
+
export const isInputConnectionClosedByPortIdAndAccess = () => {
|
|
3
|
+
throw new Error('not implemented');
|
|
4
|
+
};
|
|
5
|
+
// TODO: isInputConnectionOpenByPortIdAndAccess
|
|
6
|
+
export const isInputConnectionOpenByPortIdAndAccess = () => {
|
|
7
|
+
throw new Error('not implemented');
|
|
8
|
+
};
|
|
9
|
+
// TODO: isInputConnectionPendingByPortIdAndAccess
|
|
10
|
+
export const isInputConnectionPendingByPortIdAndAccess = () => {
|
|
11
|
+
throw new Error('not implemented');
|
|
12
|
+
};
|
|
13
|
+
// TODO: isInputDeviceConnectedByPortIdAndAccess
|
|
14
|
+
export const isInputDeviceConnectedByPortIdAndAccess = () => {
|
|
15
|
+
throw new Error('not implemented');
|
|
16
|
+
};
|
|
17
|
+
// TODO: isInputDeviceDisconnectedByPortIdAndAccess
|
|
18
|
+
export const isInputDeviceDisconnectedByPortIdAndAccess = () => {
|
|
19
|
+
throw new Error('not implemented');
|
|
20
|
+
};
|
|
21
|
+
// TODO: isOutputConnectionClosedByPortIdAndAccess
|
|
22
|
+
export const isOutputConnectionClosedByPortIdAndAccess = () => {
|
|
23
|
+
throw new Error('not implemented');
|
|
24
|
+
};
|
|
25
|
+
// TODO: isOutputConnectionOpenByPortIdAndAccess
|
|
26
|
+
export const isOutputConnectionOpenByPortIdAndAccess = () => {
|
|
27
|
+
throw new Error('not implemented');
|
|
28
|
+
};
|
|
29
|
+
// TODO: isOutputConnectionPendingByPortIdAndAccess
|
|
30
|
+
export const isOutputConnectionPendingByPortIdAndAccess = () => {
|
|
31
|
+
throw new Error('not implemented');
|
|
32
|
+
};
|
|
33
|
+
// TODO: isOutputDeviceConnectedByPortIdAndAccess
|
|
34
|
+
export const isOutputDeviceConnectedByPortIdAndAccess = () => {
|
|
35
|
+
throw new Error('not implemented');
|
|
36
|
+
};
|
|
37
|
+
// TODO: isOutputDeviceDisconnectedByPortIdAndAccess
|
|
38
|
+
export const isOutputDeviceDisconnectedByPortIdAndAccess = () => {
|
|
39
|
+
throw new Error('not implemented');
|
|
40
|
+
};
|
|
41
|
+
// TODO: isPortConnectionClosedByPortIdAndAccess
|
|
42
|
+
export const isPortConnectionClosedByPortIdAndAccess = () => {
|
|
43
|
+
throw new Error('not implemented');
|
|
44
|
+
};
|
|
45
|
+
// TODO: isPortConnectionOpenByPortIdAndAccess
|
|
46
|
+
export const isPortConnectionOpenByPortIdAndAccess = () => {
|
|
47
|
+
throw new Error('not implemented');
|
|
48
|
+
};
|
|
49
|
+
// TODO: isPortConnectionPendingByPortIdAndAccess
|
|
50
|
+
export const isPortConnectionPendingByPortIdAndAccess = () => {
|
|
51
|
+
throw new Error('not implemented');
|
|
52
|
+
};
|
|
53
|
+
// TODO: isPortDeviceConnectedByPortIdAndAccess
|
|
54
|
+
export const isPortDeviceConnectedByPortIdAndAccess = () => {
|
|
55
|
+
throw new Error('not implemented');
|
|
56
|
+
};
|
|
57
|
+
// TODO: isPortDeviceDisconnectedByPortIdAndAccess
|
|
58
|
+
export const isPortDeviceDisconnectedByPortIdAndAccess = () => {
|
|
59
|
+
throw new Error('not implemented');
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.js","sourceRoot":"","sources":["../../../../../src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdAndAccess.ts"],"names":[],"mappings":"AAAA,iDAAi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A2C,GAAG,GAAG,EAAE;IAC9D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,gDAAgD;AAChD,MAAM,CAAC,MAAM,uCAAuC,GAAG,GAAG,EAAE;IAC1D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,8CAA8C;AAC9C,MAAM,CAAC,MAAM,qCAAqC,GAAG,GAAG,EAAE;IACxD,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,wCAAwC,GAAG,GAAG,EAAE;IAC3D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,+CAA+C;AAC/C,MAAM,CAAC,MAAM,sCAAsC,GAAG,GAAG,EAAE;IACzD,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,kDAAkD;AAClD,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAAG,EAAE;IAC5D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// TODO: isInputConnectionClosedByPortIdInContext
|
|
2
|
+
export const isInputConnectionClosedByPortIdInContext = () => {
|
|
3
|
+
throw new Error('not implemented');
|
|
4
|
+
};
|
|
5
|
+
// TODO: isInputConnectionOpenByPortIdInContext
|
|
6
|
+
export const isInputConnectionOpenByPortIdInContext = () => {
|
|
7
|
+
throw new Error('not implemented');
|
|
8
|
+
};
|
|
9
|
+
// TODO: isInputConnectionPendingByPortIdInContext
|
|
10
|
+
export const isInputConnectionPendingByPortIdInContext = () => {
|
|
11
|
+
throw new Error('not implemented');
|
|
12
|
+
};
|
|
13
|
+
// TODO: isInputDeviceConnectedByPortIdInContext
|
|
14
|
+
export const isInputDeviceConnectedByPortIdInContext = () => {
|
|
15
|
+
throw new Error('not implemented');
|
|
16
|
+
};
|
|
17
|
+
// TODO: isInputDeviceDisconnectedByPortIdInContext
|
|
18
|
+
export const isInputDeviceDisconnectedByPortIdInContext = () => {
|
|
19
|
+
throw new Error('not implemented');
|
|
20
|
+
};
|
|
21
|
+
// TODO: isOutputConnectionClosedByPortIdInContext
|
|
22
|
+
export const isOutputConnectionClosedByPortIdInContext = () => {
|
|
23
|
+
throw new Error('not implemented');
|
|
24
|
+
};
|
|
25
|
+
// TODO: isOutputConnectionOpenByPortIdInContext
|
|
26
|
+
export const isOutputConnectionOpenByPortIdInContext = () => {
|
|
27
|
+
throw new Error('not implemented');
|
|
28
|
+
};
|
|
29
|
+
// TODO: isOutputConnectionPendingByPortIdInContext
|
|
30
|
+
export const isOutputConnectionPendingByPortIdInContext = () => {
|
|
31
|
+
throw new Error('not implemented');
|
|
32
|
+
};
|
|
33
|
+
// TODO: isOutputDeviceConnectedByPortIdInContext
|
|
34
|
+
export const isOutputDeviceConnectedByPortIdInContext = () => {
|
|
35
|
+
throw new Error('not implemented');
|
|
36
|
+
};
|
|
37
|
+
// TODO: isOutputDeviceDisconnectedByPortIdInContext
|
|
38
|
+
export const isOutputDeviceDisconnectedByPortIdInContext = () => {
|
|
39
|
+
throw new Error('not implemented');
|
|
40
|
+
};
|
|
41
|
+
// TODO: isPortConnectionClosedByPortIdInContext
|
|
42
|
+
export const isPortConnectionClosedByPortIdInContext = () => {
|
|
43
|
+
throw new Error('not implemented');
|
|
44
|
+
};
|
|
45
|
+
// TODO: isPortConnectionOpenByPortIdInContext
|
|
46
|
+
export const isPortConnectionOpenByPortIdInContext = () => {
|
|
47
|
+
throw new Error('not implemented');
|
|
48
|
+
};
|
|
49
|
+
// TODO: isPortConnectionPendingByPortIdInContext
|
|
50
|
+
export const isPortConnectionPendingByPortIdInContext = () => {
|
|
51
|
+
throw new Error('not implemented');
|
|
52
|
+
};
|
|
53
|
+
// TODO: isPortDeviceConnectedByPortIdInContext
|
|
54
|
+
export const isPortDeviceConnectedByPortIdInContext = () => {
|
|
55
|
+
throw new Error('not implemented');
|
|
56
|
+
};
|
|
57
|
+
// TODO: isPortDeviceDisconnectedByPortIdInContext
|
|
58
|
+
export const isPortDeviceDisconnectedByPortIdInContext = () => {
|
|
59
|
+
throw new Error('not implemented');
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=doesMutablePortPropertyHaveSpecificValueByPortIdInContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doesMutablePortPropertyHaveSpecificValueByPortIdInContext.js","sourceRoot":"","sources":["../../../../../src/internal/mutablePropertyTools/doesMutablePortPropertyHaveSpecificValue/doesMutablePortPropertyHaveSpecificValueByPortIdInContext.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,CAAC,MAAM,wCAAwC,GAAG,GAAG,EAAE;IAC3D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,+CAA+C;AAC/C,MAAM,CAAC,MAAM,sCAAsC,GAAG,GAAG,EAAE;IACzD,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,kDAAkD;AAClD,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAAG,EAAE;IAC5D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,gDAAgD;AAChD,MAAM,CAAC,MAAM,uCAAuC,GAAG,GAAG,EAAE;IAC1D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,0CAA0C,GAAG,GAAG,EAAE;IAC7D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,kDAAkD;AAClD,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAAG,EAAE;IAC5D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iB,CAAC,CAAA;AACpC,CAAC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { getValueInRawPortFieldUnsafe } from "../getValueInRawPortFieldUnsafe.js";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
const getMutableProperty = () => (property) => (polymorphicPort) => Effect.isEffect(polymorphicPort)
|
|
7
|
+
? Effect.map(polymorphicPort, getValueInRawPortFieldUnsafe(property))
|
|
8
|
+
: Effect.sync(() => getValueInRawPortFieldUnsafe(property)(polymorphicPort));
|
|
9
|
+
/**
|
|
10
|
+
* @returns A state of the hardware connection between the OS and the device
|
|
11
|
+
* ({@linkcode MIDIPortDeviceState}). Because it can change over time, it's
|
|
12
|
+
* wrapped in effect. It's taken from the {@linkcode MIDIPort.state|state}
|
|
13
|
+
* read-only property of the {@linkcode MIDIPort} interface ([MDN
|
|
14
|
+
* Reference](https://developer.mozilla.org/docs/Web/API/MIDIPort/state)).
|
|
15
|
+
*/
|
|
16
|
+
export const getPortDeviceStateByPort = getMutableProperty()('state');
|
|
17
|
+
/**
|
|
18
|
+
* @returns A state of the connection between the browser's tab and OS
|
|
19
|
+
* abstraction of the device ({@linkcode MIDIPortConnectionState}). Because it
|
|
20
|
+
* can change over time, it's wrapped in effect. It's taken from the
|
|
21
|
+
* {@linkcode MIDIPort.connection|connection} read-only property of the
|
|
22
|
+
* {@linkcode MIDIPort} interface ([MDN
|
|
23
|
+
* Reference](https://developer.mozilla.org/docs/Web/API/MIDIPort/connection)).
|
|
24
|
+
*/
|
|
25
|
+
export const getPortConnectionStateByPort = getMutableProperty()('connection');
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
export const getInputDeviceStateByPort = getMutableProperty()('state');
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
export const getInputConnectionStateByPort = getMutableProperty()('connection');
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export const getOutputDeviceStateByPort = getMutableProperty()('state');
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
export const getOutputConnectionStateByPort = getMutableProperty()('connection');
|
|
42
|
+
//# sourceMappingURL=getMutablePortPropertyByPort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMutablePortPropertyByPort.js","sourceRoot":"","sources":["../../../../../src/internal/mutablePropertyTools/getMutablePortProperty/getMutablePortPropertyByPort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAA;AAGjF;;GAEG;AACH,MAAM,kBAAkB,GACtB,GAAuC,EAAE,CACzC,CACE,QAAkC,EAClC,EAAE,CACJ,CACE,eAA+D,EAC/D,EAAE,CACF,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;IAC9B,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CACf,4BAA4B,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CACxD,CAAA;AAET;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,EAAE,CAAC,OAAO,CAAC,CAAA;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAAkB,EAAE,CAAC,YAAY,CAAC,CAAA;AAE9E;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,EAAW,CAAC,OAAO,CAAC,CAAA;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,kBAAkB,EAAW,CAAC,YAAY,CAAC,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC,kBAAkB,EAAY,CAAC,OAAO,CAAC,CAAA;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GACzC,kBAAkB,EAAY,CAAC,YAAY,CAAC,CAAA"}
|