Is there such a thing as public static constants in TypeScript? I have a class that looks like:

export class Library {
  public static BOOK_SHELF_NONE: string = "None";
  public static BOOK_SHELF_FULL: string = "Full";
}

In that class, I can do Library.BOOK_SHELF_NONE and the tsc doesn’t complain. But if I try to use the class Library elsewhere, and try to do the same thing, it doesn’t recognize it.

8 Answers
8

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *