TypeScript enums are only really meant to support a very particular set of use cases. The values are always string or number. If you want one of the values to be a number[], then you can't use an enum.
And you really don't need or want to use an enum anyway; you can write the desired object directly and use a const assertion to get the behavior you're describing:
const Size = {
Small: [0, 1],
Medium: 0,
Large: 1
} as const;
/* const Size: {
readonly Small: readonly [0, 1];
readonly Medium: 0;
readonly Large: 1;
} */
Now Size is an object known to have keys Small, Medium, and Large, and the values at those keys are known to be exactly the values you initialized it with. If you want to use Size as the name of a type corresponding to those values, you can do it with the technique from
Is there a `valueof` similar to `keyof` in TypeScript? :
type Size = (typeof Size)[keyof typeof Size];
// type Size = 0 | 1 | readonly [0, 1]
So now you can write the same sort of code you'd write with a true enum, where Size is both a type name and a value name:
const x: Size = Size.Medium; // okay
There are other differences between this approach and a true enum, but you probably don't care about them. For example, a real enum acts as a namespace so that Size.Small is also the name of a type corresponding to typeof Size.Small. If you do somehow need this, you can write it out (but it's tedious):
namespace Size {
export type Small = typeof Size.Small;
export type Medium = typeof Size.Medium;
export type Large = typeof Size.Large;
}
const y: Size.Medium = Size.Medium; // okay
As another example, enum types are meant to be nominal, so you can't mix and match them even if they have the same values:
enum Enum1 { A = 0, B = 1, C = 2 }
enum Enum2 { D = 0, E = 1, F = 2 }
const e: Enum1 = Enum2.D // error, even though it is the same as Enum1.A
But do you actually want that to be an error? Probably not, and if you do, there are ways around that too... but I won't belabor the point since it's even more tedious to do that.
Playground link to code