Skip to content

Commit 856d320

Browse files
author
hannojg
committed
Added types for uploading content api
1 parent abff9cb commit 856d320

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

types/index.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ declare interface SuccessResponse {
7070
success: string;
7171
}
7272

73+
/**
74+
* The key is the upload it, the value is the mxc uri.
75+
*/
76+
declare interface SuccessUploadResponse {
77+
[key: string]: string
78+
}
79+
7380
declare module 'react-native-matrix-sdk' {
7481
import {EventSubscriptionVendor} from "react-native";
7582

@@ -211,6 +218,16 @@ declare module 'react-native-matrix-sdk' {
211218
*/
212219
setUserDisplayName(displayName: string): Promise<void>;
213220

221+
/**
222+
* Uploads content to the matrix content respository of the connected homeserver.
223+
* @return {@see #SuccessUploadResponse}
224+
* @param fileUri the absolute file path to the file to be uploaded
225+
* @param fileName the file name of the file
226+
* @param mimeType like "audio/aac", "image/jpeg"
227+
* @param uploadId an upload id for reference.
228+
*/
229+
uploadContent(fileUri: string, fileName: string, mimeType: string, uploadId: string): Promise<SuccessUploadResponse>
230+
214231
/**
215232
* Sends m.typing event into the specified room that the user is typing.
216233
* @param roomId

0 commit comments

Comments
 (0)