redoc/src/styled-components.ts

26 lines
718 B
TypeScript
Raw Normal View History

2017-10-12 00:01:37 +03:00
import * as styledComponents from 'styled-components';
import { ThemeInterface } from './theme';
2017-11-19 22:27:44 +03:00
export type StyledFunction<T> = styledComponents.ThemedStyledFunction<T, ThemeInterface>;
2017-10-12 00:01:37 +03:00
function withProps<T, U extends HTMLElement = HTMLElement>(
styledFunction: StyledFunction<React.HTMLProps<U>>,
): StyledFunction<T & React.HTMLProps<U>> {
return styledFunction;
}
const {
default: styled,
css,
injectGlobal,
keyframes,
ThemeProvider,
withTheme,
2018-01-22 21:30:53 +03:00
} = (styledComponents as styledComponents.ThemedStyledComponentsModule<
any
>) as styledComponents.ThemedStyledComponentsModule<ThemeInterface>;
2017-10-12 00:01:37 +03:00
export { css, injectGlobal, keyframes, ThemeProvider, withTheme, withProps };
export default styled;