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
If your exposed API returns a custom type defined by yourself, say in "typings/types.d.ts", and you specify this file in tsconfig.json, typescript compiler will not automatically include this custom type in the generated index.d.ts, how do you export the custom type?
The text was updated successfully, but these errors were encountered:
I was about to ask a similar question. Please, correct me if I am wrong: with the current tsconfig.json, tsc automatically infers the typings and put them in dist/index.d.ts. But how if I want to add my custom typings like @a9udn9u said?
For example, I want to make available to any customer of my library a Dog type. Then, in typings/index.d.ts (outside src dir) I put:
But when I build with tsc the custom type doesn't get compiled in the dist/ directory. I suppose that's why testing the example-consumer throws the below error: Module '"hwrld"' has no exported member 'Dog'.
If your exposed API returns a custom type defined by yourself, say in "typings/types.d.ts", and you specify this file in tsconfig.json, typescript compiler will not automatically include this custom type in the generated index.d.ts, how do you export the custom type?
The text was updated successfully, but these errors were encountered: