@eleven-am/pondsocket 0.1.84 → 0.1.85

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/package.json +1 -1
  2. package/types.d.ts +16 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.84",
3
+ "version": "0.1.85",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",
package/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Server as HTTPServer, IncomingHttpHeaders } from 'http';
2
2
 
3
- import { ModuleMetadata } from '@nestjs/common/interfaces/modules/module-metadata.interface';
3
+ import { ModuleMetadata } from '@nestjs/common';
4
4
  import type { ModuleRef, HttpAdapterHost } from '@nestjs/core';
5
5
  import type { Express } from 'express';
6
6
  import { WebSocketServer } from 'ws';
@@ -20,6 +20,16 @@ type FilteredParams<Path> = Path extends `${infer First}/${infer Second}`
20
20
  ? IsParam<First> | FilteredParams<Second>
21
21
  : IsParam<Path>
22
22
 
23
+ /**
24
+ * @desc The type for the params in a request
25
+ * @typeParam Path - The path to get the params from
26
+ * @example
27
+ *
28
+ * const params: Params<'/api/:id'> = {
29
+ * id: '123',
30
+ * foo: 'bar', // Error: Type 'string' is not assignable to type 'undefined'
31
+ * }
32
+ */
23
33
  type Params<Path> = {
24
34
  [Key in FilteredParams<Path>]: string
25
35
  }
@@ -677,13 +687,13 @@ declare function GetEventPayload(): ParameterDecorator;
677
687
 
678
688
  /**
679
689
  * @desc The Decorator for retrieving the EventRequest Params object from the request in a handler
680
- * @returns {EventParams}
690
+ * @returns {Params}
681
691
  */
682
692
  declare function GetEventParams(): ParameterDecorator;
683
693
 
684
694
  /**
685
695
  * @desc The Decorator for retrieving the EventRequest Query object from the request in a handler
686
- * @returns {EventParams}
696
+ * @returns {Record<string, string>}
687
697
  */
688
698
  declare function GetEventQuery(): ParameterDecorator;
689
699
 
@@ -719,19 +729,19 @@ declare function GetConnectionRequestId(): ParameterDecorator;
719
729
 
720
730
  /**
721
731
  * @desc The Decorator for retrieving the ConnectionParams in a handler
722
- * @returns {EventParams}
732
+ * @returns {Params}
723
733
  */
724
734
  declare function GetConnectionParams(): ParameterDecorator;
725
735
 
726
736
  /**
727
737
  * @desc The Decorator for retrieving the ConnectionHeaders from the request in a handler
728
- * @returns {EventParams}
738
+ * @returns {IncomingHttpHeaders}
729
739
  */
730
740
  declare function GetConnectionHeaders(): ParameterDecorator;
731
741
 
732
742
  /**
733
743
  * @desc The Decorator for retrieving the ConnectionQuery in a handler
734
- * @returns {EventParams}
744
+ * @returns {Record<string, string>}
735
745
  */
736
746
  declare function GetConnectionQuery(): ParameterDecorator;
737
747