import { FontMetrics } from "@capsizecss/core"; import { TextVariants, themeColors, ThemeConfig } from "theme.config"; import { ViewStyle } from "react-native"; export type ColorStyles = | "backgroundColor" | "borderBottomColor" | "borderColor" | "borderLeftColor" | "borderRightColor" | "borderTopColor"; export type RadiusStyles = | "borderBottomLeftRadius" | "borderBottomRadius" | "borderBottomRightRadius" | "borderLeftRadius" | "borderRadius" | "borderRightRadius" | "borderTopLeftRadius" | "borderTopRadius" | "borderTopRightRadius"; export type PaddingStyles = | "padding" | "paddingBottom" | "paddingHorizontal" | "paddingLeft" | "paddingRight" | "paddingTop" | "paddingVertical"; export type MarginStyles = | "margin" | "marginBottom" | "marginHorizontal" | "marginLeft" | "marginRight" | "marginTop" | "marginVertical"; export type BorderStyles = | "borderBottomColor" | "borderBottomWidth" | "borderColor" | "borderLeftColor" | "borderLeftWidth" | "borderRightColor" | "borderRightWidth" | "borderTopColor" | "borderTopWidth"; export type SpacingStyles = PaddingStyles | MarginStyles; export type FontWeights = | "hairline" | "thin" | "light" | "normal" | "medium" | "semibold" | "bold" | "heavy" | "black"; export type SpaceKey = keyof ThemeConfig["spacing"]; export type Spacing = SpaceKey | { custom: ViewStyle["margin"] } | undefined; export type NegativeSpace = `-${SpaceKey}` | { custom: ViewStyle["margin"] } | undefined; export type ColorConfig = typeof themeColors["light"]; export type ColorThemeKeys = keyof ColorConfig | { custom: string }; export type Radius = keyof ThemeConfig["radius"] | { custom: number }; export type FontSizes = keyof ThemeConfig["typography"]["sizes"]; export type FontType = keyof ThemeConfig["typography"]["fontConfig"]; type FontConfig = Record< FontType, Partial> >; type Sizes = Record; type Metrics = Record; export type TypographyConfig = { fontMetrics: Metrics; fontConfig: FontConfig; sizes: Sizes; }; export type FontSpecificWeights = ThemeConfig["typography"]["fontConfig"]; export type FontTypes = T extends FontType ? S extends keyof FontSpecificWeights[T] ? { family: T; weight: S } : never : never; export type FontTypesAndWeights = { [T in FontType]: FontTypes; }[FontType]; export type FontVariants = T extends keyof TextVariants ? S extends keyof FontSpecificWeights[TextVariants[T]["family"]] ? { variant: T; weight?: S } : never : never; export type FontVariantsAndWeights = { [T in keyof TextVariants]: FontVariants; }[keyof TextVariants];