@@ -166,11 +166,15 @@ export interface AttachmentMetadata {
166166 extension? : string ;
167167 id: string ;
168168 name: string ;
169- progress? : number ;
170- uploadError? : AttachmentUploadStatus ;
171169 url? : string ;
172170}
173171
172+ // @beta
173+ export interface AttachmentMetadataWithProgress extends AttachmentMetadata {
174+ error? : AttachmentProgressError ;
175+ progress? : number ;
176+ }
177+
174178// @beta
175179export interface AttachmentOptions {
176180 // (undocumented)
@@ -179,16 +183,28 @@ export interface AttachmentOptions {
179183 uploadOptions? : AttachmentUploadOptions ;
180184}
181185
182- // @beta (undocumented)
183- export interface AttachmentUploadAdapter {
186+ // @beta
187+ export interface AttachmentProgressError {
188+ // (undocumented)
189+ message: string ;
190+ }
191+
192+ // @beta
193+ export type AttachmentRemovalHandler = (attachmentId : string ) => void ;
194+
195+ // @beta
196+ export type AttachmentSelectionHandler = (attachmentUploads : AttachmentUploadTask []) => void ;
197+
198+ // @internal (undocumented)
199+ export interface _AttachmentUploadAdapter {
184200 // (undocumented)
185201 cancelUpload: (id : string ) => void ;
186202 // (undocumented)
187203 clearUploads: () => void ;
188204 // (undocumented)
189- registerActiveUploads: (files : File []) => AttachmentUploadManager [];
205+ registerActiveUploads: (files : File []) => AttachmentUploadTask [];
190206 // (undocumented)
191- registerCompletedUploads: (metadata : AttachmentMetadata []) => AttachmentUploadManager [];
207+ registerCompletedUploads: (metadata : AttachmentMetadata []) => AttachmentUploadTask [];
192208 // (undocumented)
193209 updateUploadMetadata: (id : string , metadata : AttachmentMetadata ) => void ;
194210 // (undocumented)
@@ -197,35 +213,25 @@ export interface AttachmentUploadAdapter {
197213 updateUploadStatusMessage: (id : string , errorMessage : string ) => void ;
198214}
199215
200- // @beta
201- export type AttachmentUploadHandler = (attachmentUploads : AttachmentUploadManager []) => void ;
202-
203- // @beta
204- export interface AttachmentUploadManager {
205- file? : File ;
206- id: string ;
207- notifyCompleted: (metadata : AttachmentMetadata ) => void ;
208- notifyFailed: (message : string ) => void ;
209- notifyProgressChanged: (value : number ) => void ;
210- }
211-
212216// @beta (undocumented)
213217export interface AttachmentUploadOptions {
214218 disableMultipleUploads? : boolean ;
215- handler: AttachmentUploadHandler ;
219+ handleAttachmentRemoval? : AttachmentRemovalHandler ;
220+ handleAttachmentSelection: AttachmentSelectionHandler ;
216221 supportedMediaTypes? : string [];
217222}
218223
219- // @beta
220- export interface AttachmentUploadStatus {
221- // (undocumented)
222- message: string ;
223- // (undocumented)
224- timestamp: number ;
225- }
224+ // @internal
225+ export type _AttachmentUploadsUiState = Record <string , AttachmentMetadataWithProgress >;
226226
227227// @beta
228- export type AttachmentUploadsUiState = Record <string , AttachmentMetadata >;
228+ export interface AttachmentUploadTask {
229+ file? : File ;
230+ notifyUploadCompleted: (id : string , url : string ) => void ;
231+ notifyUploadFailed: (message : string ) => void ;
232+ notifyUploadProgressChanged: (value : number ) => void ;
233+ taskId: string ;
234+ }
229235
230236// @public
231237export type AvatarPersonaData = {
@@ -1078,9 +1084,9 @@ export interface CallWithChatAdapterManagement {
10781084 addParticipant(participant : CommunicationUserIdentifier ): Promise <void >;
10791085 allowUnsupportedBrowserVersion(): void ;
10801086 askDevicePermission(constrain : PermissionConstraints ): Promise <void >;
1081- // @beta (undocumented)
1087+ // @internal (undocumented)
10821088 cancelUpload: (id : string ) => void ;
1083- // @beta (undocumented)
1089+ // @internal (undocumented)
10841090 clearUploads: () => void ;
10851091 createStreamView(remoteUserId ? : string , options ? : VideoStreamOptions ): Promise <void | CreateVideoStreamViewResult >;
10861092 deleteMessage(messageId : string ): Promise <void >;
@@ -1105,10 +1111,10 @@ export interface CallWithChatAdapterManagement {
11051111 queryMicrophones(): Promise <AudioDeviceInfo []>;
11061112 querySpeakers(): Promise <AudioDeviceInfo []>;
11071113 raiseHand(): Promise <void >;
1108- // @beta (undocumented)
1109- registerActiveUploads: (files : File []) => AttachmentUploadManager [];
1110- // @beta (undocumented)
1111- registerCompletedUploads: (metadata : AttachmentMetadata []) => AttachmentUploadManager [];
1114+ // @internal (undocumented)
1115+ registerActiveUploads: (files : File []) => AttachmentUploadTask [];
1116+ // @internal (undocumented)
1117+ registerCompletedUploads: (metadata : AttachmentMetadata []) => AttachmentUploadTask [];
11121118 removeParticipant(userId : string ): Promise <void >;
11131119 // @beta
11141120 removeParticipant(participant : CommunicationIdentifier ): Promise <void >;
@@ -1118,6 +1124,8 @@ export interface CallWithChatAdapterManagement {
11181124 resumeCall: () => Promise <void >;
11191125 sendDtmfTone: (dtmfTone : DtmfTone_2 ) => Promise <void >;
11201126 sendMessage(content : string , options ? : SendMessageOptions ): Promise <void >;
1127+ // @beta
1128+ sendMessageWithAttachments(content : string , attachments : AttachmentMetadata []): Promise <void >;
11211129 sendReadReceipt(chatMessageId : string ): Promise <void >;
11221130 sendTypingIndicator(): Promise <void >;
11231131 setCamera(sourceInfo : VideoDeviceInfo , options ? : VideoStreamOptions ): Promise <void >;
@@ -1143,11 +1151,11 @@ export interface CallWithChatAdapterManagement {
11431151 updateBackgroundPickerImages(backgroundImages : VideoBackgroundImage []): void ;
11441152 updateMessage(messageId : string , content : string , metadata ? : Record <string , string >): Promise <void >;
11451153 updateSelectedVideoBackgroundEffect(selectedVideoBackground : VideoBackgroundEffect ): void ;
1146- // @beta (undocumented)
1154+ // @internal (undocumented)
11471155 updateUploadMetadata: (id : string , metadata : AttachmentMetadata ) => void ;
1148- // @beta (undocumented)
1156+ // @internal (undocumented)
11491157 updateUploadProgress: (id : string , progress : number ) => void ;
1150- // @beta (undocumented)
1158+ // @internal (undocumented)
11511159 updateUploadStatusMessage: (id : string , errorMessage : string ) => void ;
11521160}
11531161
@@ -1261,8 +1269,8 @@ export interface CallWithChatAdapterSubscriptions {
12611269
12621270// @public
12631271export interface CallWithChatAdapterUiState {
1264- // @beta
1265- attachmentUploads ? : AttachmentUploadsUiState ;
1272+ // @internal
1273+ _attachmentUploads ? : _AttachmentUploadsUiState ;
12661274 isLocalPreviewMicrophoneEnabled: boolean ;
12671275 page: CallCompositePage ;
12681276 // @beta
@@ -1677,7 +1685,7 @@ export type CaptionsReceivedListener = (event: {
16771685}) => void ;
16781686
16791687// @public
1680- export type ChatAdapter = ChatAdapterThreadManagement & AdapterState <ChatAdapterState > & Disposable_2 & ChatAdapterSubscribers & AttachmentUploadAdapter ;
1688+ export type ChatAdapter = ChatAdapterThreadManagement & AdapterState <ChatAdapterState > & Disposable_2 & ChatAdapterSubscribers & _AttachmentUploadAdapter ;
16811689
16821690// @public
16831691export type ChatAdapterState = ChatAdapterUiState & ChatCompositeClientState ;
@@ -1713,6 +1721,7 @@ export interface ChatAdapterThreadManagement {
17131721 removeParticipant(userId : string ): Promise <void >;
17141722 removeResourceFromCache(resourceDetails : ResourceDetails ): void ;
17151723 sendMessage(content : string , options ? : SendMessageOptions ): Promise <void >;
1724+ sendMessageWithAttachments(content : string , attachments : AttachmentMetadata []): Promise <void >;
17161725 sendReadReceipt(chatMessageId : string ): Promise <void >;
17171726 sendTypingIndicator(): Promise <void >;
17181727 setTopic(topicName : string ): Promise <void >;
@@ -1724,7 +1733,7 @@ export interface ChatAdapterThreadManagement {
17241733// @public
17251734export type ChatAdapterUiState = {
17261735 error? : Error ;
1727- attachmentUploads ? : AttachmentUploadsUiState ;
1736+ _attachmentUploads ? : _AttachmentUploadsUiState ;
17281737};
17291738
17301739// @public
@@ -3882,7 +3891,7 @@ export const RichTextSendBox: (props: RichTextSendBoxProps) => JSX.Element;
38823891
38833892// @beta
38843893export interface RichTextSendBoxProps {
3885- activeAttachmentUploads ? : AttachmentMetadata [];
3894+ attachmentsWithProgress ? : AttachmentMetadataWithProgress [];
38863895 autoFocus? : ' sendBoxTextField' ;
38873896 disabled? : boolean ;
38883897 onCancelAttachmentUpload? : (attachmentId : string ) => void ;
@@ -3954,7 +3963,7 @@ export interface SendBoxErrorBarError {
39543963// @public
39553964export interface SendBoxProps {
39563965 // @beta
3957- activeAttachmentUploads ? : AttachmentMetadata [];
3966+ attachmentsWithProgress ? : AttachmentMetadataWithProgress [];
39583967 autoFocus? : ' sendBoxTextField' ;
39593968 disabled? : boolean ;
39603969 // @beta
0 commit comments