Can you rename it to PromiseCapability and define this type above? See example at https://github.com/mozilla/pdf.js/blob/master/src/display/api.js#L359