hytopia 0.1.71 → 0.1.73

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/server.d.ts CHANGED
@@ -1621,15 +1621,6 @@ export declare interface EntityOptions {
1621
1621
  tintColor?: RgbColor;
1622
1622
  }
1623
1623
 
1624
- /** An EventRouter event. @public */
1625
- declare interface Event_2<TPayload> {
1626
- /** The type of event */
1627
- type: string;
1628
- /** The payload of the event, passed to listeners */
1629
- payload: TPayload;
1630
- }
1631
- export { Event_2 as Event }
1632
-
1633
1624
  /**
1634
1625
  * Manages event emission and assigned listener callbacks.
1635
1626
  *
@@ -1646,7 +1637,6 @@ export declare class EventRouter {
1646
1637
  /** The singleton instance for global server events. */
1647
1638
  static readonly serverInstance: EventRouter;
1648
1639
  private _emitter;
1649
- private _wrappedListenerMap;
1650
1640
  private _tag;
1651
1641
  /** Enable logging of all events. Default: false */
1652
1642
  logAllEvents: boolean;
@@ -1661,18 +1651,14 @@ export declare class EventRouter {
1661
1651
  /** @param tag - Tag for logging, used to identify EventRouter instances in logs. */
1662
1652
  constructor(tag: string);
1663
1653
  /**
1664
- * Register a listener for a specific event type.
1654
+ * Emit an event, invoking all registered listeners for the event type.
1665
1655
  *
1666
- * @remarks
1667
- * When the same event router instance used to register a listener
1668
- * emits an event a listener was registered for, the listener will
1669
- * be invoked with the event payload. Listeners are called in the order
1670
- * they are registered.
1656
+ * @param eventType - The type of event to emit.
1657
+ * @param payload - The payload to emit.
1671
1658
  *
1672
- * @param eventType - The type of event to listen for.
1673
- * @param listener - The listener function to invoke when the event is emitted.
1659
+ * @returns `true` if listeners were found and invoked, `false` otherwise.
1674
1660
  */
1675
- on<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
1661
+ emit<TPayload>(eventType: string, payload: TPayload): boolean;
1676
1662
  /**
1677
1663
  * Remove a listener for a specific event type.
1678
1664
  *
@@ -1687,12 +1673,36 @@ export declare class EventRouter {
1687
1673
  */
1688
1674
  offAll(eventType: string): void;
1689
1675
  /**
1690
- * Emit an event, invoking all registered listeners for the event type.
1676
+ * Register a listener for a specific event type.
1691
1677
  *
1692
- * @param event - The event to emit.
1693
- * @returns `true` if listeners were found and invoked, `false` otherwise.
1678
+ * @remarks
1679
+ * Listeners are invoked in the order they are registered.
1680
+ *
1681
+ * @param eventType - The type of event to listen for.
1682
+ * @param listener - The listener function to invoke when the event is emitted.
1683
+ */
1684
+ on<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
1685
+ /**
1686
+ * Register a listener for a specific event type that will be invoked once.
1687
+ *
1688
+ * @param eventType - The type of event to listen for.
1689
+ * @param listener - The listener function to invoke when the event is emitted.
1694
1690
  */
1695
- emit<TPayload>(event: Event_2<TPayload>): boolean;
1691
+ once<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
1692
+ /**
1693
+ * Register a listener for a specific event type that will be invoked before all other existing listeners.
1694
+ *
1695
+ * @param eventType - The type of event to listen for.
1696
+ * @param listener - The listener function to invoke when the event is emitted.
1697
+ */
1698
+ prependOn<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
1699
+ /**
1700
+ * Register a listener for a specific event type that will be invoked once before all other existing listeners.
1701
+ *
1702
+ * @param eventType - The type of event to listen for.
1703
+ * @param listener - The listener function to invoke when the event is emitted.
1704
+ */
1705
+ prependOnce<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
1696
1706
  }
1697
1707
 
1698
1708
  /**
@@ -3136,6 +3146,11 @@ export declare class RigidBody {
3136
3146
  * @param collisionGroups - The collision groups for solid colliders of the rigid body.
3137
3147
  */
3138
3148
  setCollisionGroupsForSolidColliders(collisionGroups: CollisionGroups): void;
3149
+ /**
3150
+ * Sets the collision groups for sensor colliders of the rigid body.
3151
+ * @param collisionGroups - The collision groups for sensor colliders of the rigid body.
3152
+ */
3153
+ setCollisionGroupsForSensorColliders(collisionGroups: CollisionGroups): void;
3139
3154
  /**
3140
3155
  * Sets the type of the rigid body.
3141
3156
  * @param type - The type of the rigid body.