【发布时间】:2017-11-22 20:59:59
【问题描述】:
我正在尝试在我的 Angular 项目中使用 https://github.com/mapbox/polylabel,当我尝试运行 ng 服务器时,构建失败并出现以下错误
error TS2349: Cannot invoke an expres ion whose type lacks a call signature. Type node_modules/@types/polylabel/index"'has no compatible c ll signatures.
下面是 index.ts 的代码
// Type definitions for polylabel 1.0
// Project: https://github.com/mapbox/polylabel
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Polylabel returns the pole of inaccessibility coordinate in [x, y] format.
*
* @param polygon - Given polygon coordinates in GeoJSON-like format
* @param precision - Precision (1.0 by default)
* @param debug - Debugging for Console
* @example
* var p = polylabel(polygon, 1.0);
*/
declare function polylabel(polygon: number[][][], precision?: number, debug?: boolean): number[];
declare namespace polylabel {}
export default polylabel;
【问题讨论】:
标签: javascript angular typescript