import * as React from "react"; import { StatelessComponent, ComponentClass, PureComponent, ReactElement } from "react"; import { HTMLTags, SVGTags } from "./tags"; type Component

= ComponentClass

| StatelessComponent

; export interface ThemeProps { theme: T; } export type ThemedStyledProps = P & ThemeProps; export type StyledProps

= ThemedStyledProps; export type ThemedOuterStyledProps = P & { theme?: T; innerRef?: (instance: any) => void; }; export type OuterStyledProps

= ThemedOuterStyledProps; export type Interpolation

= FlattenInterpolation

| ReadonlyArray | ReadonlyArray>>; export type FlattenInterpolation

= InterpolationValue | InterpolationFunction

; export type InterpolationValue = string | number | StyledComponentClass; export type SimpleInterpolation = InterpolationValue | ReadonlyArray>; export interface InterpolationFunction

{ (props: P): Interpolation

; } type Attrs, T> = { [K in keyof A]: ((props: ThemedStyledProps) => A[K]) | A[K]; }; export interface StyledComponentClass extends ComponentClass> { extend: ThemedStyledFunction; withComponent(tag: K): StyledComponentClass, T, O>; withComponent(tag: K): StyledComponentClass, T, O>; withComponent(element: ComponentClass

): StyledComponentClass; } export interface ThemedStyledFunction { (strings: TemplateStringsArray, ...interpolations: Interpolation>[]): StyledComponentClass; (strings: TemplateStringsArray, ...interpolations: Interpolation>[]): StyledComponentClass

; attrs = {}>(attrs: Attrs

): ThemedStyledFunction

; } export type StyledFunction

= ThemedStyledFunction; export type ThemedHtmlStyledFunction = ThemedStyledFunction, T>; export type HtmlStyledFunction = ThemedHtmlStyledFunction; export type ThemedSvgStyledFunction = ThemedStyledFunction, T>; export type SvgStyledFunction = ThemedSvgStyledFunction; type ThemedStyledComponentFactoriesHTML = { [K in keyof HTMLTags]: ThemedHtmlStyledFunction; }; type ThemedStyledComponentFactoriesSVG = { [K in keyof SVGTags]: ThemedSvgStyledFunction; }; type ThemedStyledComponentFactories = ThemedStyledComponentFactoriesHTML & ThemedStyledComponentFactoriesSVG; export interface ThemedBaseStyledInterface extends ThemedStyledComponentFactories {

(component: Component

): ThemedStyledFunction>;

(component: Component

): ThemedStyledFunction; } export type BaseStyledInterface = ThemedBaseStyledInterface; export type ThemedStyledInterface = ThemedBaseStyledInterface; export type StyledInterface = ThemedStyledInterface; export interface ThemeProviderProps { theme?: T | ((theme: T) => T); } export type ThemeProviderComponent = ComponentClass>; export interface ThemedCssFunction { (strings: TemplateStringsArray, ...interpolations: SimpleInterpolation[]): InterpolationValue[];

(strings: TemplateStringsArray, ...interpolations: Interpolation>[]): FlattenInterpolation>[]; } // Helper type operators type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; type Omit = Pick>; type WithOptionalTheme

= Omit & { theme?: T; }; export interface ThemedStyledComponentsModule { default: ThemedStyledInterface; css: ThemedCssFunction; keyframes(strings: TemplateStringsArray, ...interpolations: SimpleInterpolation[]): string; injectGlobal(strings: TemplateStringsArray, ...interpolations: SimpleInterpolation[]): void; withTheme

(component: Component

): ComponentClass>; ThemeProvider: ThemeProviderComponent; } declare const styled: StyledInterface; export const css: ThemedCssFunction; export function withTheme

(component: Component

): ComponentClass>; export function keyframes(strings: TemplateStringsArray, ...interpolations: SimpleInterpolation[]): string; export function injectGlobal(strings: TemplateStringsArray, ...interpolations: SimpleInterpolation[]): void; export const ThemeProvider: ThemeProviderComponent; interface StylesheetComponentProps { sheet: ServerStyleSheet; } export class StyleSheetManager extends React.Component { } export class ServerStyleSheet { collectStyles(tree: React.ReactNode): ReactElement; getStyleTags(): string; getStyleElement(): ReactElement<{}>[]; } export default styled;