Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Why the npm package doesn't contains a type definition file. #109

Open
lordfriend opened this issue Jun 1, 2018 · 1 comment
Open

Why the npm package doesn't contains a type definition file. #109

lordfriend opened this issue Jun 1, 2018 · 1 comment

Comments

@lordfriend
Copy link

First, thank you for creating this project. I just wonder why this project is written in Typescript but the package published at npm doesn't include a tsd file. I cannot directly use this lib without to create a type definition file by myself.

@Arnavion
Copy link
Owner

Arnavion commented Jun 1, 2018

The quirk with how this library is compiled is that it's written as modules but the release is a single JS object with everything loaded up-front. The eager-loading is intentional since a stable class-loading order is required to make the serialization-deserialization work across multiple loaded instances of the library.

I think I had tried SitePen/dts-generator once and it was not able to do this transformation. I remember fooling around with the compiler API to see if I could generate a dts with this transformation manually but it was too much effort. Microsoft/dts-gen came out later but I don't think I ever tried it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants