Having an issue with TypeScript in a Sails.js application.
I am utilizing TypeScript to write my controller and attempting to use Sails.js services within the controllers. However, I encounter a syntax error in VSCODE.
Below is the code snippet from MyController.ts:
import util = require('util');
import express = require('express');
declare var sails: any;
var count : number = 0;
export function stats(req:any, res:any, next: Function):any {
console.log('TsController.ts');
TestLog.send();
res.status(200).send({});
}
And this is the content of TestLog.js:
module.exports = {
send: function(){
console.log("Service is Logging")
}
}
Despite the fact that the application runs successfully when launched, VSCODE displays the following error message:
[ts] Cannot find name 'TestLog'.
Any insights on resolving this issue would be greatly appreciated.