diff --git a/src/asset_manager/view/FileUploader.ts b/src/asset_manager/view/FileUploader.ts index 9ef69c8e5..ec51c40ee 100644 --- a/src/asset_manager/view/FileUploader.ts +++ b/src/asset_manager/view/FileUploader.ts @@ -392,7 +392,7 @@ export default class FileUploaderView extends View { promises.push(promise); } - Promise.all(promises).then( + return Promise.all(promises).then( data => { response.data = data; // @ts-ignore diff --git a/src/utils/fetch.ts b/src/utils/fetch.ts index 9205fe6c5..32c4285cb 100644 --- a/src/utils/fetch.ts +++ b/src/utils/fetch.ts @@ -1,4 +1,3 @@ -// @ts-ignore import Promise from 'promise-polyfill'; import { hasWin } from './mixins'; @@ -10,7 +9,7 @@ export default typeof fetch == 'function' ? // @ts-ignore fetch.bind() : (url: string, options: Record) => { - return new Promise((res: any, rej: any) => { + return new Promise((res, rej) => { const req = new XMLHttpRequest(); req.open(options.method || 'get', url); req.withCredentials = options.credentials == 'include'; diff --git a/src/utils/promise-polyfill.d.ts b/src/utils/promise-polyfill.d.ts new file mode 100644 index 000000000..7a63bf53c --- /dev/null +++ b/src/utils/promise-polyfill.d.ts @@ -0,0 +1,4 @@ +declare module 'promise-polyfill' { + const defType: PromiseConstructor; + export default defType; +}