import type { ViewStyle, TextStyle, ImageStyle } from 'react-native'; type ObjectBase = {}; /** * Signature for inputs and outputs for StyleSheet.create. This is a collection of named styles which can * be used as inputs for the style property on components and matches what StyleSheet.create accepts */ export type NamedStyles = { [P in keyof T]: ViewStyle | TextStyle | ImageStyle; }; /** * A convenience wrapper to create style sheets which depend upon values in a theme, and use them in a manner * where they are built and cached once per theme. The return value of this routine will be a function * which takes a theme and returns the appropriate style sheet. * * Note that this can handle a null/undefined theme as long as the functions are written this way. As an * example the following usage requires a theme to exist: * * const getStyles = themedStyleSheet(t => { * baseStyle: { color: t.palette.buttonForeground } * }); * * This is fine if the theming methodology will always have a default theme. If the theming implementation * may or may not have a theme the above should be written as: * * const getStyles = themedStyleSheet(t => { * baseStyle: { * color: t ? t.palette.buttonForeground : 'blue' * } * }); * * Either way the usage pattern, given either of the above, would be: * const theme = useContext(MyThemeProvider); * const styles = getStyles(theme); * * @param generator - a function which will get run once per theme to create a cached style sheet. * */ export declare function themedStyleSheet, TTheme extends ObjectBase>(generator: (theme: TTheme) => NamedStyles): (theme: TTheme) => NamedStyles; export {}; //# sourceMappingURL=themedStyleSheet.d.ts.map