当前位置: 动力学知识库 > 问答 > 编程问答 >

Import declarations in a namespace from external module

问题描述:

I would like use TypeScript.NET in my angular application. I am newbie in typescript and maybe root of problem is simple.

For example I would like to use StringBuilder.

First I install TypeScript via nuget

Add ref to index.html

<script src="source/System/Text/StringBuilder.js"></script>

<script src="source/System/Text/Utility.js"></script>

Here I am confuse, I don’t use any module system (e.g commonJs, amd, etc).

TypeScript.NET nuget add to my project folder dist which constains probably dist version for amd, commonjs etc hence I reference files from source folder.

Now I want to use StringBuilder in my internal module.

module App.Company{

//in internal module

import IVersion = App.IVersion;

import IError = App.IError;

//TypeScript.NET

import StringBuilder from "../../../../source/system/text/stringbuilder";

}

Here I get compilation errror

Import declarations in a namespace cannot reference a module

What is solution?

Second how can simple reference all types from TypeScript.NET?

分享给朋友:
您可能感兴趣的文章:
随机阅读: