We don't have the similar patter for those APIs, however I think they shall look the same. We should add loadDocument (to not change getDocument) that will return loadingTask and have the following properties there:
- promise - returns promise similar to getDocument one
- cancel - allows to cancel loading
- onPassword - callback for password
- onProgress - callback for progress
The render task of PDFPage can contain 'onProgress' that will replace 'continueCallback'
As I mentioned in #2923, We probably shall return a Promise to indicate the complete abortion of the loading process or page rendering to properly cleanup. The alternative to ensure that cancel is synchronous method and guarantee that all fonts, xhr, and page/image/references parsing properly cancelled.