Skip to content

Commit de6e0dc

Browse files
committed
fix: add api-extractor data
1 parent 1e7b44e commit de6e0dc

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

packages/react/etc/components-react.api.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,12 +1079,12 @@ export interface UseRoomInfoOptions {
10791079
}
10801080

10811081
// @public
1082-
export function useSequentialRoomConnectDisconnect(room: Room): UseSequentialRoomConnectDisconnectResults;
1082+
export function useSequentialRoomConnectDisconnect<R extends Room | undefined>(room: R): UseSequentialRoomConnectDisconnectResults<R>;
10831083

10841084
// @public (undocumented)
1085-
export type UseSequentialRoomConnectDisconnectResults = {
1086-
connect: typeof Room.prototype.connect;
1087-
disconnect: typeof Room.prototype.disconnect;
1085+
export type UseSequentialRoomConnectDisconnectResults<R extends Room | undefined> = {
1086+
connect: R extends undefined ? RoomConnectFn | null : RoomConnectFn;
1087+
disconnect: R extends undefined ? RoomDisconnectFn | null : RoomDisconnectFn;
10881088
};
10891089

10901090
// @public
@@ -1291,6 +1291,8 @@ export { WidgetState }
12911291
//
12921292
// src/context/layout-context.ts:10:3 - (ae-forgotten-export) The symbol "PinContextType" needs to be exported by the entry point index.docs.d.ts
12931293
// src/context/layout-context.ts:11:3 - (ae-forgotten-export) The symbol "WidgetContextType" needs to be exported by the entry point index.docs.d.ts
1294+
// src/hooks/useSequentialRoomConnectDisconnect.ts:16:3 - (ae-forgotten-export) The symbol "RoomConnectFn" needs to be exported by the entry point index.docs.d.ts
1295+
// src/hooks/useSequentialRoomConnectDisconnect.ts:17:3 - (ae-forgotten-export) The symbol "RoomDisconnectFn" needs to be exported by the entry point index.docs.d.ts
12941296

12951297
// (No @packageDocumentation comment for this package)
12961298

packages/react/src/hooks/useSequentialRoomConnectDisconnect.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ const CONNECT_DISCONNECT_WARNING_THRESHOLD_MS = 400;
88
const ROOM_CHANGE_WARNING_THRESHOLD_QUANTITY = 3;
99
const ROOM_CHANGE_WARNING_THRESHOLD_MS = 1000;
1010

11-
type RoomConnectFn = typeof Room.prototype.connect;
12-
type RoomDisconnectFn = typeof Room.prototype.disconnect;
13-
1411
/** @public */
1512
export type UseSequentialRoomConnectDisconnectResults<R extends Room | undefined> = {
16-
connect: R extends undefined ? RoomConnectFn | null : RoomConnectFn;
17-
disconnect: R extends undefined ? RoomDisconnectFn | null : RoomDisconnectFn;
13+
connect: R extends undefined ? (typeof Room.prototype.connect) | null : (typeof Room.prototype.connect);
14+
disconnect: R extends undefined ? (typeof Room.prototype.disconnect) | null : (typeof Room.prototype.disconnect);
1815
};
1916

2017
/**
@@ -44,15 +41,15 @@ export function useSequentialRoomConnectDisconnect<R extends Room | undefined>(
4441
| {
4542
type: 'connect';
4643
room: Room;
47-
args: Parameters<RoomConnectFn>;
48-
resolve: (value: Awaited<ReturnType<RoomConnectFn>>) => void;
44+
args: Parameters<(typeof Room.prototype.connect)>;
45+
resolve: (value: Awaited<ReturnType<(typeof Room.prototype.connect)>>) => void;
4946
reject: (err: Error) => void;
5047
}
5148
| {
5249
type: 'disconnect';
5350
room: Room;
54-
args: Parameters<RoomDisconnectFn>;
55-
resolve: (value: Awaited<ReturnType<RoomDisconnectFn>>) => void;
51+
args: Parameters<(typeof Room.prototype.disconnect)>;
52+
resolve: (value: Awaited<ReturnType<(typeof Room.prototype.disconnect)>>) => void;
5653
reject: (err: Error) => void;
5754
}
5855
>
@@ -136,7 +133,7 @@ export function useSequentialRoomConnectDisconnect<R extends Room | undefined>(
136133
}, []);
137134

138135
const connect = useCallback(
139-
async (...args: Parameters<RoomConnectFn>) => {
136+
async (...args: Parameters<(typeof Room.prototype.connect)>) => {
140137
return new Promise((resolve, reject) => {
141138
if (!room) {
142139
throw new Error('Called connect(), but room was unset');
@@ -152,7 +149,7 @@ export function useSequentialRoomConnectDisconnect<R extends Room | undefined>(
152149
);
153150

154151
const disconnect = useCallback(
155-
async (...args: Parameters<RoomDisconnectFn>) => {
152+
async (...args: Parameters<(typeof Room.prototype.disconnect)>) => {
156153
return new Promise((resolve, reject) => {
157154
if (!room) {
158155
throw new Error('Called discconnect(), but room was unset');

0 commit comments

Comments
 (0)