Skip to content

Commit 05d29fc

Browse files
Revert "Fix returned types for useChatPropsFor and useCallingPropsFo (#5723)" (#5726)
This reverts commit 03759ec.
1 parent 03759ec commit 05d29fc

5 files changed

+8
-26
lines changed

change-beta/@azure-communication-react-364a17bc-d253-45ca-8155-63469c3e5c64.json

-9
This file was deleted.

change/@azure-communication-react-364a17bc-d253-45ca-8155-63469c3e5c64.json

-9
This file was deleted.

packages/communication-react/review/beta/communication-react.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5495,13 +5495,13 @@ export const useCallAgent: () => CallAgent | undefined;
54955495
export const useCallClient: () => StatefulCallClient;
54965496

54975497
// @public
5498-
export const useCallingPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => CallingReturnProps<Component>;
5498+
export const useCallingPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ComponentProps<Component>;
54995499

55005500
// @public
55015501
export const useChatClient: () => StatefulChatClient;
55025502

55035503
// @public
5504-
export const useChatPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ChatReturnProps<Component>;
5504+
export const useChatPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ComponentProps<Component>;
55055505

55065506
// @public
55075507
export const useChatThreadClient: () => ChatThreadClient;

packages/communication-react/review/stable/communication-react.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4744,13 +4744,13 @@ export const useCallAgent: () => CallAgent | undefined;
47444744
export const useCallClient: () => StatefulCallClient;
47454745

47464746
// @public
4747-
export const useCallingPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => CallingReturnProps<Component>;
4747+
export const useCallingPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ComponentProps<Component>;
47484748

47494749
// @public
47504750
export const useChatClient: () => StatefulChatClient;
47514751

47524752
// @public
4753-
export const useChatPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ChatReturnProps<Component>;
4753+
export const useChatPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ComponentProps<Component>;
47544754

47554755
// @public
47564756
export const useChatThreadClient: () => ChatThreadClient;

packages/communication-react/src/mergedHooks.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ export const usePropsFor = <Component extends (props: any) => JSX.Element>(
159159
*/
160160
export const useChatPropsFor = <Component extends (props: any) => JSX.Element>(
161161
component: Component
162-
): ChatReturnProps<Component> => {
162+
): ComponentProps<Component> => {
163163
const props = useChatPropsForInternal(component);
164164
if (props === undefined) {
165165
throw new Error(
166166
'Could not find props for this component, ensure the component is wrapped by appropriate providers.'
167167
);
168168
}
169-
return props as ChatReturnProps<Component>;
169+
return props as ComponentProps<Component>;
170170
};
171171

172172
/**
@@ -178,12 +178,12 @@ export const useChatPropsFor = <Component extends (props: any) => JSX.Element>(
178178
*/
179179
export const useCallingPropsFor = <Component extends (props: any) => JSX.Element>(
180180
component: Component
181-
): CallingReturnProps<Component> => {
181+
): ComponentProps<Component> => {
182182
const props = useCallingPropsForInternal(component);
183183
if (props === undefined) {
184184
throw new Error(
185185
'Could not find props for this component, ensure the component is wrapped by appropriate providers.'
186186
);
187187
}
188-
return props as CallingReturnProps<Component>;
188+
return props as ComponentProps<Component>;
189189
};

0 commit comments

Comments
 (0)