import { types as t } from '@babel/core'; export type StyleValueType = string | number | Array | t.Expression; export interface StyleObject { [key: string]: StyleValueType; } export type StyleValue = string | number; export type StyleGenerator = (match: Array) => StyleObject; export type PatternHandler = StyleObject | StyleGenerator; export type Pattern = [string | RegExp, StyleObject | ((match: any) => StyleObject)]; export interface ThemeConfig { [key: string]: any; } export interface AttributifyConfig { presets: Array Pattern[])>; prefix: string; themes?: { [themeName: string]: ThemeConfig; }; defaultTheme?: string; } export type StyleHandler = StyleObject | ((match: any) => StyleObject); export type StylePattern = [string | RegExp, StyleHandler]; export type Matcher = string | RegExp; export interface ConditionalStyles { consequentStyle: StyleObject; alternateStyle: StyleObject; } export interface ElementInfo { openingElement: t.JSXOpeningElement; attributes: t.JSXAttribute[]; }