@wooksjs/event-ws 0.7.4 → 0.7.6
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.d.ts +4 -4
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare function currentConnection(ctx?: EventContext): EventContext;
|
|
|
19
19
|
* Provides access to the current WebSocket connection (id, send, close).
|
|
20
20
|
* Works in both connection and message contexts via parent chain traversal.
|
|
21
21
|
*/
|
|
22
|
-
declare const useWsConnection:
|
|
22
|
+
declare const useWsConnection: _wooksjs_event_core.WookComposable<{
|
|
23
23
|
/** Unique connection ID. */
|
|
24
24
|
id: string;
|
|
25
25
|
/** Send a push message to this connection. */
|
|
@@ -28,7 +28,7 @@ declare const useWsConnection: (ctx?: EventContext) => {
|
|
|
28
28
|
close(code?: number, reason?: string): void;
|
|
29
29
|
/** The connection EventContext (for advanced use). */
|
|
30
30
|
context: EventContext;
|
|
31
|
-
}
|
|
31
|
+
}>;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Provides access to the current WebSocket message data.
|
|
@@ -59,7 +59,7 @@ interface WsBroadcastOptions {
|
|
|
59
59
|
* All methods default to the current message path as the room.
|
|
60
60
|
* Only available in message context (inside `onMessage` handlers).
|
|
61
61
|
*/
|
|
62
|
-
declare const useWsRooms:
|
|
62
|
+
declare const useWsRooms: _wooksjs_event_core.WookComposable<{
|
|
63
63
|
/** Join a room. Default: current message path. */
|
|
64
64
|
join(room?: string): void;
|
|
65
65
|
/** Leave a room. Default: current message path. */
|
|
@@ -68,7 +68,7 @@ declare const useWsRooms: (ctx?: EventContext) => {
|
|
|
68
68
|
broadcast(event: string, data?: unknown, options?: WsBroadcastOptions): void;
|
|
69
69
|
/** List rooms this connection has joined. */
|
|
70
70
|
rooms(): string[];
|
|
71
|
-
}
|
|
71
|
+
}>;
|
|
72
72
|
|
|
73
73
|
/** Client-to-server message. */
|
|
74
74
|
interface WsClientMessage {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wooksjs/event-ws",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "WebSocket adapter for Wooks with path-based message routing, rooms, and broadcasting",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"@types/ws": "^8.18.1",
|
|
48
48
|
"typescript": "^5.9.3",
|
|
49
49
|
"vitest": "^3.2.4",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"wooks": "^0.7.6",
|
|
51
|
+
"@wooksjs/event-core": "^0.7.6"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@prostojs/logger": "^0.4.3",
|
|
55
55
|
"@prostojs/router": "^0.3.3",
|
|
56
56
|
"ws": "^8.0.0",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
57
|
+
"wooks": "^0.7.6",
|
|
58
|
+
"@wooksjs/event-core": "^0.7.6"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "rolldown -c ../../rolldown.config.mjs",
|