我似乎无法为我创建的javascript库正确创建自定义的Typescript Declaration文件。这是我的代码的简化版本:
/// <reference path="types.d.ts" />
MyMethods.doSomething() // error: Cannot resolve symbol "MyMethods"
interface MyMethods {
doSomething();
}
declare var MyMethods: MyMethods;
我不明白为什么这个简单的声明文件不起作用。使用Visual Studio 2015 + Resharper,App.ts中的MyMethods
以红色突出显示,错误消息显示无法解析符号“MyMethods”。
即使更奇怪,项目实际编译并且输出有效。我做错了什么?
编辑:如果我禁用Resharper,则不会突出显示错误。我想这可能只是一个错误?
答案 0 :(得分:0)
you can hide/ supress those kind of errors as follows.
1) find code issues in the file 2) select that perticular issue 'DataTemplate.DataType Cannot resolve symbol 'component'' from Inspection results bar. 3) choose 'choose ReSharper | Windows | Solution Errors' 4) You will be able to see small window 'Errors/Warnings in Solution ' 5) select the issue and select ignore error.