How to call API method (written in JavaScript) from TypeScript code?

We have Vue app where unfortunatelly JavaScript and TypeScript code are mixed.

  1. The API call looks as following (.ts file):

enter image description here

enter image description here

  1. gpbApi.js:
import * as leadService from '@/utils/api/leadService';
import Vue from 'vue';

Vue.prototype.$gpbApi = {
	leadService,
};
  1. leadService.js:
import axios from 'axios';

export async function getReqtypes() {
	const { data } = await axios.get(`${path}/Reqtype`, { withCredentials: true });
	return data.data;
}

export async function getCities() {
	const { data } = await axios.get(`${path}/Nsi/City`, { withCredentials: true });
	return data.data;
}

As you can see there is an error in .ts file. How can I overcome the issue?

Is anybody there that could help?

We use this way of calling API methods in JavaScript files and everything works fine, but when we try to use it in TypeScript class it doesn’t work. What should we do to make it work?