You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "erisu (via GitHub)" <gi...@apache.org> on 2023/02/06 11:20:40 UTC

[GitHub] [cordova-plugin-file] erisu commented on pull request #536: fix(types): Adjust types to fix incompatibilities with TypeScript 4.4+

erisu commented on PR #536:
URL: https://github.com/apache/cordova-plugin-file/pull/536#issuecomment-1418922705

   I dont use TypeScript much to be able to confirm the changes but see if someone can take a look and review.
   
   From my own understanding, these changes do not appear to be correct, but can you explain to me why they would be considered correct?
   
   For example.
   
   Before PR:
   ```ts
       getParent(successCallback: (entry: Entry) => void,
           errorCallback?: (error: FileError) => void): void;
   ```
   
   After PR:
   ```ts
       getParent(successCallback?: (entry: Entry) => void,
           errorCallback?: (error: DOMException) => void): void;
   ```
   
   This is telling users that the error's callback error property is `DOMException` but when looking at the actual code, this is not true.
   
   The [`getParent` method in the `Entry.js`](https://github.com/apache/cordova-plugin-file/blob/master/www/Entry.js#L255) file, is clearly passing the [`FileError`](https://github.com/apache/cordova-plugin-file/blob/master/www/FileError.js)
   
   `FileError.js` appears to have added extra APIs for the File API specification.
   
   Same with the `getFile` and `getDirectory` method. It changes the success callback to `Entry` but in code respecticly it returns `FileEntry` and `DirectoryEntry`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org