2017-07-26 100 views
0

我想使用的Highcharts模块加速Highcharts打字稿增强模块

的定义为存在打字稿定义:

// Type definitions for Highcharts 4.2.6 (boost module) 
// Project: http://www.highcharts.com/ 
// Definitions by: Daniel Martin <http://github.com/inad9300> 
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 

import { Static } from "highcharts"; 

declare function HighchartsBoost(H: Static): Static; 
export = HighchartsBoost; 
export as namespace HighchartsBoost; 

当我尝试导入它们下面的任一:

import { HighchartsBoost } from "highcharts/modules/boost"; 
import * as HighchartsBoost from "highcharts/modules/boost"; 

我得到错误:模块解析为非模块实体,无法使用此构造导入。

任何想法?

回答

0

你应该使用:import HighchartsBoost from "highcharts/modules/boost";

+0

这不会给打字稿定义为功能HighchartsBoost – austinrulezd00d

+0

这并不提供答案的问题。要批评或要求作者澄清,请在其帖子下方留言。 - [来自评论](/ review/low-quality-posts/16840904) –

+0

对不起,我包含了我测试导入的模块,而不是''highcharts/modules/boost'''。刚刚更新了我的答案,这种方式工作。 – Stephan