Originally I tend to organize typings in multiple files so that they are more manageable. e.g. npm-chai.
But now through the conversation in UMD, and best practice of exposing types, it seems like it is actually best to keep them in 1 file (or 2, if we can't nicely solve the UMD issue microsoft/TypeScript#7125 and microsoft/TypeScript#7156)
The key statement is this:
"how would it look like if the package is actually written in TypeScript and compiled using tsc -d"?
It has the following benefits:
- Non-argumentative
- Simple to define, simple to follow
- No need to think about folder structure (
lib or src? Nested or mirror source structure?)
- The
.d.ts file can easily be moved into the source package when package author agrees
Relevant discussions:
typings/typings#402
typings/typings#10
typings/typings#354
Originally I tend to organize typings in multiple files so that they are more manageable. e.g.
npm-chai.But now through the conversation in UMD, and best practice of exposing types,
it seems like it is actually best to keep them in 1 file (or 2, if we can't nicely solve the UMD issue microsoft/TypeScript#7125 and microsoft/TypeScript#7156)The key statement is this:
"how would it look like if the package is actually written in TypeScript and compiled using
tsc -d"?It has the following benefits:
liborsrc? Nested or mirror source structure?).d.tsfile can easily be moved into the source package when package author agreesRelevant discussions:
typings/typings#402
typings/typings#10
typings/typings#354