import { ColorScheme } from "../colors/types.js"; import { ConfigSchemaTheme } from "../schemas/schema.js"; import { GetStyleDictionaryConfig } from "./process/configs/shared.js"; import { Config } from "style-dictionary/types"; type TokenMetadata = { /** @see https://www.designtokens.org/tr/2025.10/format/#description */ $description?: string; /** @see https://www.designtokens.org/tr/2025.10/format/#deprecated */ $deprecated?: string; }; export type Token = TokenMetadata & ({ $type: string; $value: string | Record[]; } | { $type: 'boxShadow'; $value: Record<'x' | 'y' | 'blur' | 'spread' | 'color', string>[]; } | { $type: 'typography'; $value: Record<'fontFamily' | 'fontWeight' | 'lineHeight' | 'fontSize' | 'letterSpacing', string>; }); export type TokenSet = { [key: string]: Token | TokenSet; }; export type TokenSets = Map; export type Typography = Theme['typography']; /** A named typography set, i.e. one entry in `typography.fonts`. */ export type TypographySet = Typography['fonts'][string]; /** The component typography shared by all typography sets. */ export type TypographyComponents = Typography['components']; export type SizeConfig = Theme['size']; export type BorderRadiusConfig = Theme['borderRadius']; export type ShadowConfig = Theme['shadow']; export type BorderWidthConfig = Theme['borderWidth']; export type OpacityConfig = Theme['opacity']; export type Theme = { name: string; } & Required> & Pick; export type SizeModes = 'small' | 'medium' | 'large'; /** * A multi-dimensional theme is a concrete permutation of the possible theme dimensions */ export type ThemePermutation = { 'color-scheme': string; color: string; semantic: string; size: string; theme: string; typography: string; }; export type ThemeDimension = keyof ThemePermutation; export type TokenSetDimensions = { colorSchemes: ColorScheme[]; sizeModes: SizeModes[]; typographies: string[]; }; export type GetSDConfigOptions = { tokensDir?: string; dry?: boolean; tokenSets?: TokenSets; }; export type BuildConfig = { /** Optional name of the build config - only used in the console output */ name?: string; /** Style Dictionary configuration creator */ getConfig: GetStyleDictionaryConfig; /** Which theme dimensions to include. `theme` is always included. */ dimensions: ThemeDimension[]; /** Whether the build config is enabled. @default () => true */ enabled?: () => boolean; /** Custom log message. */ log?: (config: SDConfigForThemePermutation) => string; }; export type SDConfigForThemePermutation = { permutation: ThemePermutation; config: Config; }; /** This type is taken from Style Dictionary `formatPlatform`. * Metadata for a file output */ export type OutputFile = { output: string; destination: string; }; export type DesignsystemetObject = { name: string; version: string; }; export {};