Replies: 1 comment 1 reply
-
The A utility type to extract just the real keys from the object is easy to make, but I can't think of any use-cases where you would be able to use it. All usage of variables defined with Any usage of the type Please tell me your use-case in case you have something in mind that would work. In any case, here's the utility type that would work: type TActualKeys<T> =
T extends string ?
T extends '__opaqueId' | '__tokens' ?
never
: T
: never;
type VarGroupKeys<G extends VarGroup> = TActualKeys<keyof G>;
type TestToken = VarGroupKeys<typeof test>; |
Beta Was this translation helpful? Give feedback.
-
Is there a built-in type in stylex that helps us extract keys from stylex.defineVars?
Given this example:
Using TS's
keyof typeof x
results in this type (not ideal):We can manually exclude stylex's internal properties but I was wondering if there's a more elegant solution:
Beta Was this translation helpful? Give feedback.
All reactions