···11import * as stylex from "@stylexjs/stylex";
2233+import { ThemeKeys } from "./types";
44+35export const spacing = stylex.defineVars({
46 px: "1px",
57 "0": "0px",
···3941});
40424143// eslint-disable-next-line @stylexjs/enforce-extension
4242-export type Spacing = keyof typeof spacing;
4444+export type Spacing = ThemeKeys<typeof spacing>;
+4
apps/docs/src/components/theme/types.ts
···11+import * as stylex from "@stylexjs/stylex";
22+33+export type ThemeKeys<T> =
44+ T extends stylex.VarGroup<Readonly<infer Tokens>> ? keyof Tokens : never;
···11import * as stylex from "@stylexjs/stylex";
2233+import { ThemeKeys } from "./types";
44+35export const spacing = stylex.defineVars({
46 px: "1px",
57 "0": "0px",
···3941});
40424143// eslint-disable-next-line @stylexjs/enforce-extension
4242-export type Spacing = keyof typeof spacing;
4444+export type Spacing = ThemeKeys<typeof spacing>;
+4
packages/hip-ui/src/components/theme/types.ts
···11+import * as stylex from "@stylexjs/stylex";
22+33+export type ThemeKeys<T> =
44+ T extends stylex.VarGroup<Readonly<infer Tokens>> ? keyof Tokens : never;