0
I’m creating an API for Angularjs and know that in vs code you can write a d.ts file that defines types and other things in the IDE. I already created this index.d.ts for autocomplete and it worked for global variables and so on.
Code that defines the types of my service
declare var $ticket: sgtalk.$ticket;
export as namespace $ticket;
export = $ticket;
declare namespace sgtalk {
interface $ticket {
/**
* @returns {string} Tipo
*/
getSimpleList(): Object;
/**
* @param {number} display O número que descreve o ticket
*/
getTicketData(display: number): Object;
// answer()
// senTicketData()
}
}
Demonstrating how Tellisense is
The problem is that when I put this same name on the angular Inject it does not detect what it is.
I did a quick search on the Internet but I couldn’t find anything that could help me.
Young. Angular2 is completely different de Angularjs. You are using Angular2 or Angularjs with Typescript?
– Jéf Bueno
Angularjs with normal JS, but in vscode, when you have the jsconfig file and the definition file(.d.ts) you can use autocomplete and Intellisense
– Márcio Eric