This thought just crossed my mind, and I'm looking for a way to make classes private in TypeScript. Let me explain the situation:
Inside my directory Typescript/circle/circle.ts, I have the following code snippet:
class Circle {
PI:number = 3.14;
radius:number = 0;
constructor(public radiusInput:number){
this.radius = radiusInput
}
getArea(){
return this.PI*(this.radius*this.radius);
}
getCircumfrance(){
return this.PI*2*this.radius;
}
}
var fourCircle:Circle = new Circle(5);
Now, when I navigate to another folder, Typescript/enums/enums.ts, I am able to create an instance of the Circle class. However, I do not want that capability. Is there a way to effectively make the Circle class private in TypeScript? Any insights on achieving this?