@eleven-am/pondsocket 0.1.73 → 0.1.74
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.
- package/package.json +1 -1
- package/types.d.ts +26 -30
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -7,7 +7,10 @@ import { WebSocketServer } from 'ws';
|
|
|
7
7
|
type Unsubscribe = () => void;
|
|
8
8
|
|
|
9
9
|
type Constructor<T> = new (...args: any[]) => T;
|
|
10
|
-
type
|
|
10
|
+
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
|
|
11
|
+
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
|
|
12
|
+
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
13
|
+
|
|
11
14
|
export type default_t<T = any> = Record<string, T>;
|
|
12
15
|
type IsParam<Path> = Path extends `:${infer Param}` ? Param : never;
|
|
13
16
|
|
|
@@ -622,106 +625,107 @@ declare const pondSocket: (app: Express) => PondSocketExpressApp;
|
|
|
622
625
|
* @desc The Decorator for retrieving the JoinRequest object from the request in a handler
|
|
623
626
|
* @returns {JoinRequest}
|
|
624
627
|
*/
|
|
625
|
-
declare function GetJoinRequest():
|
|
628
|
+
declare function GetJoinRequest(): ParameterDecorator;
|
|
626
629
|
|
|
627
630
|
/**
|
|
628
631
|
* @desc The Decorator for retrieving the JoinResponse object from the response in a handler
|
|
629
632
|
* @returns {JoinResponse}
|
|
630
633
|
*/
|
|
631
|
-
declare function GetJoinResponse():
|
|
634
|
+
declare function GetJoinResponse(): ParameterDecorator;
|
|
632
635
|
|
|
633
636
|
/**
|
|
634
637
|
* @desc The Decorator for retrieving the JoinParams object from the request in a handler
|
|
635
638
|
* @returns {JoinParams}
|
|
636
639
|
*/
|
|
637
|
-
declare function GetJoinParams():
|
|
640
|
+
declare function GetJoinParams(): ParameterDecorator;
|
|
638
641
|
|
|
639
642
|
/**
|
|
640
643
|
* @desc The Decorator for retrieving the UserData object from the request in a handler
|
|
641
644
|
* @returns {UserData}
|
|
642
645
|
*/
|
|
643
|
-
declare function GetUserData():
|
|
646
|
+
declare function GetUserData(): ParameterDecorator;
|
|
644
647
|
|
|
645
648
|
/**
|
|
646
649
|
* @desc The Decorator for retrieving the Channel object from the request in a handler
|
|
647
650
|
* @returns {Channel}
|
|
648
651
|
*/
|
|
649
|
-
declare function GetInternalChannel():
|
|
652
|
+
declare function GetInternalChannel(): ParameterDecorator;
|
|
650
653
|
|
|
651
654
|
/**
|
|
652
655
|
* @desc The Decorator for retrieving the UserPresence object from the request in a handler
|
|
653
656
|
* @returns {PondPresence}
|
|
654
657
|
*/
|
|
655
|
-
declare function GetUserPresence():
|
|
658
|
+
declare function GetUserPresence(): ParameterDecorator;
|
|
656
659
|
|
|
657
660
|
/**
|
|
658
661
|
* @desc The Decorator for retrieving the event payload from the request in a handler
|
|
659
662
|
* @returns {PondMessage}
|
|
660
663
|
*/
|
|
661
|
-
declare function GetEventPayload():
|
|
664
|
+
declare function GetEventPayload(): ParameterDecorator;
|
|
662
665
|
|
|
663
666
|
/**
|
|
664
667
|
* @desc The Decorator for retrieving the EventRequest Params object from the request in a handler
|
|
665
668
|
* @returns {EventParams}
|
|
666
669
|
*/
|
|
667
|
-
declare function GetEventParams():
|
|
670
|
+
declare function GetEventParams(): ParameterDecorator;
|
|
668
671
|
|
|
669
672
|
/**
|
|
670
673
|
* @desc The Decorator for retrieving the EventRequest Query object from the request in a handler
|
|
671
674
|
* @returns {EventParams}
|
|
672
675
|
*/
|
|
673
|
-
declare function GetEventQuery():
|
|
676
|
+
declare function GetEventQuery(): ParameterDecorator;
|
|
674
677
|
|
|
675
678
|
/**
|
|
676
679
|
* @desc The Decorator for retrieving the EventResponse in a handler
|
|
677
680
|
* @returns {EventResponse}
|
|
678
681
|
*/
|
|
679
|
-
declare function GetEventResponse():
|
|
682
|
+
declare function GetEventResponse(): ParameterDecorator;
|
|
680
683
|
|
|
681
684
|
/**
|
|
682
685
|
* @desc The Decorator for retrieving the EventRequest in a handler
|
|
683
686
|
* @returns {EventRequest}
|
|
684
687
|
*/
|
|
685
|
-
declare function GetEventRequest():
|
|
688
|
+
declare function GetEventRequest(): ParameterDecorator;
|
|
686
689
|
|
|
687
690
|
/**
|
|
688
691
|
* @desc The Decorator for retrieving the ConnectionReQuest in a handler
|
|
689
692
|
* @returns {IncomingConnection}
|
|
690
693
|
*/
|
|
691
|
-
declare function GetConnectionRequest():
|
|
694
|
+
declare function GetConnectionRequest(): ParameterDecorator;
|
|
692
695
|
|
|
693
696
|
/**
|
|
694
697
|
* @desc The Decorator for retrieving the ConnectionResponse in a handler
|
|
695
698
|
* @returns {ConnectionResponse}
|
|
696
699
|
*/
|
|
697
|
-
declare function GetConnectionResponse():
|
|
700
|
+
declare function GetConnectionResponse(): ParameterDecorator;
|
|
698
701
|
|
|
699
702
|
/**
|
|
700
703
|
* @desc The Decorator for retrieving the ConnectionRequestId in a handler
|
|
701
704
|
* @returns {string}
|
|
702
705
|
*/
|
|
703
|
-
declare function GetConnectionRequestId():
|
|
706
|
+
declare function GetConnectionRequestId(): ParameterDecorator;
|
|
704
707
|
|
|
705
708
|
/**
|
|
706
709
|
* @desc The Decorator for retrieving the ConnectionParams in a handler
|
|
707
710
|
* @returns {EventParams}
|
|
708
711
|
*/
|
|
709
|
-
declare function GetConnectionParams():
|
|
712
|
+
declare function GetConnectionParams(): ParameterDecorator;
|
|
710
713
|
|
|
711
714
|
/**
|
|
712
715
|
* @desc The Decorator for retrieving the ConnectionHeaders from the request in a handler
|
|
713
716
|
* @returns {EventParams}
|
|
714
717
|
*/
|
|
715
|
-
declare function GetConnectionHeaders():
|
|
718
|
+
declare function GetConnectionHeaders(): ParameterDecorator;
|
|
716
719
|
|
|
717
720
|
/**
|
|
718
721
|
* @desc The Decorator for retrieving the ConnectionQuery in a handler
|
|
719
722
|
* @returns {EventParams}
|
|
720
723
|
*/
|
|
721
|
-
declare function GetConnectionQuery():
|
|
724
|
+
declare function GetConnectionQuery(): ParameterDecorator;
|
|
722
725
|
|
|
723
726
|
/**
|
|
724
727
|
* @desc Marks a method as a handler for JoinRequest events.
|
|
728
|
+
* @param - The path for the JoinRequest event.
|
|
725
729
|
*/
|
|
726
730
|
declare function OnJoinRequest(): MethodDecorator;
|
|
727
731
|
|
|
@@ -740,33 +744,25 @@ declare function OnConnectionRequest(): MethodDecorator;
|
|
|
740
744
|
* Decorator to mark a class as a channel.
|
|
741
745
|
* @param path - The path for the channel (default is '*').
|
|
742
746
|
*/
|
|
743
|
-
declare function DChannel
|
|
744
|
-
path?: string
|
|
745
|
-
): (constructor: T) => void;
|
|
747
|
+
declare function DChannel(path?: string): ClassDecorator;
|
|
746
748
|
|
|
747
749
|
/**
|
|
748
750
|
* Decorator to mark a class as having multiple channels.
|
|
749
751
|
* @param channels - The array of channels.
|
|
750
752
|
*/
|
|
751
|
-
declare function Channels
|
|
752
|
-
channels: Constructor<NonNullable<unknown>>[]
|
|
753
|
-
): (constructor: T) => void;
|
|
753
|
+
declare function Channels(channels: Constructor<NonNullable<unknown>>[]): ClassDecorator;
|
|
754
754
|
|
|
755
755
|
/**
|
|
756
756
|
* Decorator to mark a class as an endpoint.
|
|
757
757
|
* @param path - The path for the endpoint (default is '*').
|
|
758
758
|
*/
|
|
759
|
-
declare function DEndpoint
|
|
760
|
-
path?: string
|
|
761
|
-
): (constructor: T) => void;
|
|
759
|
+
declare function DEndpoint(path?: string): ClassDecorator;
|
|
762
760
|
|
|
763
761
|
/**
|
|
764
762
|
* Decorator to mark a class as having multiple endpoints.
|
|
765
763
|
* @param endpoints - The array of endpoints.
|
|
766
764
|
*/
|
|
767
|
-
declare function Endpoints
|
|
768
|
-
endpoints: Constructor<NonNullable<unknown>>[]
|
|
769
|
-
): (constructor: T) => void;
|
|
765
|
+
declare function Endpoints(endpoints: Constructor<NonNullable<unknown>>[]): ClassDecorator;
|
|
770
766
|
|
|
771
767
|
declare class PondSocketModule {
|
|
772
768
|
/**
|