export interface Style { /** A key for the style, used to generate CSS class names. */ key?: string; /** The parent style, used to generate CSS class names for * nested styles. */ parent?: Style; /** Mixins used by this style */ mixins?: Style[]; /** CSS property or nested style */ [index: string]: string | number | Style | Style[]; } /** A style registry holds a collection of named * styles created by calls to create() */ export declare class Registry { private styleMap; constructor(); add(style: Style): void; styles(): { [name: string]: Style; }; /** Returns CSS markup for all of the styles * in the registry */ generateCSS(): string; } /** A global registry of all styles defined via style.create() */ export declare var registry: Registry; /** Given an object tree that defines styles * and their properties, returns a tree of Style * objects that can later be passed to compile() * to generate CSS or className() to get the class * names for a style. * * eg: * var styles = style.create({ * classA: { * backgroundColor: 'white', * width: 100 * } * }, 'my-app'); * style.compile(styles); * * Generates: * * .my-app-class-a { * background-color: 'white'; * width: 100px; * } * * All styles defined via create() are added to the global * registry, which allows generation of the CSS for all * styles defined by modules loaded via a particular entry * point. * * @param namespace An optional namespace which is * added as a prefix in front of all generated * class names. If the namespace is a filename or path * then the basename will be extracted and hyphenated, * eg. '/myapp/myComponent.js' -> 'my-component'. * * A convention is to pass __filename as the namespace * argument, to make it easy to find where a generated * class was defined. */ export declare function create(tree: T, namespace?: string, localRegistry?: Registry): T; /** Given a list of objects from a style tree generated * by style.create(), returns a space-separated list * of class-names for those styles in the CSS generated * by compile() */ export declare function classes(...objects: T[]): string; /** Given a style tree generated by create(), * returns the CSS for the classes defined * in that tree. */ export declare function compile(tree: T): string; /** Returns true if @p obj is a style tree returned by style.create() * or an element of one. */ export declare function isStyle(obj: Object): boolean; /** mixin() is a utility function for use with React which takes the * props object for a component and adds the necessary additional * 'className' and/or 'style' props to apply styling from * a style returned by create(). 'styles' can be a single * style or an array of styles. */ export declare function mixin

(styles: Object | Object[], props?: P): P; /** Merges a set of inline style objects together into * a single style. * * This can be used to create mixins. */ export declare function merge(...styles: any[]): Object;