The declaration files emitted from the `ts.createProgram` doesn't include all the imported modules from the source file. For ex: ```tsx // useConfig.ts import {InitialConfig} from './initialConfig'; export const useConfig = () => { const [config, setConfig] = useState<InitialConfig>(); const updateConfig = (data: InitialConfig) => { setConfig(data); } return { config, updateConfig, } }; ``` The declaration file generated from compilation file is as follows: ```tsx // useConfig.d.ts export declare const useConfig: () => { config: unknown; updateConfig: (data: InitialConfig) => void; } ``` `ts.createProgram` is not including `InitialConfig` as part of the generated `.d.ts` file, and as such we can't be able to use any types generated.
The declaration files emitted from the
ts.createProgramdoesn't include all the imported modules from the source file.For ex:
The declaration file generated from compilation file is as follows:
ts.createProgramis not includingInitialConfigas part of the generated.d.tsfile, and as such we can't be able to use any types generated.