How do you convert template literals into numbers in typescript when defining a type?
I'm ultimately trying to add the negative values of the keys of an object to the type. I'd prefer not to type out the negative values explicitly.
Contrived example
const obj = {1:1, 2:2, 3:3, auto:4};
type MyType = keyof typeof obj | `-${Exclude<keyof typeof obj | "auto">}`
// can you somehow parseFloat() that string literal
// Should accept 1, 2, 3, -1, -2, -3, "auto"
// Currently it accepts the negative values as strings only