diff --git a/src/utils/fetch.js b/src/utils/fetch.ts similarity index 86% rename from src/utils/fetch.js rename to src/utils/fetch.ts index f506b1d73..9205fe6c5 100644 --- a/src/utils/fetch.js +++ b/src/utils/fetch.ts @@ -1,3 +1,4 @@ +// @ts-ignore import Promise from 'promise-polyfill'; import { hasWin } from './mixins'; @@ -6,9 +7,10 @@ if (hasWin()) { } export default typeof fetch == 'function' - ? fetch.bind() - : (url, options) => { - return new Promise((res, rej) => { + ? // @ts-ignore + fetch.bind() + : (url: string, options: Record) => { + return new Promise((res: any, rej: any) => { const req = new XMLHttpRequest(); req.open(options.method || 'get', url); req.withCredentials = options.credentials == 'include';