understanding index.d.ts file

 Recently while debugging one of my code repository, I encountered this error:


Warning: (ae-forgotten-export) The symbol "Unavailable" needs to be exported by the entry point index.d.ts

To give more context here Unavailable is an interface introduced by me as a sub-object of an already exported interface. So, let's first understand what does this index.d.ts signify:

Searching over the web it was seen than *.d.ts files are like header files which are used to store JS code for typescript usage. If you are coming from c world this is like .h file. This mechanism allows to use JS code in TS env without any conversion.

e.g.

import {Hello} from './Apple/index'

If we have both index.ts and index.d.ts files typescript compiler will look for index.d.ts file

So, let's jump back to this error, this Unavailable interface needs to be exported form index.d.ts file I see inside index.ts file

Comments

Popular posts from this blog

Kustov query language

Making all service APi's generic

How I learned LINQ query Fundamentals