Skip to content

Commit 1f0df23

Browse files
author
Ron Radtke
committed
bit of documentation and renaming
1 parent a83379e commit 1f0df23

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ public void createMediaFile(ReadableMap filedata, String mt, Promise promise) {
437437
}
438438

439439
@ReactMethod
440-
public void writeToMediaFile(String fileUri, String data, Promise promise) {
441-
ReactNativeBlobUtilMediaCollection.writeToMediaFile(Uri.parse(fileUri), data, promise);
440+
public void writeToMediaFile(String fileUri, String path, Promise promise) {
441+
ReactNativeBlobUtilMediaCollection.writeToMediaFile(Uri.parse(fileUri), path, promise);
442442
}
443443

444444
@ReactMethod

index.d.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,24 @@ export interface MediaCollection {
790790
*/
791791
createMediafile(filedata: { name: string, parentFolder: string, mimeType: string }, mediatype: Mediatype): Promise<string>;
792792

793-
writeToMediafile(uri: string, data: string)
793+
/**
794+
* Copies an existing file to a mediastore file
795+
* @param uri URI of the destination mediastore file
796+
* @param path Path to the existing file which should be copied
797+
*/
798+
writeToMediafile(uri: string, path: string)
794799

800+
/**
801+
* Copies a file from the mediastore to the apps internal storage
802+
* @param contenturi URI of the mediastore file
803+
* @param destpath Path for the file in the internal storage
804+
*/
795805
copyToInternal(contenturi: string, destpath: string)
796806

807+
/**
808+
* Gets the blob data for a given URI in the mediastore
809+
* @param contenturi
810+
* @param encoding
811+
*/
797812
getBlob(contenturi: string, encoding: string)
798813
}

mediacollection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function createMediafile(filedata: Object<{ path: string, parentFolder: string,
88
return ReactNativeBlobUtil.createMediaFile(filedata, mediatype);
99
}
1010

11-
function writeToMediafile(uri: string, data: string) {
12-
return ReactNativeBlobUtil.writeToMediaFile(uri, data);
11+
function writeToMediafile(uri: string, path: string) {
12+
return ReactNativeBlobUtil.writeToMediaFile(uri, path);
1313
}
1414

1515
function copyToInternal(contenturi: string, destpath: string) {

0 commit comments

Comments
 (0)