@eleven-am/pondsocket 0.1.130 → 0.1.132

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.
@@ -112,7 +112,7 @@ class ChannelEngine {
112
112
  (_a = __classPrivateFieldGet(this, _ChannelEngine_presenceEngine, "f")) === null || _a === void 0 ? void 0 : _a.removePresence(userId, graceful);
113
113
  if (__classPrivateFieldGet(this, _ChannelEngine_parentEngine, "f").leaveCallback) {
114
114
  __classPrivateFieldGet(this, _ChannelEngine_parentEngine, "f").leaveCallback({
115
- userId,
115
+ id: userId,
116
116
  assigns: user,
117
117
  channel: new Channel(this),
118
118
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.130",
3
+ "version": "0.1.132",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",
package/types.d.ts CHANGED
@@ -37,18 +37,18 @@ type IncomingConnection<Path> = EventParams<Path> & {
37
37
  address: string;
38
38
  }
39
39
 
40
- interface LeaveEvent {
41
- userId: string;
42
- assigns: PondAssigns;
43
- channel: Channel;
40
+ interface LeaveEvent<EventTypes extends PondEvenType = PondEvenType, PresenceType extends PondPresence = PondPresence, AssignType extends PondAssigns = PondAssigns> {
41
+ id: string;
42
+ assigns: AssignType;
43
+ channel: Channel<EventTypes, PresenceType, AssignType>;
44
44
  }
45
45
 
46
- type LeaveCallback = (event: LeaveEvent) => void;
46
+ type LeaveCallback<EventTypes extends PondEvenType = PondEvenType, PresenceType extends PondPresence = PondPresence, AssignType extends PondAssigns = PondAssigns> = (event: LeaveEvent<EventTypes, PresenceType, AssignType>) => void;
47
47
 
48
48
 
49
49
  type PondEvenType = { [key: string]: PondMessage };
50
50
 
51
- interface UserData<PresenceType extends PondPresence, AssignType extends PondAssigns> {
51
+ interface UserData<PresenceType extends PondPresence = PondPresence, AssignType extends PondAssigns = PondAssigns> {
52
52
  assigns: AssignType;
53
53
  presence: PresenceType;
54
54
  id: string;
@@ -393,7 +393,7 @@ export declare class PondChannel <EventType extends PondEvenType = PondEvenType,
393
393
  * @desc Handles the leave event for a user, can occur when a user disconnects or leaves a channel, use this to clean up any resources
394
394
  * @param callback - The callback to execute when a user leaves
395
395
  */
396
- public onLeave (callback: LeaveCallback): void;
396
+ public onLeave (callback: LeaveCallback<EventType, PresenceType, AssignType>): void;
397
397
 
398
398
  /**
399
399
  * @desc Gets a channel by name