@liveblocks/react 0.17.0-beta1 → 0.17.0-beta2

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/index.d.ts +13 -10
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -56,16 +56,19 @@ declare function createRoomContext<
56
56
  TPresence extends JsonObject,
57
57
  TStorage extends LsonObject = LsonObject,
58
58
  TUserMeta extends BaseUserMeta = BaseUserMeta,
59
- TEvent extends Json = never
59
+ TRoomEvent extends Json = never
60
60
  >(
61
61
  client: Client
62
62
  ): {
63
63
  RoomProvider: (props: RoomProviderProps<TPresence, TStorage>) => JSX.Element;
64
64
  useBatch: () => (callback: () => void) => void;
65
- useBroadcastEvent: () => (event: TEvent, options?: BroadcastOptions) => void;
65
+ useBroadcastEvent: () => (
66
+ event: TRoomEvent,
67
+ options?: BroadcastOptions
68
+ ) => void;
66
69
  useErrorListener: (callback: (err: Error) => void) => void;
67
70
  useEventListener: (
68
- callback: (eventData: { connectionId: number; event: TEvent }) => void
71
+ callback: (eventData: { connectionId: number; event: TRoomEvent }) => void
69
72
  ) => void;
70
73
  useHistory: () => History;
71
74
  useList: <TKey extends Extract<keyof TStorage, string>>(
@@ -88,7 +91,7 @@ declare function createRoomContext<
88
91
  ) => TStorage[TKey_2] | null;
89
92
  useOthers: () => Others<TPresence, TUserMeta>;
90
93
  useRedo: () => () => void;
91
- useRoom: () => Room<TPresence, TStorage, TUserMeta, TEvent>;
94
+ useRoom: () => Room<TPresence, TStorage, TUserMeta, TRoomEvent>;
92
95
  useSelf: () => User<TPresence, TUserMeta> | null;
93
96
  useStorage: () => [root: LiveObject<TStorage> | null];
94
97
  useUndo: () => () => void;
@@ -151,8 +154,8 @@ declare function useBatch(): (callback: () => void) => void;
151
154
  * `useBroadcastEvent` from `@liveblocks/react` directly. See
152
155
  * https://liveblocks.io/docs/guides/upgrading#upgrading-from-0-16-to-0-17 for details.
153
156
  */
154
- declare function useBroadcastEvent<TEvent extends Json>(): (
155
- event: TEvent,
157
+ declare function useBroadcastEvent<TRoomEvent extends Json>(): (
158
+ event: TRoomEvent,
156
159
  options?: BroadcastOptions
157
160
  ) => void;
158
161
  /**
@@ -166,8 +169,8 @@ declare function useErrorListener(callback: (err: Error) => void): void;
166
169
  * `useEventListener` from `@liveblocks/react` directly. See
167
170
  * https://liveblocks.io/docs/guides/upgrading#upgrading-from-0-16-to-0-17 for details.
168
171
  */
169
- declare function useEventListener<TEvent extends Json>(
170
- callback: (eventData: { connectionId: number; event: TEvent }) => void
172
+ declare function useEventListener<TRoomEvent extends Json>(
173
+ callback: (eventData: { connectionId: number; event: TRoomEvent }) => void
171
174
  ): void;
172
175
  /**
173
176
  * @deprecated Please use `createRoomContext()` instead of importing
@@ -213,8 +216,8 @@ declare function useRoom<
213
216
  TPresence extends JsonObject,
214
217
  TStorage extends LsonObject,
215
218
  TUserMeta extends BaseUserMeta,
216
- TEvent extends Json
217
- >(): Room<TPresence, TStorage, TUserMeta, TEvent>;
219
+ TRoomEvent extends Json
220
+ >(): Room<TPresence, TStorage, TUserMeta, TRoomEvent>;
218
221
  /**
219
222
  * @deprecated Please use `createRoomContext()` instead of importing
220
223
  * `useSelf` from `@liveblocks/react` directly. See
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react",
3
- "version": "0.17.0-beta1",
3
+ "version": "0.17.0-beta2",
4
4
  "description": "A set of React hooks and providers to use Liveblocks declaratively.",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "license": "Apache-2.0",
31
31
  "peerDependencies": {
32
- "@liveblocks/client": "0.17.0-beta1",
32
+ "@liveblocks/client": "0.17.0-beta2",
33
33
  "react": "^16.14.0 || ^17 || ^18"
34
34
  },
35
35
  "devDependencies": {