fix: api typings (#210)

This commit is contained in:
Thomas Klein
2019-10-22 22:31:39 +02:00
committed by Juan Picado @jotadeveloper
parent 5c06ace14a
commit 5d6ad3d783
4 changed files with 4 additions and 16 deletions

View File

@@ -6,7 +6,7 @@ import '../../types';
* @param {object} response
* @returns {promise}
*/
export function handleResponseType(response: Response): Promise<[boolean, Blob | string]> | Promise<void> {
export function handleResponseType(response: Response): Promise<[boolean, Blob | string] | void> {
if (response.headers) {
const contentType = response.headers.get('Content-Type');
if (contentType && contentType.includes('application/pdf')) {
@@ -52,7 +52,6 @@ class API {
credentials: 'same-origin',
...options,
})
// @ts-ignore
.then(handleResponseType)
.then(response => {
if (response[0]) {