TypeScript Version: 2.0.0
Code
// file: animal.tsabstractclassAnimal{name: string;constructor(name: string){this.name=name;}abstractshout(): string;}exportclassSnailextendsAnimal{shout(): string{return'...';}}I'm trying to emit declarations files .d.ts with tsc --declaration in order to get such a following file:
Expected behavior:
File animal.js well generated as well as file animal.d.ts:
// file: animal.d.tsdeclareabstractclassAnimal{name: string;constructor(name: string);abstractshout();}exportdeclareclassSnailextendsAnimal{shout();}Actual behavior:
File animal.js well generated but no file animal.d.ts. I got an error instead:
error TS4020: Extends clause of exported class 'Snail' has or is using private name 'Animal'.
It is maybe a misunderstanding of mine, but in my mind, when a code compiles with tsc, it should also compile with the --declaration flag.
For information, here is my tsconfig.json:
// file: tsconfig.json{"compilerOptions": {"noImplicitAny": true,"strictNullChecks": true,"target": "es5","module": "amd","outDir": "./build"},"exclude" : ["./build","./node_modules"]}
TypeScript Version: 2.0.0
Code
I'm trying to emit declarations files .d.ts with
tsc --declarationin order to get such a following file:Expected behavior:
File animal.js well generated as well as file animal.d.ts:
Actual behavior:
File animal.js well generated but no file animal.d.ts. I got an error instead:
error TS4020: Extends clause of exported class 'Snail' has or is using private name 'Animal'.It is maybe a misunderstanding of mine, but in my mind, when a code compiles with tsc, it should also compile with the
--declarationflag.For information, here is my tsconfig.json: