Alex here from Uploadcare support. Thanks for the question!
The __items array contains instances of files loaded to the widget (the same list that you can see on the preview tab). A file instance is a promise-like object, and you can use its done method to get file information. For example,
The uploadcare.fileFrom('uploaded', uuid, settings) method returns a file instance as well. From the fileInfo object, you can get UUID of the file and use it to compare files to find if they are the same.
That answers my question, thanks! With code like Promise.all(dialogApi.fileColl.__items).then(...) I can check if the uuid already exists and not add the item a second time.
But this leads me to a design problem: The intent is to allow the user to unselect previously selected items within the custom tab, which would require a removeFiles method, but I don’t believe one exists. Unless I am wrong there isn’t a way to remove files from the Preview tab / filesColl array programmatically?
And another question, I would need to deselect items in my Media Library state when they are removed from the Preview tab. Could you provide an example of how I would subscribe to an event like dialogApi.fileColl.onRemove?
Thanks again for the response, looking forward to your reply!