'Typescript error :TS2304 cannot find name
Burning through a typescript course I came across these code pieces that fail to compile and give error TS2304. Any help is appreciated.
file ZooAnimals.ts:
namespace Zoo {
interface Animal {
skinType: string;
isMammal(): boolean;
}
}
File ZooBirds.ts:
/// <reference path="ZooAnimals.ts" />
namespace Zoo {
export class Bird implements Animal {
skinType = "feather";
isMammal() {
return false;
}
}
}
The command to compile the files:
tsc --outFile Zoo.js ZooAnimals.ts ZooBirds.ts
Throws error:
ZooBirds.ts:3:34 - error TS2304: Cannot find name 'Animal'.
3 export class Bird implements Animal {
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
