import { Property } from 'csstype'; import { Animations } from './animations'; import { ColorDescription, Colors, ColorsDescriptionStruct } from './colors'; import { Elevation } from './elevation'; import { Sizes } from './geometry'; import { Gradients } from './gradients'; import { ToneValues } from './toneValues'; import { Adaptive } from './tools'; import { NamifyObject } from './tools/cssVars'; import { StringifyObject } from './tools/utils'; import { Fonts, TypographyBaseProps } from './typography'; import ColorScheme = Property.ColorScheme; import { StaticTokens, Tokens } from './tools/tokenValue'; interface AdaptiveInterfaceValues extends Sizes, Fonts { } declare type AdaptiveTokens = { [key in keyof AdaptiveInterfaceValues]: Adaptive; }; export interface ColorsScheme { colorsScheme: 'light' | 'dark'; } export interface ColorsDescription extends ColorsScheme { colors: T; } export interface ColorsFinal extends Colors, ColorsScheme { } export interface SpecialTokens { themeName: string; themeNameBase?: string; themeInheritsFrom?: string; prefix?: string; } export interface WithThemeType { themeType: 'root' | 'flat' | 'pixelify' | 'cssVars' | 'cssVarsWide'; } /** * Общий интерефейс между описанием и самой темой */ export interface ThemeGeneral extends AdaptiveTokens, SpecialTokens, ToneValues, TypographyBaseProps, Elevation, Gradients, Animations { } /** * Интерфейс описания Темы (в этом типе описываются все темы дизайн-системы) */ export interface ThemeDescription extends Tokens, ColorsDescription { } /** * Основной интерфейс темы */ export interface Theme extends ThemeGeneral, ColorsFinal { themeType: 'root'; } /** * Тема, в коротой все значения пикселизированы. Т.е. 16 -> '16px' */ export declare type PixelifyTheme> = StaticTokens> = StringifyObject> & Pick> & { themeType: 'pixelify'; themeName: string; colorScheme: ColorScheme; }; /** * Тема, которая каждой переменной даёт name и value в виде названия * соответствующей css-переменной и ссылки на неё */ export declare type ThemeCssVars = { [K in keyof Omit]: NamifyObject[K], true>; } & Pick & { themeType: 'cssVars'; }; /** * Тоже самое, что и ThemeCssVars, только у переменных есть ещё originValue * используется для генерации источников CSS-переменных */ export declare type ThemeCssVarsWide = { [K in keyof Omit]: NamifyObject[K]>; } & Pick & { themeType: 'cssVarsWide'; }; export {};