Ionic RC0:错误TS4053:来自导出类的公共方法的返回类型具有或正在使用来自外部模块

时间:2016-09-30 11:39:00

标签: typescript ionic2

我正在通过创建一个新的RC0项目并按照https://github.com/driftyco/ionic/blob/master/CHANGELOG.md

中的说明将我的项目从Beta 11升级到Ionic RC0

除了情侣之外,我已经解决了大部分问题。其中一个是跟踪错误:

error TS4053: Return type of public method from exported class has or is using name 'Entry' from external module "/Users/saiy2k/projects/ionic/gr/node_modules/ionic-native/dist/es5/plugins/file" but cannot be named

error TS4053: Return type of public method from exported class has or is using name 'FileError' from external module "/Users/saiy2k/projects/ionic/gr/node_modules/ionic-native/dist/es5/plugins/file" but cannot be named.

error TS4053: Return type of public method from exported class has or is using name 'DirectoryEntry' from external module "/Users/saiy2k/projects/ionic/gr/node_modules/ionic-native/dist/es5/plugins/file" but cannot be named.

我安装了File cordova插件,但仍然。

感谢任何帮助

1 个答案:

答案 0 :(得分:3)

尝试

    import {Entry} from 'ionic-native/dist/es5/plugins/file';
    import {FileError} from 'ionic-native/dist/es5/plugins/file';
    import {DirectoryEntry} from 'ionic-native/dist/es5/plugins/file';

参考:Typescript errors when setting declaration to TRUE