In my TypeScript project, I am utilizing custom typings by importing them into my .ts
modules with the following import statement:
import { MyCoolInterface } from './types'
However, when I compile my project using tsc, I encounter an issue where the declaration file index.d.ts
is generated separately from the index.js
file and my custom typings are not properly integrated with the tsc-generated ones. The tsc just duplicates the
import { MyCoolInterface } from './types'
string in the generated declaration file which leads to broken typings since it cannot be found in my dist directory. Is there a way to merge the auto-generated types with my custom typings into a single file?
This is what my index.d.ts
looks like:
export interface UmbressOptions {
// Interface properties here
}
When merged with tsc-generated index.d.ts
:
/// <reference types="ioredis" />
/// <reference types="express" />
/// <reference types="pug" />
declare module 'abuseipdb' {
// Module contents here
}