Currently, I am in the process of developing a nuxt.js application with typescript and my goal is to segregate the API Calls from the vuex store. However, I've encountered an issue where it seems like I cannot utilize the methods when importing the class. The compiler keeps throwing an error TS1005: ',' expected.
each time I attempt to invoke a method.
apiClient.ts
export default class apiClient {
helloWorld() {
console.log('Hello World');
}
}
products.ts:
import ApiClient from '../services/apiClient';
export const actions = {
ApiClient.helloWorld();
};
tsconfig.json
"compilerOptions": {
"target": "ES2018",
"module": "ESNext",
"moduleResolution": "Node",
"lib": [
"ESNext",
"ESNext.AsyncIterable",
"DOM"
],
"esModuleInterop": true,
"allowJs": true,
"sourceMap": true,
"strict": true,
"noEmit": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"baseUrl": ".",
"paths": {
"~/*": [
"./src/*"
],
"@/*": [
"./src/*"
]
},
"types": [
"@types/node",
"@nuxt/types",
"@nuxtjs/axios"
]
},