When using the TypeScript plugin for vs.net, how do I make one TypeScript file import modules declared in other TypeScript files?
file 1:
module moo
{
export class foo .....
}
file 2:
//what goes here?
class bar extends moo.foo
{
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From TypeScript version 1.8 you can use simple
importstatements just like in ES6:https://www.typescriptlang.org/docs/handbook/modules.html
Old answer: From TypeScript version 1.5 you can use
tsconfig.json: http://www.typescriptlang.org/docs/handbook/tsconfig-json.htmlIt completely eliminates the need of the comment style referencing.
Older answer:
You need to reference the file on the top of the current file.
You can do this like this:
etc.
These paths are relative to the current file.
Your example: