import type { ColorValue } from 'react-native'; import type { ThemeColorDefinition } from '../../types/Color.types'; import type { Theme } from '../../types/Theme.types'; import type { OperationSet } from './token.types'; export interface IForegroundColorTokens { color?: ColorValue; } export const getPaletteFromTheme = (theme: Theme): ThemeColorDefinition => { return theme.colors; }; export const foregroundColorTokens: OperationSet = [{ source: 'color', lookup: getPaletteFromTheme }]; export interface IBackgroundColorTokens { backgroundColor?: ColorValue; } export const backgroundColorTokens: OperationSet = [ { source: 'backgroundColor', lookup: getPaletteFromTheme }, ]; export type IColorTokens = IForegroundColorTokens & IBackgroundColorTokens; export const colorTokens = [...foregroundColorTokens, ...backgroundColorTokens];