@eleven-am/pondsocket-nest 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/index.d.ts +12 -11
  2. package/package.json +4 -4
package/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import type {
7
7
  LeaveEvent,
8
8
  JoinResponse, EventResponse,
9
9
  ConnectionResponse, UserPresences,
10
- PondEvenType, PondEvent, PondMessage,
10
+ PondEvenType, PondEvent, PondMessage, PondPresence, PondAssigns,
11
11
  } from '@eleven-am/pondsocket/types';
12
12
  import type { DynamicModule, ModuleMetadata } from '@nestjs/common';
13
13
 
@@ -30,19 +30,20 @@ interface Metadata extends Omit<ModuleMetadata, 'controllers'> {
30
30
  isGlobal?: boolean;
31
31
  }
32
32
 
33
- type NestFuncType<Event extends string, Payload extends PondMessage> = {
33
+ type NestFuncType<Event extends string, Payload extends PondMessage, Presence extends PondPresence, Assigns extends PondAssigns = PondAssigns> = {
34
34
  event?: Event;
35
35
  broadcast?: Event;
36
- assigns?: PondAssigns;
37
- presence?: PondPresence;
38
- updatePresence?: PondPresence;
36
+ assigns?: Assigns;
37
+ presence?: Presence;
38
+ updatePresence?: Presence;
39
39
  } & Payload;
40
40
 
41
- type NestReturnType<EventType extends PondEvenType, Event extends keyof EventType> = Event extends string ?
42
- EventType[Event] extends [PondMessage, PondMessage] ? NestFuncType<Event, EventType[Event][1]> :
43
- EventType[Event] extends PondMessage ? NestFuncType<Event, EventType[Event]> :
44
- never :
45
- never;
41
+ type NestReturnType<EventType extends PondEvenType, Event extends keyof EventType, Presence extends PondPresence = PondPresence, Assigns extends PondAssigns = PondAssigns> =
42
+ Event extends string ?
43
+ EventType[Event] extends [PondMessage, PondMessage] ? NestFuncType<Event, EventType[Event][1], Presence, Assigns> :
44
+ EventType[Event] extends PondMessage ? NestFuncType<Event, EventType[Event], Presence, Assigns> :
45
+ never :
46
+ never;
46
47
 
47
48
  declare class Context<Path extends string = string, Event extends PondEvenType = PondEvenType> {
48
49
  /**
@@ -93,7 +94,7 @@ declare class Context<Path extends string = string, Event extends PondEvenType =
93
94
  /**
94
95
  * @desc The channel object handling the request
95
96
  */
96
- get channel (): PondChannel<Event> | null;
97
+ get channel<EventType extends PondEvenType = PondEvenType, Presence extends PondPresence = PondPresence, Assigns extends PondAssigns = PondAssigns> (): PondChannel<EventType, Presence, Assigns>;
97
98
 
98
99
  /**
99
100
  * @desc The event object of the current the request
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket-nest",
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",
@@ -28,17 +28,17 @@
28
28
  "pipeline": "npm run lint && npm run build && npm run push"
29
29
  },
30
30
  "dependencies": {
31
- "@eleven-am/pondsocket": "^0.1.127"
31
+ "@eleven-am/pondsocket": "^0.1.131"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@nestjs/common": "^10.3.0",
35
35
  "@nestjs/core": "^10.3.0",
36
36
  "@types/jest": "^29.5.11",
37
- "@typescript-eslint/eslint-plugin": "^6.18.0",
37
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
38
38
  "eslint-plugin-file-progress": "^1.3.0",
39
39
  "eslint-plugin-import": "^2.29.1",
40
40
  "jest": "^29.7.0",
41
- "prettier": "^3.1.1",
41
+ "prettier": "^3.2.2",
42
42
  "ts-jest": "^29.1.1",
43
43
  "ts-loader": "^9.5.1",
44
44
  "ts-node": "^10.9.2",