diff --git a/types/react-native-material-ui/index.d.ts b/types/react-native-material-ui/index.d.ts index 8bb86d3cc3..91ae62a3fb 100644 --- a/types/react-native-material-ui/index.d.ts +++ b/types/react-native-material-ui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native-material-ui 1.19 +// Type definitions for react-native-material-ui 1.30 // Project: https://github.com/xotahal/react-native-material-ui // Definitions by: Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -490,16 +490,6 @@ export interface RippleFeedbackProps { */ export class RippleFeedback extends Component {} -export interface ThemeProviderProps { - uiTheme: {}; - children: JSX.Element; -} - -/** - * @see https://github.com/xotahal/react-native-material-ui/blob/master/src/styles/ThemeProvider.react.js - */ -export class ThemeProvider extends Component {} - export interface Color { red50: string; red100: string; @@ -762,3 +752,23 @@ export interface Color { } export const COLOR: Color; + +export interface ThemeProps { + theme: {}; +} + +export interface ThemeProviderProps { + value: {}; + children: React.ReactElement; +} + +export interface ThemeConsumerProps { + children(props: ThemeProps): React.ReactElement; +} + +export namespace ThemeContext { + class Provider extends Component {} + class Consumer extends Component {} +} + +export function getTheme(theme: {}): {}; diff --git a/types/react-native-material-ui/react-native-material-ui-tests.tsx b/types/react-native-material-ui/react-native-material-ui-tests.tsx index c10d0320db..2187efaa05 100644 --- a/types/react-native-material-ui/react-native-material-ui-tests.tsx +++ b/types/react-native-material-ui/react-native-material-ui-tests.tsx @@ -3,7 +3,7 @@ import { View, Text } from 'react-native'; import { ActionButton, Avatar, - ThemeProvider, + ThemeContext, COLOR, Badge, Button, @@ -12,7 +12,8 @@ import { Dialog, DialogDefaultActions, BottomNavigation, - Toolbar + Toolbar, + getTheme } from 'react-native-material-ui'; const theme = { @@ -24,7 +25,7 @@ const theme = { }; const Example = () => - + @@ -40,12 +41,14 @@ const Example = () =>