mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Improve polylabel ES6 import syntax (#11260)
Using `import * as polylabel from 'polylabel'` is now valid in Typescript vs. require('polylabel').
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
/// <reference path="./polylabel.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
import polylabel = require('polylabel');
|
||||
import * as polylabel from 'polylabel';
|
||||
|
||||
const polygon = [[[3116,3071],[3118,3068],[3108,3102],[3751,927]]]
|
||||
let p: number[]
|
||||
p = polylabel(polygon)
|
||||
p = polylabel(polygon, 1.0)
|
||||
p = polylabel(polygon, 1.0, true)
|
||||
p = polylabel(polygon, 1.0, false)
|
||||
polylabel(polygon)
|
||||
polylabel(polygon, 1.0)
|
||||
polylabel(polygon, 1.0, true)
|
||||
polylabel(polygon, 1.0, false)
|
||||
|
||||
Vendored
+3
-2
@@ -15,7 +15,7 @@
|
||||
* - guarantees finding global optimum within the given precision
|
||||
* - is many times faster (10-40x)
|
||||
*/
|
||||
declare module 'polylabel' {
|
||||
declare module "polylabel" {
|
||||
/**
|
||||
* Polylabel returns the pole of inaccessibility coordinate in [x, y] format.
|
||||
*
|
||||
@@ -28,6 +28,7 @@ declare module 'polylabel' {
|
||||
* @example
|
||||
* var p = polylabel(polygon, 1.0);
|
||||
*/
|
||||
function polylabel (polygon: number[][][], precision?: number, debug?: boolean): number[];
|
||||
function polylabel(polygon: number[][][], precision?: number, debug?: boolean): number[];
|
||||
namespace polylabel {}
|
||||
export = polylabel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user