alexbol99 / flatten-js

Javascript library for 2d geometry
MIT License
553 stars 58 forks source link

Typings exported incorrectly #128

Closed alecmev closed 10 months ago

alecmev commented 2 years ago

Please see this issue: https://github.com/microsoft/TypeScript/issues/50690 As suggested by TypeScript team, the typings should be done like so instead:

declare class Polygon {
  constructor();
}

declare const Flatten: {
  Polygon: Polygon;
}

export { Polygon };
export { Flatten as default };

On a related note, it was also mentioned there that ESM isn't declared in a standard way in package.json. I recently fixed dxf-parser's ESM, you can take a look here: https://github.com/gdsestimating/dxf-parser/pull/86

alexbol99 commented 10 months ago

ESM entry point issue fixed in v1.4.5, export typing fixed in one of the previous versions