@eleven-am/pondsocket-client 0.0.7 → 0.0.9
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.d.ts +9 -15
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/package.json +2 -2
package/dist.d.ts
CHANGED
|
@@ -6,18 +6,12 @@ import {
|
|
|
6
6
|
PondMessage,
|
|
7
7
|
EventWithResponse,
|
|
8
8
|
PayloadForResponse,
|
|
9
|
-
ResponseForEvent,
|
|
9
|
+
ResponseForEvent,
|
|
10
|
+
Unsubscribe,
|
|
11
|
+
ChannelState,
|
|
10
12
|
} from '@eleven-am/pondsocket-common';
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
IDLE = 'IDLE',
|
|
14
|
-
JOINING = 'JOINING',
|
|
15
|
-
JOINED = 'JOINED',
|
|
16
|
-
STALLED = 'STALLED',
|
|
17
|
-
CLOSED = 'CLOSED',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare class Channel<EventMap extends PondEventMap = PondEventMap> {
|
|
14
|
+
declare class Channel<EventMap extends PondEventMap = PondEventMap, Presence extends PondPresence = PondPresence> {
|
|
21
15
|
/**
|
|
22
16
|
* @desc Gets the current connection state of the channel.
|
|
23
17
|
*/
|
|
@@ -56,19 +50,19 @@ declare class Channel<EventMap extends PondEventMap = PondEventMap> {
|
|
|
56
50
|
* @desc Detects when clients join the channel.
|
|
57
51
|
* @param callback - The callback to call when a client joins the channel.
|
|
58
52
|
*/
|
|
59
|
-
onJoin (callback: (presence:
|
|
53
|
+
onJoin (callback: (presence: Presence) => void): import('@eleven-am/pondsocket-common/subjects/types').Unsubscribe;
|
|
60
54
|
|
|
61
55
|
/**
|
|
62
56
|
* @desc Detects when clients leave the channel.
|
|
63
57
|
* @param callback - The callback to call when a client leaves the channel.
|
|
64
58
|
*/
|
|
65
|
-
onLeave (callback: (presence:
|
|
59
|
+
onLeave (callback: (presence: Presence) => void): import('@eleven-am/pondsocket-common/subjects/types').Unsubscribe;
|
|
66
60
|
|
|
67
61
|
/**
|
|
68
62
|
* @desc Detects when clients change their presence in the channel.
|
|
69
63
|
* @param callback - The callback to call when a client changes their presence in the channel.
|
|
70
64
|
*/
|
|
71
|
-
onPresenceChange (callback: (presence: PresencePayload) => void): import('@eleven-am/pondsocket-common/subjects/types').Unsubscribe;
|
|
65
|
+
onPresenceChange (callback: (presence: PresencePayload<Presence>) => void): import('@eleven-am/pondsocket-common/subjects/types').Unsubscribe;
|
|
72
66
|
|
|
73
67
|
/**
|
|
74
68
|
* @desc Sends a message to specific clients in the channel.
|
|
@@ -102,13 +96,13 @@ declare class Channel<EventMap extends PondEventMap = PondEventMap> {
|
|
|
102
96
|
/**
|
|
103
97
|
* @desc Gets the current presence of the channel.
|
|
104
98
|
*/
|
|
105
|
-
getPresence ():
|
|
99
|
+
getPresence (): Presence[];
|
|
106
100
|
|
|
107
101
|
/**
|
|
108
102
|
* @desc Monitors the presence of the channel.
|
|
109
103
|
* @param callback - The callback to call when the presence changes.
|
|
110
104
|
*/
|
|
111
|
-
onUsersChange (callback: (users:
|
|
105
|
+
onUsersChange (callback: (users: Presence[]) => void): Unsubscribe;
|
|
112
106
|
|
|
113
107
|
/**
|
|
114
108
|
* @desc Checks if the channel is connected.
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -3,6 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChannelState = void 0;
|
|
6
7
|
const client_1 = __importDefault(require("./browser/client"));
|
|
7
8
|
const node_1 = __importDefault(require("./node/node"));
|
|
9
|
+
const pondsocket_common_1 = require("@eleven-am/pondsocket-common");
|
|
10
|
+
Object.defineProperty(exports, "ChannelState", { enumerable: true, get: function () { return pondsocket_common_1.ChannelState; } });
|
|
8
11
|
exports.default = typeof window === 'undefined' ? node_1.default : client_1.default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eleven-am/pondsocket-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "PondSocket is a fast simple socket server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"socket",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"pipeline": "npm run test && npm run build && npm run push"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eleven-am/pondsocket-common": "^0.0.
|
|
32
|
+
"@eleven-am/pondsocket-common": "^0.0.7",
|
|
33
33
|
"websocket": "^1.0.34"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|