Home error :Cannot invoke an expression whose type lacks a call signature. Type 'has no compatible c ll signatures
Reply: 1

error :Cannot invoke an expression whose type lacks a call signature. Type 'has no compatible c ll signatures

enemy123
1#
enemy123 Published in 2017-11-14 17:55:16Z

I am trying to use https://github.com/mapbox/polylabel in my angular project and when I try to run ng server,the build fails with following error

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.

Following is the code for 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;
enemy123
2#
enemy123 Reply to 2017-11-16 03:44:04Z

Apparently I didn't have polylabel installed globally. Doing npm install polylabel fixed the issue.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.331856 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO