nerdbank-streams 2.10.37-alpha → 2.10.69
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/js/AcceptanceParameters.d.ts +4 -4
- package/js/AcceptanceParameters.js +2 -2
- package/js/Channel.d.ts +71 -70
- package/js/Channel.js +219 -219
- package/js/Channel.js.map +1 -1
- package/js/ChannelOptions.d.ts +4 -4
- package/js/ChannelOptions.js +2 -2
- package/js/ControlCode.d.ts +30 -30
- package/js/ControlCode.js +34 -34
- package/js/ControlCode.js.map +1 -1
- package/js/Deferred.d.ts +39 -39
- package/js/Deferred.js +67 -67
- package/js/FrameHeader.d.ts +20 -20
- package/js/FrameHeader.js +39 -39
- package/js/FullDuplexStream.d.ts +10 -10
- package/js/FullDuplexStream.js +31 -31
- package/js/IChannelOfferEventArgs.d.ts +17 -17
- package/js/IChannelOfferEventArgs.js +2 -2
- package/js/IDisposableObservable.d.ts +4 -4
- package/js/IDisposableObservable.js +2 -2
- package/js/MultiplexingStream.d.ts +220 -218
- package/js/MultiplexingStream.js +624 -610
- package/js/MultiplexingStream.js.map +1 -1
- package/js/MultiplexingStreamFormatters.d.ts +90 -89
- package/js/MultiplexingStreamFormatters.js +302 -302
- package/js/MultiplexingStreamOptions.d.ts +18 -18
- package/js/MultiplexingStreamOptions.js +2 -2
- package/js/OfferParameters.d.ts +6 -6
- package/js/OfferParameters.js +2 -2
- package/js/QualifiedChannelId.d.ts +25 -25
- package/js/QualifiedChannelId.js +38 -38
- package/js/QualifiedChannelId.js.map +1 -1
- package/js/Utilities.d.ts +12 -11
- package/js/Utilities.js +154 -154
- package/js/index.d.ts +8 -8
- package/js/index.js +15 -15
- package/package.json +18 -18
- package/src/MultiplexingStream.ts +18 -1
package/js/ChannelOptions.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=ChannelOptions.js.map
|
package/js/ControlCode.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Signals what kind of frame is being transmitted.
|
|
3
|
-
*/
|
|
4
|
-
export declare enum ControlCode {
|
|
5
|
-
/**
|
|
6
|
-
* A channel is proposed to the remote party.
|
|
7
|
-
*/
|
|
8
|
-
offer = 0,
|
|
9
|
-
/**
|
|
10
|
-
* A channel proposal has been accepted.
|
|
11
|
-
*/
|
|
12
|
-
offerAccepted = 1,
|
|
13
|
-
/**
|
|
14
|
-
* The payload of the frame is a payload intended for channel consumption.
|
|
15
|
-
*/
|
|
16
|
-
content = 2,
|
|
17
|
-
/**
|
|
18
|
-
* Sent after all bytes have been transmitted on a given channel. Either or both sides may send this.
|
|
19
|
-
* A channel may be automatically closed when each side has both transmitted and received this message.
|
|
20
|
-
*/
|
|
21
|
-
contentWritingCompleted = 3,
|
|
22
|
-
/**
|
|
23
|
-
* Sent when a channel is closed, an incoming offer is rejected, or an outgoing offer is canceled.
|
|
24
|
-
*/
|
|
25
|
-
channelTerminated = 4,
|
|
26
|
-
/**
|
|
27
|
-
* Sent when a channel has finished processing data received from the remote party, allowing them to send more data.
|
|
28
|
-
*/
|
|
29
|
-
contentProcessed = 5
|
|
30
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Signals what kind of frame is being transmitted.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ControlCode {
|
|
5
|
+
/**
|
|
6
|
+
* A channel is proposed to the remote party.
|
|
7
|
+
*/
|
|
8
|
+
offer = 0,
|
|
9
|
+
/**
|
|
10
|
+
* A channel proposal has been accepted.
|
|
11
|
+
*/
|
|
12
|
+
offerAccepted = 1,
|
|
13
|
+
/**
|
|
14
|
+
* The payload of the frame is a payload intended for channel consumption.
|
|
15
|
+
*/
|
|
16
|
+
content = 2,
|
|
17
|
+
/**
|
|
18
|
+
* Sent after all bytes have been transmitted on a given channel. Either or both sides may send this.
|
|
19
|
+
* A channel may be automatically closed when each side has both transmitted and received this message.
|
|
20
|
+
*/
|
|
21
|
+
contentWritingCompleted = 3,
|
|
22
|
+
/**
|
|
23
|
+
* Sent when a channel is closed, an incoming offer is rejected, or an outgoing offer is canceled.
|
|
24
|
+
*/
|
|
25
|
+
channelTerminated = 4,
|
|
26
|
+
/**
|
|
27
|
+
* Sent when a channel has finished processing data received from the remote party, allowing them to send more data.
|
|
28
|
+
*/
|
|
29
|
+
contentProcessed = 5
|
|
30
|
+
}
|
package/js/ControlCode.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ControlCode = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Signals what kind of frame is being transmitted.
|
|
6
|
-
*/
|
|
7
|
-
var ControlCode;
|
|
8
|
-
(function (ControlCode) {
|
|
9
|
-
/**
|
|
10
|
-
* A channel is proposed to the remote party.
|
|
11
|
-
*/
|
|
12
|
-
ControlCode[ControlCode["offer"] = 0] = "offer";
|
|
13
|
-
/**
|
|
14
|
-
* A channel proposal has been accepted.
|
|
15
|
-
*/
|
|
16
|
-
ControlCode[ControlCode["offerAccepted"] = 1] = "offerAccepted";
|
|
17
|
-
/**
|
|
18
|
-
* The payload of the frame is a payload intended for channel consumption.
|
|
19
|
-
*/
|
|
20
|
-
ControlCode[ControlCode["content"] = 2] = "content";
|
|
21
|
-
/**
|
|
22
|
-
* Sent after all bytes have been transmitted on a given channel. Either or both sides may send this.
|
|
23
|
-
* A channel may be automatically closed when each side has both transmitted and received this message.
|
|
24
|
-
*/
|
|
25
|
-
ControlCode[ControlCode["contentWritingCompleted"] = 3] = "contentWritingCompleted";
|
|
26
|
-
/**
|
|
27
|
-
* Sent when a channel is closed, an incoming offer is rejected, or an outgoing offer is canceled.
|
|
28
|
-
*/
|
|
29
|
-
ControlCode[ControlCode["channelTerminated"] = 4] = "channelTerminated";
|
|
30
|
-
/**
|
|
31
|
-
* Sent when a channel has finished processing data received from the remote party, allowing them to send more data.
|
|
32
|
-
*/
|
|
33
|
-
ControlCode[ControlCode["contentProcessed"] = 5] = "contentProcessed";
|
|
34
|
-
})(ControlCode
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ControlCode = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Signals what kind of frame is being transmitted.
|
|
6
|
+
*/
|
|
7
|
+
var ControlCode;
|
|
8
|
+
(function (ControlCode) {
|
|
9
|
+
/**
|
|
10
|
+
* A channel is proposed to the remote party.
|
|
11
|
+
*/
|
|
12
|
+
ControlCode[ControlCode["offer"] = 0] = "offer";
|
|
13
|
+
/**
|
|
14
|
+
* A channel proposal has been accepted.
|
|
15
|
+
*/
|
|
16
|
+
ControlCode[ControlCode["offerAccepted"] = 1] = "offerAccepted";
|
|
17
|
+
/**
|
|
18
|
+
* The payload of the frame is a payload intended for channel consumption.
|
|
19
|
+
*/
|
|
20
|
+
ControlCode[ControlCode["content"] = 2] = "content";
|
|
21
|
+
/**
|
|
22
|
+
* Sent after all bytes have been transmitted on a given channel. Either or both sides may send this.
|
|
23
|
+
* A channel may be automatically closed when each side has both transmitted and received this message.
|
|
24
|
+
*/
|
|
25
|
+
ControlCode[ControlCode["contentWritingCompleted"] = 3] = "contentWritingCompleted";
|
|
26
|
+
/**
|
|
27
|
+
* Sent when a channel is closed, an incoming offer is rejected, or an outgoing offer is canceled.
|
|
28
|
+
*/
|
|
29
|
+
ControlCode[ControlCode["channelTerminated"] = 4] = "channelTerminated";
|
|
30
|
+
/**
|
|
31
|
+
* Sent when a channel has finished processing data received from the remote party, allowing them to send more data.
|
|
32
|
+
*/
|
|
33
|
+
ControlCode[ControlCode["contentProcessed"] = 5] = "contentProcessed";
|
|
34
|
+
})(ControlCode || (exports.ControlCode = ControlCode = {}));
|
|
35
35
|
//# sourceMappingURL=ControlCode.js.map
|
package/js/ControlCode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlCode.js","sourceRoot":"","sources":["../src/ControlCode.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,WA+BX;AA/BD,WAAY,WAAW;IACtB;;OAEG;IACH,+CAAK,CAAA;IAEL;;OAEG;IACH,+DAAa,CAAA;IAEb;;OAEG;IACH,mDAAO,CAAA;IAEP;;;OAGG;IACH,mFAAuB,CAAA;IAEvB;;OAEG;IACH,uEAAiB,CAAA;IAEjB;;OAEG;IACH,qEAAgB,CAAA;AACjB,CAAC,EA/BW,WAAW,
|
|
1
|
+
{"version":3,"file":"ControlCode.js","sourceRoot":"","sources":["../src/ControlCode.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,WA+BX;AA/BD,WAAY,WAAW;IACtB;;OAEG;IACH,+CAAK,CAAA;IAEL;;OAEG;IACH,+DAAa,CAAA;IAEb;;OAEG;IACH,mDAAO,CAAA;IAEP;;;OAGG;IACH,mFAAuB,CAAA;IAEvB;;OAEG;IACH,uEAAiB,CAAA;IAEjB;;OAEG;IACH,qEAAgB,CAAA;AACjB,CAAC,EA/BW,WAAW,2BAAX,WAAW,QA+BtB"}
|
package/js/Deferred.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A TaskCompletionSource-like class that allows promises to be resolved or rejected whenever.
|
|
3
|
-
*/
|
|
4
|
-
export declare class Deferred<T> {
|
|
5
|
-
state?: any;
|
|
6
|
-
readonly promise: Promise<T>;
|
|
7
|
-
private resolvePromise;
|
|
8
|
-
private rejectPromise;
|
|
9
|
-
private _isResolved;
|
|
10
|
-
private _isRejected;
|
|
11
|
-
private _error;
|
|
12
|
-
constructor(state?: any);
|
|
13
|
-
/**
|
|
14
|
-
* Gets a value indicating whether this promise has been completed.
|
|
15
|
-
*/
|
|
16
|
-
get isCompleted(): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Gets a value indicating whether this promise is resolved.
|
|
19
|
-
*/
|
|
20
|
-
get isResolved(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Gets a value indicating whether this promise is rejected.
|
|
23
|
-
*/
|
|
24
|
-
get isRejected(): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Gets the reason for promise rejection, if applicable.
|
|
27
|
-
*/
|
|
28
|
-
get error(): any;
|
|
29
|
-
/**
|
|
30
|
-
* Resolves the promise.
|
|
31
|
-
* @param value The result of the promise.
|
|
32
|
-
*/
|
|
33
|
-
resolve(value: T | PromiseLike<T>): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Rejects the promise.
|
|
36
|
-
* @param reason The reason for rejecting the promise.
|
|
37
|
-
*/
|
|
38
|
-
reject(reason?: any): boolean;
|
|
39
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* A TaskCompletionSource-like class that allows promises to be resolved or rejected whenever.
|
|
3
|
+
*/
|
|
4
|
+
export declare class Deferred<T> {
|
|
5
|
+
state?: any;
|
|
6
|
+
readonly promise: Promise<T>;
|
|
7
|
+
private resolvePromise;
|
|
8
|
+
private rejectPromise;
|
|
9
|
+
private _isResolved;
|
|
10
|
+
private _isRejected;
|
|
11
|
+
private _error;
|
|
12
|
+
constructor(state?: any);
|
|
13
|
+
/**
|
|
14
|
+
* Gets a value indicating whether this promise has been completed.
|
|
15
|
+
*/
|
|
16
|
+
get isCompleted(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Gets a value indicating whether this promise is resolved.
|
|
19
|
+
*/
|
|
20
|
+
get isResolved(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Gets a value indicating whether this promise is rejected.
|
|
23
|
+
*/
|
|
24
|
+
get isRejected(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the reason for promise rejection, if applicable.
|
|
27
|
+
*/
|
|
28
|
+
get error(): any;
|
|
29
|
+
/**
|
|
30
|
+
* Resolves the promise.
|
|
31
|
+
* @param value The result of the promise.
|
|
32
|
+
*/
|
|
33
|
+
resolve(value: T | PromiseLike<T>): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Rejects the promise.
|
|
36
|
+
* @param reason The reason for rejecting the promise.
|
|
37
|
+
*/
|
|
38
|
+
reject(reason?: any): boolean;
|
|
39
|
+
}
|
package/js/Deferred.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Deferred = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* A TaskCompletionSource-like class that allows promises to be resolved or rejected whenever.
|
|
6
|
-
*/
|
|
7
|
-
class Deferred {
|
|
8
|
-
constructor(state) {
|
|
9
|
-
this.state = state;
|
|
10
|
-
this._isResolved = false;
|
|
11
|
-
this._isRejected = false;
|
|
12
|
-
this.promise = new Promise((resolve, reject) => {
|
|
13
|
-
this.resolvePromise = resolve;
|
|
14
|
-
this.rejectPromise = reject;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Gets a value indicating whether this promise has been completed.
|
|
19
|
-
*/
|
|
20
|
-
get isCompleted() {
|
|
21
|
-
return this._isResolved || this._isRejected;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Gets a value indicating whether this promise is resolved.
|
|
25
|
-
*/
|
|
26
|
-
get isResolved() {
|
|
27
|
-
return this._isResolved;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Gets a value indicating whether this promise is rejected.
|
|
31
|
-
*/
|
|
32
|
-
get isRejected() {
|
|
33
|
-
return this._isRejected;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Gets the reason for promise rejection, if applicable.
|
|
37
|
-
*/
|
|
38
|
-
get error() {
|
|
39
|
-
return this._error;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Resolves the promise.
|
|
43
|
-
* @param value The result of the promise.
|
|
44
|
-
*/
|
|
45
|
-
resolve(value) {
|
|
46
|
-
if (this.isCompleted) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
this.resolvePromise(value);
|
|
50
|
-
this._isResolved = true;
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Rejects the promise.
|
|
55
|
-
* @param reason The reason for rejecting the promise.
|
|
56
|
-
*/
|
|
57
|
-
reject(reason) {
|
|
58
|
-
if (this.isCompleted) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
this.rejectPromise(reason);
|
|
62
|
-
this._error = reason;
|
|
63
|
-
this._isRejected = true;
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.Deferred = Deferred;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Deferred = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A TaskCompletionSource-like class that allows promises to be resolved or rejected whenever.
|
|
6
|
+
*/
|
|
7
|
+
class Deferred {
|
|
8
|
+
constructor(state) {
|
|
9
|
+
this.state = state;
|
|
10
|
+
this._isResolved = false;
|
|
11
|
+
this._isRejected = false;
|
|
12
|
+
this.promise = new Promise((resolve, reject) => {
|
|
13
|
+
this.resolvePromise = resolve;
|
|
14
|
+
this.rejectPromise = reject;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Gets a value indicating whether this promise has been completed.
|
|
19
|
+
*/
|
|
20
|
+
get isCompleted() {
|
|
21
|
+
return this._isResolved || this._isRejected;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Gets a value indicating whether this promise is resolved.
|
|
25
|
+
*/
|
|
26
|
+
get isResolved() {
|
|
27
|
+
return this._isResolved;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets a value indicating whether this promise is rejected.
|
|
31
|
+
*/
|
|
32
|
+
get isRejected() {
|
|
33
|
+
return this._isRejected;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Gets the reason for promise rejection, if applicable.
|
|
37
|
+
*/
|
|
38
|
+
get error() {
|
|
39
|
+
return this._error;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolves the promise.
|
|
43
|
+
* @param value The result of the promise.
|
|
44
|
+
*/
|
|
45
|
+
resolve(value) {
|
|
46
|
+
if (this.isCompleted) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
this.resolvePromise(value);
|
|
50
|
+
this._isResolved = true;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Rejects the promise.
|
|
55
|
+
* @param reason The reason for rejecting the promise.
|
|
56
|
+
*/
|
|
57
|
+
reject(reason) {
|
|
58
|
+
if (this.isCompleted) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
this.rejectPromise(reason);
|
|
62
|
+
this._error = reason;
|
|
63
|
+
this._isRejected = true;
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.Deferred = Deferred;
|
|
68
68
|
//# sourceMappingURL=Deferred.js.map
|
package/js/FrameHeader.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ControlCode } from './ControlCode';
|
|
2
|
-
import { QualifiedChannelId } from './QualifiedChannelId';
|
|
3
|
-
export declare class FrameHeader {
|
|
4
|
-
readonly code: ControlCode;
|
|
5
|
-
private _channel?;
|
|
6
|
-
/**
|
|
7
|
-
* Initializes a new instance of the `FrameHeader` class.
|
|
8
|
-
* @param code The kind of frame this is.
|
|
9
|
-
* @param channel The channel that this frame refers to or carries a payload for.
|
|
10
|
-
*/
|
|
11
|
-
constructor(code: ControlCode, channel?: QualifiedChannelId);
|
|
12
|
-
/** The channel that this frame refers to or carries a payload for. */
|
|
13
|
-
get channel(): QualifiedChannelId | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Gets the channel that this frame refers to or carries a payload for.
|
|
16
|
-
*/
|
|
17
|
-
get requiredChannel(): QualifiedChannelId;
|
|
18
|
-
/** Changes the channel.source property to reflect the opposite perspective (i.e. remote and local values switch). */
|
|
19
|
-
flipChannelPerspective(): void;
|
|
20
|
-
}
|
|
1
|
+
import { ControlCode } from './ControlCode';
|
|
2
|
+
import { QualifiedChannelId } from './QualifiedChannelId';
|
|
3
|
+
export declare class FrameHeader {
|
|
4
|
+
readonly code: ControlCode;
|
|
5
|
+
private _channel?;
|
|
6
|
+
/**
|
|
7
|
+
* Initializes a new instance of the `FrameHeader` class.
|
|
8
|
+
* @param code The kind of frame this is.
|
|
9
|
+
* @param channel The channel that this frame refers to or carries a payload for.
|
|
10
|
+
*/
|
|
11
|
+
constructor(code: ControlCode, channel?: QualifiedChannelId);
|
|
12
|
+
/** The channel that this frame refers to or carries a payload for. */
|
|
13
|
+
get channel(): QualifiedChannelId | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the channel that this frame refers to or carries a payload for.
|
|
16
|
+
*/
|
|
17
|
+
get requiredChannel(): QualifiedChannelId;
|
|
18
|
+
/** Changes the channel.source property to reflect the opposite perspective (i.e. remote and local values switch). */
|
|
19
|
+
flipChannelPerspective(): void;
|
|
20
|
+
}
|
package/js/FrameHeader.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FrameHeader = void 0;
|
|
4
|
-
const Utilities_1 = require("./Utilities");
|
|
5
|
-
class FrameHeader {
|
|
6
|
-
/**
|
|
7
|
-
* Initializes a new instance of the `FrameHeader` class.
|
|
8
|
-
* @param code The kind of frame this is.
|
|
9
|
-
* @param channel The channel that this frame refers to or carries a payload for.
|
|
10
|
-
*/
|
|
11
|
-
constructor(code, channel) {
|
|
12
|
-
this.code = code;
|
|
13
|
-
if (channel) {
|
|
14
|
-
(0, Utilities_1.requireInteger)('channelId', channel.id, 4, 'signed');
|
|
15
|
-
}
|
|
16
|
-
this.code = code;
|
|
17
|
-
this._channel = channel;
|
|
18
|
-
}
|
|
19
|
-
/** The channel that this frame refers to or carries a payload for. */
|
|
20
|
-
get channel() {
|
|
21
|
-
return this._channel;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Gets the channel that this frame refers to or carries a payload for.
|
|
25
|
-
*/
|
|
26
|
-
get requiredChannel() {
|
|
27
|
-
if (this.channel) {
|
|
28
|
-
return this.channel;
|
|
29
|
-
}
|
|
30
|
-
throw new Error('Expected channel not present in frame header.');
|
|
31
|
-
}
|
|
32
|
-
/** Changes the channel.source property to reflect the opposite perspective (i.e. remote and local values switch). */
|
|
33
|
-
flipChannelPerspective() {
|
|
34
|
-
if (this._channel) {
|
|
35
|
-
this._channel = { id: this._channel.id, source: this._channel.source * -1 };
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.FrameHeader = FrameHeader;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FrameHeader = void 0;
|
|
4
|
+
const Utilities_1 = require("./Utilities");
|
|
5
|
+
class FrameHeader {
|
|
6
|
+
/**
|
|
7
|
+
* Initializes a new instance of the `FrameHeader` class.
|
|
8
|
+
* @param code The kind of frame this is.
|
|
9
|
+
* @param channel The channel that this frame refers to or carries a payload for.
|
|
10
|
+
*/
|
|
11
|
+
constructor(code, channel) {
|
|
12
|
+
this.code = code;
|
|
13
|
+
if (channel) {
|
|
14
|
+
(0, Utilities_1.requireInteger)('channelId', channel.id, 4, 'signed');
|
|
15
|
+
}
|
|
16
|
+
this.code = code;
|
|
17
|
+
this._channel = channel;
|
|
18
|
+
}
|
|
19
|
+
/** The channel that this frame refers to or carries a payload for. */
|
|
20
|
+
get channel() {
|
|
21
|
+
return this._channel;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Gets the channel that this frame refers to or carries a payload for.
|
|
25
|
+
*/
|
|
26
|
+
get requiredChannel() {
|
|
27
|
+
if (this.channel) {
|
|
28
|
+
return this.channel;
|
|
29
|
+
}
|
|
30
|
+
throw new Error('Expected channel not present in frame header.');
|
|
31
|
+
}
|
|
32
|
+
/** Changes the channel.source property to reflect the opposite perspective (i.e. remote and local values switch). */
|
|
33
|
+
flipChannelPerspective() {
|
|
34
|
+
if (this._channel) {
|
|
35
|
+
this._channel = { id: this._channel.id, source: this._channel.source * -1 };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.FrameHeader = FrameHeader;
|
|
40
40
|
//# sourceMappingURL=FrameHeader.js.map
|
package/js/FullDuplexStream.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { Duplex } from 'stream';
|
|
4
|
-
export declare class FullDuplexStream {
|
|
5
|
-
static CreatePair(): {
|
|
6
|
-
first: Duplex;
|
|
7
|
-
second: Duplex;
|
|
8
|
-
};
|
|
9
|
-
static Splice(readable: NodeJS.ReadableStream, writable: NodeJS.WritableStream): Duplex;
|
|
10
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { Duplex } from 'stream';
|
|
4
|
+
export declare class FullDuplexStream {
|
|
5
|
+
static CreatePair(): {
|
|
6
|
+
first: Duplex;
|
|
7
|
+
second: Duplex;
|
|
8
|
+
};
|
|
9
|
+
static Splice(readable: NodeJS.ReadableStream, writable: NodeJS.WritableStream): Duplex;
|
|
10
|
+
}
|
package/js/FullDuplexStream.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FullDuplexStream = void 0;
|
|
4
|
-
const stream_1 = require("stream");
|
|
5
|
-
class FullDuplexStream {
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
-
static CreatePair() {
|
|
8
|
-
const pass1 = new stream_1.PassThrough();
|
|
9
|
-
const pass2 = new stream_1.PassThrough();
|
|
10
|
-
return {
|
|
11
|
-
first: FullDuplexStream.Splice(pass1, pass2),
|
|
12
|
-
second: FullDuplexStream.Splice(pass2, pass1),
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
-
static Splice(readable, writable) {
|
|
17
|
-
const duplex = new stream_1.Duplex({
|
|
18
|
-
write(chunk, encoding, callback) {
|
|
19
|
-
writable.write(chunk, encoding, callback);
|
|
20
|
-
},
|
|
21
|
-
final(callback) {
|
|
22
|
-
writable.end(callback);
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
// All reads and events come directly from the readable stream.
|
|
26
|
-
duplex.read = readable.read.bind(readable);
|
|
27
|
-
duplex.on = readable.on.bind(readable);
|
|
28
|
-
return duplex;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.FullDuplexStream = FullDuplexStream;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FullDuplexStream = void 0;
|
|
4
|
+
const stream_1 = require("stream");
|
|
5
|
+
class FullDuplexStream {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
static CreatePair() {
|
|
8
|
+
const pass1 = new stream_1.PassThrough();
|
|
9
|
+
const pass2 = new stream_1.PassThrough();
|
|
10
|
+
return {
|
|
11
|
+
first: FullDuplexStream.Splice(pass1, pass2),
|
|
12
|
+
second: FullDuplexStream.Splice(pass2, pass1),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
+
static Splice(readable, writable) {
|
|
17
|
+
const duplex = new stream_1.Duplex({
|
|
18
|
+
write(chunk, encoding, callback) {
|
|
19
|
+
writable.write(chunk, encoding, callback);
|
|
20
|
+
},
|
|
21
|
+
final(callback) {
|
|
22
|
+
writable.end(callback);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
// All reads and events come directly from the readable stream.
|
|
26
|
+
duplex.read = readable.read.bind(readable);
|
|
27
|
+
duplex.on = readable.on.bind(readable);
|
|
28
|
+
return duplex;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.FullDuplexStream = FullDuplexStream;
|
|
32
32
|
//# sourceMappingURL=FullDuplexStream.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Describes an offer for a channel.
|
|
3
|
-
*/
|
|
4
|
-
export interface IChannelOfferEventArgs {
|
|
5
|
-
/**
|
|
6
|
-
* Gets the unique ID of the channel.
|
|
7
|
-
*/
|
|
8
|
-
readonly id: number;
|
|
9
|
-
/**
|
|
10
|
-
* Gets the name of the channel.
|
|
11
|
-
*/
|
|
12
|
-
readonly name: string;
|
|
13
|
-
/**
|
|
14
|
-
* Gets a value indicating whether the channel has already been accepted.
|
|
15
|
-
*/
|
|
16
|
-
readonly isAccepted: boolean;
|
|
17
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Describes an offer for a channel.
|
|
3
|
+
*/
|
|
4
|
+
export interface IChannelOfferEventArgs {
|
|
5
|
+
/**
|
|
6
|
+
* Gets the unique ID of the channel.
|
|
7
|
+
*/
|
|
8
|
+
readonly id: number;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the name of the channel.
|
|
11
|
+
*/
|
|
12
|
+
readonly name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Gets a value indicating whether the channel has already been accepted.
|
|
15
|
+
*/
|
|
16
|
+
readonly isAccepted: boolean;
|
|
17
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=IChannelOfferEventArgs.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface IDisposableObservable {
|
|
2
|
-
readonly isDisposed: boolean;
|
|
3
|
-
dispose(): any;
|
|
4
|
-
}
|
|
1
|
+
export interface IDisposableObservable {
|
|
2
|
+
readonly isDisposed: boolean;
|
|
3
|
+
dispose(): any;
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=IDisposableObservable.js.map
|