Skip to content

Commit afd0c82

Browse files
committed
udpate api
1 parent 0f2ab34 commit afd0c82

File tree

11 files changed

+28
-37
lines changed

11 files changed

+28
-37
lines changed

packages/calling-component-bindings/src/handlers/createCommonHandlers.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export interface CommonCallingHandlers {
102102
onStartCaptions: (options?: CaptionsOptions) => Promise<void>;
103103
onStopCaptions: () => Promise<void>;
104104
/* @conditional-compile-remove(rtt) */
105-
onSendRealTimeText: (text: string, finalized: boolean) => Promise<void>;
105+
onSendRealTimeText: (text: string, isFinalized: boolean) => Promise<void>;
106106
onSetSpokenLanguage: (language: string) => Promise<void>;
107107
onSetCaptionLanguage: (language: string) => Promise<void>;
108108
onSubmitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined>;
@@ -738,9 +738,9 @@ export const createDefaultCommonCallingHandlers = memoizeOne(
738738
await captionsFeature.setCaptionLanguage(language);
739739
};
740740
/* @conditional-compile-remove(rtt) */
741-
const onSendRealTimeText = async (text: string, finalized: boolean): Promise<void> => {
741+
const onSendRealTimeText = async (text: string, isFinalized: boolean): Promise<void> => {
742742
const realTimeTextFeature = call?.feature(Features.RealTimeText);
743-
await realTimeTextFeature?.sendRealTimeText(text, finalized);
743+
await realTimeTextFeature?.sendRealTimeText(text, isFinalized);
744744
};
745745
const onSubmitSurvey = async (survey: CallSurvey): Promise<CallSurveyResponse | undefined> =>
746746
await call?.feature(Features.CallSurvey).submitSurvey(survey);

packages/calling-stateful-client/src/CallClientState.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ export interface RealTimeTextInfo {
129129
updatedTimestamp?: Date;
130130
/**
131131
* If message originated from the local participant
132+
* default is false
132133
*/
133-
isMe: boolean;
134+
isMe?: boolean;
134135
}
135136

136137
/**

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

+6-17
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export interface CallAdapterCallOperations {
477477
resumeCall(): Promise<void>;
478478
returnFromBreakoutRoom(): Promise<void>;
479479
sendDtmfTone(dtmfTone: DtmfTone_2): Promise<void>;
480-
sendRealTimeText: (text: string, finalized: boolean) => Promise<void>;
480+
sendRealTimeText: (text: string, isFinalized: boolean) => Promise<void>;
481481
setCaptionLanguage(language: string): Promise<void>;
482482
setSpokenLanguage(language: string): Promise<void>;
483483
// @beta
@@ -1318,7 +1318,7 @@ export interface CallWithChatAdapterManagement {
13181318
sendDtmfTone: (dtmfTone: DtmfTone_2) => Promise<void>;
13191319
sendMessage(content: string, options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions): Promise<void>;
13201320
sendReadReceipt(chatMessageId: string): Promise<void>;
1321-
sendRealTimeText: (text: string, finalized: boolean) => Promise<void>;
1321+
sendRealTimeText: (text: string, isFinalized: boolean) => Promise<void>;
13221322
sendTypingIndicator(): Promise<void>;
13231323
setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;
13241324
setCaptionLanguage(language: string): Promise<void>;
@@ -1898,7 +1898,7 @@ export interface CaptionsBannerProps {
18981898
isRealTimeTextOn?: boolean;
18991899
latestLocalRealTimeText?: RealTimeTextInformation;
19001900
onRenderAvatar?: OnRenderAvatarCallback;
1901-
onSendRealTimeText?: (text: string, finalized: boolean) => Promise<void>;
1901+
onSendRealTimeText?: (text: string, isFinalized: boolean) => Promise<void>;
19021902
realTimeTexts?: {
19031903
completedMessages?: RealTimeTextInformation[];
19041904
currentInProgress?: RealTimeTextInformation[];
@@ -2427,7 +2427,7 @@ export interface CommonCallingHandlers {
24272427
// (undocumented)
24282428
onSendDtmfTone: (dtmfTone: DtmfTone_2) => Promise<void>;
24292429
// (undocumented)
2430-
onSendRealTimeText: (text: string, finalized: boolean) => Promise<void>;
2430+
onSendRealTimeText: (text: string, isFinalized: boolean) => Promise<void>;
24312431
// (undocumented)
24322432
onSetCaptionLanguage: (language: string) => Promise<void>;
24332433
// (undocumented)
@@ -4615,7 +4615,7 @@ export interface RealTimeTextCallFeatureState {
46154615
// @beta (undocumented)
46164616
export interface RealTimeTextInfo {
46174617
id: number;
4618-
isMe: boolean;
4618+
isMe?: boolean;
46194619
message: string;
46204620
receivedTimestamp?: Date;
46214621
resultType: RealTimeTextResultType;
@@ -4630,19 +4630,8 @@ export type RealTimeTextInformation = {
46304630
userId?: string;
46314631
message: string;
46324632
isTyping: boolean;
4633-
isMe: boolean;
4634-
finalizedTimeStamp: Date;
4635-
};
4636-
4637-
// @beta
4638-
export type RealTimeTextInformation = {
4639-
id: number;
4640-
displayName: string;
4641-
userId?: string;
4642-
message: string;
4643-
isTyping: boolean;
4644-
isMe: boolean;
46454633
finalizedTimeStamp: Date;
4634+
isMe?: boolean;
46464635
};
46474636

46484637
// @beta

packages/react-components/src/components/CaptionsBanner.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,15 @@ export type RealTimeTextInformation = {
8080
* if the real time text received is partial
8181
*/
8282
isTyping: boolean;
83-
/**
84-
* If message originated from the local participant
85-
*/
86-
isMe: boolean;
8783
/**
8884
* timestamp when the real time text was finalized
8985
*/
9086
finalizedTimeStamp: Date;
87+
/**
88+
* If message originated from the local participant
89+
* default value is false
90+
*/
91+
isMe?: boolean;
9192
};
9293
/**
9394
* @public
@@ -177,7 +178,7 @@ export interface CaptionsBannerProps {
177178
/**
178179
* Optional callback to send real time text.
179180
*/
180-
onSendRealTimeText?: (text: string, finalized: boolean) => Promise<void>;
181+
onSendRealTimeText?: (text: string, isFinalized: boolean) => Promise<void>;
181182
/* @conditional-compile-remove(rtt) */
182183
/**
183184
* Latest local real time text

packages/react-composites/src/composites/CallComposite/MockCallAdapter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class _MockCallAdapter implements CallAdapter {
190190
throw Error('stopCaptions not implemented');
191191
}
192192
/* @conditional-compile-remove(rtt) */
193-
sendRealTimeText(text: string, finalized: boolean): Promise<void> {
193+
sendRealTimeText(text: string, isFinalized: boolean): Promise<void> {
194194
throw Error('sendRealTimeText not implemented');
195195
}
196196

packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,8 @@ export class AzureCommunicationCallAdapter<AgentType extends CallAgent | TeamsCa
11571157
this.handlers.onSetSpokenLanguage(language);
11581158
}
11591159
/* @conditional-compile-remove(rtt) */
1160-
public async sendRealTimeText(text: string, finalized: boolean): Promise<void> {
1161-
this.handlers.onSendRealTimeText(text, finalized);
1160+
public async sendRealTimeText(text: string, isFinalized: boolean): Promise<void> {
1161+
this.handlers.onSendRealTimeText(text, isFinalized);
11621162
}
11631163
public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {
11641164
return this.handlers.onSubmitSurvey(survey);

packages/react-composites/src/composites/CallComposite/adapter/CallAdapter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ export interface CallAdapterCallOperations {
862862
* @param text - real time text content
863863
* @param finalized - Boolean to indicate if the real time text is final
864864
*/
865-
sendRealTimeText: (text: string, finalized: boolean) => Promise<void>;
865+
sendRealTimeText: (text: string, isFinalized: boolean) => Promise<void>;
866866
}
867867

868868
/**

packages/react-composites/src/composites/CallComposite/hooks/useHandlers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ const createCompositeHandlers = memoizeOne(
294294
return await adapter.disposeTogetherModeStreamView();
295295
},
296296
/* @conditional-compile-remove(rtt) */
297-
onSendRealTimeText: async (text: string, finalized: boolean) => {
298-
return await adapter.sendRealTimeText(text, finalized);
297+
onSendRealTimeText: async (text: string, isFinalized: boolean) => {
298+
return await adapter.sendRealTimeText(text, isFinalized);
299299
}
300300
};
301301
}

packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,8 @@ export class AzureCommunicationCallWithChatAdapter implements CallWithChatAdapte
659659
await this.callAdapter.setSpokenLanguage(language);
660660
}
661661
/* @conditional-compile-remove(rtt) */
662-
public async sendRealTimeText(text: string, finalized: boolean): Promise<void> {
663-
await this.callAdapter.sendRealTimeText(text, finalized);
662+
public async sendRealTimeText(text: string, isFinalized: boolean): Promise<void> {
663+
await this.callAdapter.sendRealTimeText(text, isFinalized);
664664
}
665665

666666
public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {

packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ export interface CallWithChatAdapterManagement {
590590
* @param text - real time text content
591591
* @param finalized - Boolean to indicate if the real time text is final
592592
*/
593-
sendRealTimeText: (text: string, finalized: boolean) => Promise<void>;
593+
sendRealTimeText: (text: string, isFinalized: boolean) => Promise<void>;
594594
}
595595

596596
/**

packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ export class CallWithChatBackedCallAdapter implements CallAdapter {
205205
await this.callWithChatAdapter.setSpokenLanguage(language);
206206
}
207207
/* @conditional-compile-remove(rtt) */
208-
public async sendRealTimeText(text: string, finalized: boolean): Promise<void> {
209-
await this.callWithChatAdapter.sendRealTimeText(text, finalized);
208+
public async sendRealTimeText(text: string, isFinalized: boolean): Promise<void> {
209+
await this.callWithChatAdapter.sendRealTimeText(text, isFinalized);
210210
}
211211

212212
public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {

0 commit comments

Comments
 (0)