Just dipping my toes into TypeScript and attempting to invoke a function on a class.
In file A:
import userAPIController from "./controllers/customer/userAPIController";
userAPIController.users_index();
In file B:
export default class UserApiController {
public users_index(): void {
User.findAll({
attributes: ["given_name", "family_name"]
}).success(function (users: any) {
console.log(users);
});
}
An error crops up saying:
Property 'users_index' does not exist on type 'typeof UserApiController'
I even attempted to introduce an interface:
interface userAPIController {
users_index: any;
}
No dice, though.
What am I messing up here?