@eleven-am/pondsocket 0.1.82 → 0.1.83

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 +8 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.82",
3
+ "version": "0.1.83",
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
- import { ModuleMetadata } from '@nestjs/common/interfaces/modules/module-metadata.interface';
2
1
  import { Server as HTTPServer, IncomingHttpHeaders } from 'http';
3
2
 
3
+ import { ModuleMetadata } from '@nestjs/common/interfaces/modules/module-metadata.interface';
4
4
  import type { ModuleRef, HttpAdapterHost } from '@nestjs/core';
5
5
  import type { Express } from 'express';
6
6
  import { WebSocketServer } from 'ws';
@@ -24,6 +24,11 @@ type Params<Path> = {
24
24
  [Key in FilteredParams<Path>]: string
25
25
  }
26
26
 
27
+ interface EndpointMetadata {
28
+ path?: string;
29
+ channels: Constructor<NonNullable<unknown>>[];
30
+ }
31
+
27
32
  type PondPath<Path extends string> = Path | RegExp;
28
33
 
29
34
  type EventParams<Path> = {
@@ -765,9 +770,9 @@ declare function Channels(channels: Constructor<NonNullable<unknown>>[]): ClassD
765
770
 
766
771
  /**
767
772
  * Decorator to mark a class as an endpoint.
768
- * @param path - The path for the endpoint (default is '*').
773
+ * @param metadata - The metadata for the endpoint.
769
774
  */
770
- declare function DEndpoint(path?: string): ClassDecorator;
775
+ declare function DEndpoint(metadata: EndpointMetadata): ClassDecorator;
771
776
 
772
777
  /**
773
778
  * Decorator to mark a class as having multiple endpoints.