I'm encountering difficulties when trying to declare an enum element within a class. Despite attempting various methods to declare the enum, I am unable to make it function properly.
Here is the (non-functional) class:
export class Device extends Electronics {
public OS: string = '';
protected ready: boolean = false;
protected enum numbers {one, two, three};
constructor(OS: string, ready: boolean, numbers: enum) {
this.OS = OS;
this.ready = ready;
this.numbers = numbers;
}
}
I have also explored these alternatives:
protected {one, two, three}numbers: enum;
and
protected numbers{one, two, three}: enum;
as well as
protected numbers: enum{one, two, three};
and
protected numbers: enum = {one, two, three};
None of these approaches seem to be effective. Therefore, I must be overlooking something, as I am currently struggling to comprehend how enums operate. (Despite consulting TypeScript documentation and multiple sources for additional information without success)