Skip to content

Commit 03759ec

Browse files
Fix returned types for useChatPropsFor and useCallingPropsFo (#5723)
1 parent 33321e6 commit 03759ec

5 files changed

+26
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "improvement",
4+
"workstream": "",
5+
"comment": "Fix returned types for useChatPropsFor and useCallingPropsFor",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "improvement",
4+
"workstream": "",
5+
"comment": "Fix returned types for useChatPropsFor and useCallingPropsFor",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}

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) => ComponentProps<Component>;
5498+
export const useCallingPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => CallingReturnProps<Component>;
54995499

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

55035503
// @public
5504-
export const useChatPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ComponentProps<Component>;
5504+
export const useChatPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ChatReturnProps<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) => ComponentProps<Component>;
4747+
export const useCallingPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => CallingReturnProps<Component>;
47484748

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

47524752
// @public
4753-
export const useChatPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ComponentProps<Component>;
4753+
export const useChatPropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => ChatReturnProps<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-
): ComponentProps<Component> => {
162+
): ChatReturnProps<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 ComponentProps<Component>;
169+
return props as ChatReturnProps<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-
): ComponentProps<Component> => {
181+
): CallingReturnProps<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 ComponentProps<Component>;
188+
return props as CallingReturnProps<Component>;
189189
};

0 commit comments

Comments
 (0)