Within my globals.ts file, I've defined the following:
export const Roles = { Manager: 2, "Customer Service": 4 }
const r = Roles["Customer Service"]; // works just fine
In another file where this information is imported, I have:
import { Roles } from "./globals";
const m = Roles.Manager; // all good
const M = Roles["Manager"]; // no issues here
const r = Roles["Customer Service"]; // encountering an error
The error message received for the last line states:
Element implicitly has an 'any' type because type '{ Manager: number; "Customer Service": number; ...' has no index signature.
Why is this limitation in place? Is there a way to reference an element with a key that includes spaces?