/** * Helper Functions Types - 所有辅助函数的严格类型定义 * 基于 Terrazzo 生成的 tokens 类型提供编译时类型安全 */ import type { tokens } from "../../dist/tokens.js"; type ColorTokenKeys = Extract; type SpacingTokenKeys = Extract; type BreakpointTokenKeys = Extract; type TypographyTokenKeys = Extract; type ShadowTokenKeys = Extract; type RadiusTokenKeys = Extract; type ZIndexTokenKeys = Extract; type ExtractColorPath = T extends `color.${infer Rest}` ? Rest : never; export type ColorPath = ExtractColorPath | ColorTokenKeys; export type ColorAlpha = number; type BaseColorPath = ExtractColorPath; type BackgroundColors = Extract; type ForegroundColors = Extract; type BoundaryColors = Extract; type IconColors = Extract; type StandardColors = Extract; export type { BackgroundColors, ForegroundColors, BoundaryColors, IconColors, StandardColors, }; type ExtractSpacingKey = T extends `spacing.${infer Key}` ? Key : never; type ExtractBreakpointKey = T extends `breakpoints.${infer Key}` ? Key : never; type ValidSpacingKeys = ExtractSpacingKey; type ValidBreakpointKeys = ExtractBreakpointKey; export type FractionString = `${number}/${number}`; export type ArbitraryValue = `[${string}]`; export type SpacingValue = number | ValidSpacingKeys | ValidBreakpointKeys | FractionString | ArbitraryValue; type ExtractFontKey = T extends `font.${Prefix}.${infer Key}` ? Key : never; export type FontFamilyKey = ExtractFontKey; export type FontWeightKey = ExtractFontKey; export type FontSizeKey = ExtractFontKey; export type LineHeightKey = ExtractFontKey; export type LetterSpacingKey = ExtractFontKey; export type TypographyPresetKey = string; export type CSSProperties = Record; type ExtractShadowKey = T extends `shadows.${infer Key}` ? Key : never; export type ShadowKey = ExtractShadowKey; type ExtractRadiusKey = T extends `radius.${infer Key}` ? Key : never; export type RadiusKey = ExtractRadiusKey; type ExtractZIndexKey = T extends `zindex.${infer Key}` ? Key : never; export type ZIndexKey = ExtractZIndexKey; export type BreakpointValue = ValidBreakpointKeys; export type MediaQueryType = "screen" | "print" | "all"; export type ThemeMode = "." | "light" | "dark"; //# sourceMappingURL=helpers.d.ts.map