javascript - Highcharts TypeScript Boost 模块

标签 javascript typescript highcharts

我想为 Highcharts 模块 Boost 使用 TypeScript 定义

定义存在于:

// 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";

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

有什么想法吗?

最佳答案

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

关于javascript - Highcharts TypeScript Boost 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45338224/

相关文章:

php - 使用从 MySQL 接收的数据填充 Highcharts 图表

javascript - 动态地将新数据添加到 Highchart 饼图中

javascript - 使用另一个更新了选择列表 - Vue.js

javascript - 在 javascript (laravel) 中获取 php 数组

javascript - Chrome 应用程序 : Reading and writing data from/to a file on a server

visual-studio - TypeScript VS - 编译错误但没有设计时错误

PHP 到 Javascript 再回到 HTML 设计问题

c# - C# 和 typescript 之间 JSON 的端到端类型安全

node.js - 变量在分配之前使用

javascript - Highcharts - 负值列 - 列颜色