@fuman/net 0.0.10 → 0.0.11

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/index.d.cts CHANGED
@@ -4,4 +4,5 @@ export * from './ip/index.js';
4
4
  export * from './proxy/index.js';
5
5
  export * from './reconnection.js';
6
6
  export * from './types.js';
7
+ export * from './websocket-server.js';
7
8
  export * from './websocket.js';
package/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from './ip/index.js';
4
4
  export * from './proxy/index.js';
5
5
  export * from './reconnection.js';
6
6
  export * from './types.js';
7
+ export * from './websocket-server.js';
7
8
  export * from './websocket.js';
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fuman/net",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "description": "experimental network abstractions",
6
6
  "license": "MIT",
7
7
  "scripts": {},
8
8
  "dependencies": {
9
- "@fuman/io": "^0.0.10",
10
- "@fuman/utils": "^0.0.10"
9
+ "@fuman/io": "^0.0.11",
10
+ "@fuman/utils": "^0.0.11"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
@@ -0,0 +1,16 @@
1
+ import { IConnection, TcpEndpoint } from './types.js';
2
+ import { IWebSocketConnectionFramed } from './websocket.js';
3
+ /** a connection to a WebSocket server (not to be confused with client-side connection!) */
4
+ export interface IWebSocketServerConnection extends IConnection<TcpEndpoint> {
5
+ /** headers from the handshake request */
6
+ readonly headers: Headers;
7
+ /** URL of the handshake request */
8
+ readonly url: string;
9
+ }
10
+ /** a framed connection to a WebSocket server (not to be confused with client-side connection!) */
11
+ export interface IWebSocketServerConnectionFramed extends IWebSocketConnectionFramed {
12
+ /** headers from the handshake request */
13
+ readonly headers: Headers;
14
+ /** URL of the handshake request */
15
+ readonly url: string;
16
+ }
@@ -0,0 +1,16 @@
1
+ import { IConnection, TcpEndpoint } from './types.js';
2
+ import { IWebSocketConnectionFramed } from './websocket.js';
3
+ /** a connection to a WebSocket server (not to be confused with client-side connection!) */
4
+ export interface IWebSocketServerConnection extends IConnection<TcpEndpoint> {
5
+ /** headers from the handshake request */
6
+ readonly headers: Headers;
7
+ /** URL of the handshake request */
8
+ readonly url: string;
9
+ }
10
+ /** a framed connection to a WebSocket server (not to be confused with client-side connection!) */
11
+ export interface IWebSocketServerConnectionFramed extends IWebSocketConnectionFramed {
12
+ /** headers from the handshake request */
13
+ readonly headers: Headers;
14
+ /** URL of the handshake request */
15
+ readonly url: string;
16
+ }
package/websocket.d.cts CHANGED
@@ -24,7 +24,11 @@ export declare class WebSocketConnection extends WebSocketConnectionBase impleme
24
24
  read(into: Uint8Array): Promise<number>;
25
25
  write(bytes: Uint8Array): Promise<void>;
26
26
  }
27
- export declare class WebSocketConnectionFramed extends WebSocketConnectionBase {
27
+ export interface IWebSocketConnectionFramed extends IClosable {
28
+ readFrame: () => Promise<Uint8Array | string>;
29
+ writeFrame: (frame: Uint8Array | string) => Promise<void>;
30
+ }
31
+ export declare class WebSocketConnectionFramed extends WebSocketConnectionBase implements IWebSocketConnectionFramed {
28
32
  #private;
29
33
  onMessage(event: MessageEvent): void;
30
34
  readFrame(): Promise<Uint8Array | string>;
package/websocket.d.ts CHANGED
@@ -24,7 +24,11 @@ export declare class WebSocketConnection extends WebSocketConnectionBase impleme
24
24
  read(into: Uint8Array): Promise<number>;
25
25
  write(bytes: Uint8Array): Promise<void>;
26
26
  }
27
- export declare class WebSocketConnectionFramed extends WebSocketConnectionBase {
27
+ export interface IWebSocketConnectionFramed extends IClosable {
28
+ readFrame: () => Promise<Uint8Array | string>;
29
+ writeFrame: (frame: Uint8Array | string) => Promise<void>;
30
+ }
31
+ export declare class WebSocketConnectionFramed extends WebSocketConnectionBase implements IWebSocketConnectionFramed {
28
32
  #private;
29
33
  onMessage(event: MessageEvent): void;
30
34
  readFrame(): Promise<Uint8Array | string>;