You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given this is a library, I want .d.ts files emitted so it can be used by other libraries
If in main.ts I use
export { foo, bar } from "./index"
export { funcFromSubDir } from "./src/index"
the output of tstl is invalid.
I can work around this by wrapping the functions in new functions in the top level file but that's no fun.
import { foo, bar } from "./index"
import { funcFromSubDir } from "./src/index"
export const f = foo()
export const b = bar()
export const c = funcFromSubDir()
The text was updated successfully, but these errors were encountered:
Investigation result: This is default TypeScript behavior. There are some issues on their repo discussing this. It does not try to resolve declaration files referred to by your files.
In this case main.d.ts refers to the two index.d.ts files, these will not be emitted by tsc either, so we don't see the files in tstl either.
We could decide to deviate from tsc behavior and try to improve this, but it would involve either always exporting all used node_modules lua declaration files (not sure if that is desirable), or implementing some kind of dependency analysis on the declaration files we do emit, which also sounds like a pain.
Sample repo here https://github.com/shughes-uk/test
Given this is a library, I want
.d.ts
files emitted so it can be used by other librariesIf in
main.ts
I usethe output of
tstl
is invalid.I can work around this by wrapping the functions in new functions in the top level file but that's no fun.
The text was updated successfully, but these errors were encountered: