Let's say I have a app.ts
file:
interface IApp {}
export class App implements IApp {}
If I set declaration
to true
in tsconfig.json, an error will occur:
error TS4019: Implements clause of exported class 'App' has or is using private name 'IApp'.
However, if I define IApp
in a different file and import it, the issue can be resolved:
import { IApp } from './interface';
export class App implements IApp {}
In my opinion, both implementations are referring to the private variable IApp
within the scope of the app.ts
file, so why does the first one fail while the second one succeeds?