@eleven-am/pondsocket-client 0.0.8 → 0.0.10

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.
Files changed (2) hide show
  1. package/dist.d.ts +7 -7
  2. package/package.json +2 -2
package/dist.d.ts CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  ChannelState,
12
12
  } from '@eleven-am/pondsocket-common';
13
13
 
14
- declare class Channel<EventMap extends PondEventMap = PondEventMap> {
14
+ declare class Channel<EventMap extends PondEventMap = PondEventMap, Presence extends PondPresence = PondPresence> {
15
15
  /**
16
16
  * @desc Gets the current connection state of the channel.
17
17
  */
@@ -50,19 +50,19 @@ declare class Channel<EventMap extends PondEventMap = PondEventMap> {
50
50
  * @desc Detects when clients join the channel.
51
51
  * @param callback - The callback to call when a client joins the channel.
52
52
  */
53
- onJoin (callback: (presence: PondPresence) => void): import('@eleven-am/pondsocket-common/subjects/types').Unsubscribe;
53
+ onJoin (callback: (presence: Presence) => void): import('@eleven-am/pondsocket-common/subjects/types').Unsubscribe;
54
54
 
55
55
  /**
56
56
  * @desc Detects when clients leave the channel.
57
57
  * @param callback - The callback to call when a client leaves the channel.
58
58
  */
59
- onLeave (callback: (presence: PondPresence) => void): import('@eleven-am/pondsocket-common/subjects/types').Unsubscribe;
59
+ onLeave (callback: (presence: Presence) => void): import('@eleven-am/pondsocket-common/subjects/types').Unsubscribe;
60
60
 
61
61
  /**
62
62
  * @desc Detects when clients change their presence in the channel.
63
63
  * @param callback - The callback to call when a client changes their presence in the channel.
64
64
  */
65
- 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;
66
66
 
67
67
  /**
68
68
  * @desc Sends a message to specific clients in the channel.
@@ -96,13 +96,13 @@ declare class Channel<EventMap extends PondEventMap = PondEventMap> {
96
96
  /**
97
97
  * @desc Gets the current presence of the channel.
98
98
  */
99
- getPresence (): PondPresence[];
99
+ getPresence (): Presence[];
100
100
 
101
101
  /**
102
102
  * @desc Monitors the presence of the channel.
103
103
  * @param callback - The callback to call when the presence changes.
104
104
  */
105
- onUsersChange (callback: (users: PondPresence[]) => void): Unsubscribe;
105
+ onUsersChange (callback: (users: Presence[]) => void): Unsubscribe;
106
106
 
107
107
  /**
108
108
  * @desc Checks if the channel is connected.
@@ -149,7 +149,7 @@ declare class PondClient {
149
149
  * @param name - The name of the channel.
150
150
  * @param params - The params to send to the server.
151
151
  */
152
- createChannel<EventType extends PondEventMap = PondEventMap> (name: string, params?: JoinParams): Channel<EventType>;
152
+ createChannel<EventType extends PondEventMap = PondEventMap, Presence extends PondPresence = PondPresence> (name: string, params?: JoinParams): Channel<EventType, Presence>;
153
153
 
154
154
  /**
155
155
  * @desc Subscribes to the connection state.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket-client",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
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.6",
32
+ "@eleven-am/pondsocket-common": "^0.0.7",
33
33
  "websocket": "^1.0.34"
34
34
  },
35
35
  "devDependencies": {