react-typestyle
Version:
A react integration of the TypeStyle ecosystem
43 lines (42 loc) • 2.37 kB
TypeScript
/// <reference types="react" />
import * as React from 'react';
export { React as _react };
import Cache from './internal/cache';
import { ComponentOptions, InjectedProps, InputSheet, Options, StyledStatelessComponent } from './internal/hoc';
import Registry from './internal/registry';
import Renderer from './internal/renderer';
import { dynamicExtend, shallowCompare } from './internal/utils';
export { Cache, dynamicExtend as extend, Registry, Renderer, shallowCompare };
import * as types from './types';
export { ComponentOptions, InjectedProps, InputSheet, Options, StyledStatelessComponent, types };
export declare let defaultRenderer: Renderer;
export declare let getStyles: any;
export declare const setDefaultRenderer: (renderer: Renderer) => Renderer;
declare const withStyles: (options?: Partial<Options> | undefined) => <OriginalProps extends {}>(Component: (React.ComponentClass<OriginalProps & InjectedProps> & {
styles?: types.DynamicSheet<Readonly<OriginalProps>> | types.SheetGenerator<Readonly<OriginalProps>> | undefined;
}) | (React.StatelessComponent<OriginalProps & InjectedProps> & {
styles?: types.DynamicSheet<Readonly<OriginalProps>> | types.SheetGenerator<Readonly<OriginalProps>> | undefined;
}), componentOptions?: ComponentOptions<Readonly<OriginalProps>>) => {
new (props: Readonly<OriginalProps>, context?: any): {
classNames: types.ClassNames;
registry: Cache<Readonly<OriginalProps>>;
componentWillMount(): void;
componentWillReceiveProps(nextProps: Readonly<OriginalProps>): void;
componentWillUnmount(): void;
render(): JSX.Element;
updateStyles(props: Readonly<OriginalProps>): void;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<OriginalProps>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void) | undefined): void;
forceUpdate(callBack?: (() => void) | undefined): void;
props: Readonly<{
children?: React.ReactNode;
}> & Readonly<Readonly<OriginalProps>>;
state: Readonly<{}>;
context: any;
refs: {
[key: string]: React.ReactInstance;
};
};
defaultProps: Partial<OriginalProps & InjectedProps> | undefined;
propTypes: React.ValidationMap<OriginalProps & InjectedProps> | undefined;
};
export default withStyles;