@derivation/rpc 0.5.1 → 0.6.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/dist/index.cjs +0 -209
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -208
- package/dist/index.js.map +1 -1
- package/dist/{shared-worker-server.cjs → shared-worker.cjs} +185 -47
- package/dist/shared-worker.cjs.map +1 -0
- package/dist/shared-worker.d.cts +68 -0
- package/dist/shared-worker.d.ts +68 -0
- package/dist/{shared-worker-server.js → shared-worker.js} +179 -43
- package/dist/shared-worker.js.map +1 -0
- package/dist/{shared-worker-client.cjs → websocket-client.cjs} +21 -55
- package/dist/websocket-client.cjs.map +1 -0
- package/dist/{client-DJZfuakf.d.cts → websocket-client.d.cts} +4 -5
- package/dist/{client-TPsVZH_B.d.ts → websocket-client.d.ts} +4 -5
- package/dist/{shared-worker-client.js → websocket-client.js} +16 -50
- package/dist/websocket-client.js.map +1 -0
- package/dist/{web-socket-server.cjs → websocket-server.cjs} +19 -49
- package/dist/websocket-server.cjs.map +1 -0
- package/dist/{web-socket-server.js → websocket-server.js} +19 -49
- package/dist/websocket-server.js.map +1 -0
- package/package.json +18 -28
- package/dist/shared-worker-client.cjs.map +0 -1
- package/dist/shared-worker-client.d.cts +0 -26
- package/dist/shared-worker-client.d.ts +0 -26
- package/dist/shared-worker-client.js.map +0 -1
- package/dist/shared-worker-server.cjs.map +0 -1
- package/dist/shared-worker-server.d.cts +0 -31
- package/dist/shared-worker-server.d.ts +0 -31
- package/dist/shared-worker-server.js.map +0 -1
- package/dist/transport.cjs +0 -19
- package/dist/transport.cjs.map +0 -1
- package/dist/transport.d.cts +0 -29
- package/dist/transport.d.ts +0 -29
- package/dist/transport.js +0 -1
- package/dist/transport.js.map +0 -1
- package/dist/web-socket-server.cjs.map +0 -1
- package/dist/web-socket-server.js.map +0 -1
- package/dist/web-socket-transport.cjs +0 -52
- package/dist/web-socket-transport.cjs.map +0 -1
- package/dist/web-socket-transport.d.cts +0 -16
- package/dist/web-socket-transport.d.ts +0 -16
- package/dist/web-socket-transport.js +0 -27
- package/dist/web-socket-transport.js.map +0 -1
- /package/dist/{web-socket-server.d.cts → websocket-server.d.cts} +0 -0
- /package/dist/{web-socket-server.d.ts → websocket-server.d.ts} +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Transport } from './transport.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Transport implementation for browser WebSocket (client-side).
|
|
5
|
-
*/
|
|
6
|
-
declare class WebSocketTransport implements Transport {
|
|
7
|
-
private ws;
|
|
8
|
-
constructor(ws: globalThis.WebSocket);
|
|
9
|
-
send(data: string): void;
|
|
10
|
-
onMessage(handler: (data: string) => void): void;
|
|
11
|
-
onClose(handler: () => void): void;
|
|
12
|
-
close(): void;
|
|
13
|
-
get bufferedAmount(): number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { WebSocketTransport };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// src/web-socket-transport.ts
|
|
2
|
-
var WebSocketTransport = class {
|
|
3
|
-
constructor(ws) {
|
|
4
|
-
this.ws = ws;
|
|
5
|
-
}
|
|
6
|
-
send(data) {
|
|
7
|
-
this.ws.send(data);
|
|
8
|
-
}
|
|
9
|
-
onMessage(handler) {
|
|
10
|
-
this.ws.onmessage = (event) => {
|
|
11
|
-
handler(event.data);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
onClose(handler) {
|
|
15
|
-
this.ws.onclose = handler;
|
|
16
|
-
}
|
|
17
|
-
close() {
|
|
18
|
-
this.ws.close();
|
|
19
|
-
}
|
|
20
|
-
get bufferedAmount() {
|
|
21
|
-
return this.ws.bufferedAmount;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
WebSocketTransport
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=web-socket-transport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/web-socket-transport.ts"],"sourcesContent":["import { Transport } from \"./transport.js\";\n\n/**\n * Transport implementation for browser WebSocket (client-side).\n */\nexport class WebSocketTransport implements Transport {\n constructor(private ws: globalThis.WebSocket) {}\n\n send(data: string): void {\n this.ws.send(data);\n }\n\n onMessage(handler: (data: string) => void): void {\n this.ws.onmessage = (event: MessageEvent) => {\n handler(event.data);\n };\n }\n\n onClose(handler: () => void): void {\n this.ws.onclose = handler;\n }\n\n close(): void {\n this.ws.close();\n }\n\n get bufferedAmount(): number {\n return this.ws.bufferedAmount;\n }\n}\n"],"mappings":";AAKO,IAAM,qBAAN,MAA8C;AAAA,EACnD,YAAoB,IAA0B;AAA1B;AAAA,EAA2B;AAAA,EAE/C,KAAK,MAAoB;AACvB,SAAK,GAAG,KAAK,IAAI;AAAA,EACnB;AAAA,EAEA,UAAU,SAAuC;AAC/C,SAAK,GAAG,YAAY,CAAC,UAAwB;AAC3C,cAAQ,MAAM,IAAI;AAAA,IACpB;AAAA,EACF;AAAA,EAEA,QAAQ,SAA2B;AACjC,SAAK,GAAG,UAAU;AAAA,EACpB;AAAA,EAEA,QAAc;AACZ,SAAK,GAAG,MAAM;AAAA,EAChB;AAAA,EAEA,IAAI,iBAAyB;AAC3B,WAAO,KAAK,GAAG;AAAA,EACjB;AACF;","names":[]}
|
|
File without changes
|
|
File without changes
|