@emeryld/rrroutes-client 2.6.11 → 2.6.12

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.
@@ -1,5 +1,5 @@
1
1
  import type { AnyLeafLowProfile, InferOutput, SocketConnectionConfigOutput, SocketSchemaOutput } from '@emeryld/rrroutes-contract';
2
- import type { DataShape, UseEndpointArgs } from '../../routesV3.client.types';
2
+ import type { ArgsFor, DataShape } from '../../routesV3.client.types';
3
3
  export type RoomsInput = string | string[] | undefined | null;
4
4
  export type RoomState<C extends SocketConnectionConfigOutput> = {
5
5
  rooms: string[];
@@ -11,7 +11,7 @@ export type ToRoomsResult<C extends SocketConnectionConfigOutput> = {
11
11
  joinMeta: SocketSchemaOutput<C['joinMetaMessage']>;
12
12
  leaveMeta: SocketSchemaOutput<C['leaveMetaMessage']>;
13
13
  };
14
- export type ToRoomsMapper<L extends AnyLeafLowProfile, C extends SocketConnectionConfigOutput> = (data: InferOutput<L>, ...args: UseEndpointArgs<L>) => ToRoomsResult<C>;
14
+ export type ToRoomsMapper<L extends AnyLeafLowProfile, C extends SocketConnectionConfigOutput> = (data: InferOutput<L>, args: ArgsFor<L> | undefined) => ToRoomsResult<C>;
15
15
  export declare function roomStateEqual<C extends SocketConnectionConfigOutput>(prev: RoomState<C>, next: RoomState<C>): boolean;
16
16
  export declare function mergeRoomState<L extends AnyLeafLowProfile, C extends SocketConnectionConfigOutput>(prev: RoomState<C>, toRoomsResult: ToRoomsResult<C>): RoomState<C>;
17
- export declare function roomsFromData<L extends AnyLeafLowProfile, C extends SocketConnectionConfigOutput>(data: DataShape<L> | undefined, args: UseEndpointArgs<L>, toRooms: ToRoomsMapper<L, C>): RoomState<C>;
17
+ export declare function roomsFromData<L extends AnyLeafLowProfile, C extends SocketConnectionConfigOutput>(data: DataShape<L> | undefined, args: ArgsFor<L> | undefined, toRooms: ToRoomsMapper<L, C>): RoomState<C>;
@@ -26,7 +26,7 @@ export type SocketedRouteOptions<L extends AnyLeafLowProfile, Events extends Eve
26
26
  [K in keyof Events & string]?: ApplySocket<L, Events[K]>;
27
27
  };
28
28
  /** A hook that returns the SocketClient instance. This is required to access the socket client within the route and apply socket messages. */
29
- useSocketClient: () => SocketClient<Events, C>;
29
+ useSocketClient: () => SocketClient<Events, C> | null;
30
30
  /** Debug options for the socketed route. This is optional and can be used to enable debug logging for the route's internal operations, such as room joining and socket message application.
31
31
  * client: Logs when the socket client becomes available or unavailable.
32
32
  * render: Logs on each render of the route, including whether the client is available and the current rooms.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/rrroutes-client",
3
- "version": "2.6.11",
3
+ "version": "2.6.12",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",