// Type definitions for styled-theming 2.2 // Project: https://github.com/styled-components/styled-theming#readme // Definitions by: Arjan Jassal // Hieu Ho // David Daniell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 import { FlattenInterpolation, ThemeProps, ThemedStyledProps } from 'styled-components'; declare function theme(name: string, values: theme.ThemeMap): theme.ThemeSet; declare namespace theme { type ThemeValueResult = | string | FlattenInterpolation> | FlattenInterpolation>; type ThemeValueFn = (props: object) => ThemeValueResult; type ThemeValue = ThemeValueFn | ThemeValueResult; interface ThemeMap { [key: string]: ThemeValue; } type VariantMap = { [key in TVariant]: ThemeMap; }; type ThemeSet = (props: object) => string; type VariantSet = (props: { [key in TProp]?: TVariant }) => string; function variants( name: string, prop: TProp, values: VariantMap, ): VariantSet; } export = theme;