diff --git a/src/plugins/file.ts b/src/plugins/file.ts index 2ad7defa..1a1e8e71 100644 --- a/src/plugins/file.ts +++ b/src/plugins/file.ts @@ -658,12 +658,12 @@ export class File { * * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above * @param {string} fileName path relative to base path - * @param {string} text content to write + * @param {string | Blob} text content or blob to write * @param {boolean | WriteOptions} replaceOrOptions replace file if set to true. See WriteOptions for more information. * @returns {Promise} Returns a Promise that resolves or rejects with an error. */ static writeFile(path: string, fileName: string, - text: string, replaceOrOptions: boolean | WriteOptions): Promise { + text: string | Blob, replaceOrOptions: boolean | WriteOptions): Promise { if ((/^\//.test(fileName))) { let err = new FileError(5); err.message = 'file-name cannot start with \/'; @@ -701,10 +701,10 @@ export class File { * * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above * @param {string} fileName path relative to base path - * @param {string} text content to write + * @param {string | Blob} text content or blob to write * @returns {Promise} Returns a Promise that resolves or rejects with an error. */ - static writeExistingFile(path: string, fileName: string, text: string): Promise { + static writeExistingFile(path: string, fileName: string, text: string | Blob): Promise { if ((/^\//.test(fileName))) { let err = new FileError(5); err.message = 'file-name cannot start with \/';