UNPKG

@withjoy/joykit

Version:

UI Component Library for Joy web

32 lines (31 loc) 1.75 kB
/// <reference types="react" /> import * as styledComponents from 'styled-components'; import { Theme } from '../themes'; /** * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31245#issuecomment-463640878 */ declare const styled: styledComponents.ThemedBaseStyledInterface<Theme>, css: styledComponents.BaseThemedCssFunction<Theme>, createGlobalStyle: <P extends object = {}>(first: styledComponents.CSSObject | TemplateStringsArray | styledComponents.InterpolationFunction<styledComponents.ThemedStyledProps<P, Theme>>, ...interpolations: styledComponents.Interpolation<styledComponents.ThemedStyledProps<P, Theme>>[]) => styledComponents.GlobalStyleComponent<P, Theme>, keyframes: (strings: TemplateStringsArray | styledComponents.CSSKeyframes, ...interpolations: styledComponents.SimpleInterpolation[]) => styledComponents.Keyframes, ThemeProvider: import("react").ComponentClass<styledComponents.ThemeProviderProps<Theme, Theme>, any>; declare type ThemeStyledProps<T> = styledComponents.ThemedStyledProps<T, Theme>; /** * A HOC factory to get the current theme from a `JoyKitThemeProvider` and pass it to your * component as a `theme` prop. * * Note: Should be used within a `JoyKitThemeProvider` hierarchy. * * @example * * ``` * class MyComponent extends React.Component { * render() { * console.log('Current theme: ', this.props.theme) * // ... * } * } * ``` * * export const MyComponentWithTheme = withTheme(MyComponent); */ declare const withTheme: styledComponents.BaseWithThemeFnInterface<Theme>; declare const useTheme: () => Theme; export { css, createGlobalStyle, keyframes, ThemeStyledProps, ThemeProvider, withTheme, useTheme }; export default styled;