diff --git a/types/react-navigation-material-bottom-tabs/index.d.ts b/types/react-navigation-material-bottom-tabs/index.d.ts new file mode 100644 index 0000000000..e9938c7bb4 --- /dev/null +++ b/types/react-navigation-material-bottom-tabs/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for react-navigation-material-bottom-tabs 0.3 +// Project: https://github.com/react-navigation/react-navigation-material-bottom-tab-navigator#readme +// Definitions by: Kyle Roach +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { StyleProp, TextStyle, ViewStyle } from 'react-native'; +import { + NavigationContainer, + NavigationPathsConfig, + NavigationRouteConfigMap +} from 'react-navigation'; + +export interface TabConfig { + shifting?: boolean; + labeled?: boolean; + activeTintColor?: string; + inactiveTintColor?: string; + barStyle?: StyleProp; + initialRouteName?: string; + order?: string[]; + paths?: NavigationPathsConfig; + backBehavior?: 'initialRoute' | 'none'; +} + +export function createMaterialBottomTabNavigator( + routeConfigMap: NavigationRouteConfigMap, + config?: TabConfig +): NavigationContainer; diff --git a/types/react-navigation-material-bottom-tabs/react-navigation-material-bottom-tabs-tests.tsx b/types/react-navigation-material-bottom-tabs/react-navigation-material-bottom-tabs-tests.tsx new file mode 100644 index 0000000000..a0d84f12f1 --- /dev/null +++ b/types/react-navigation-material-bottom-tabs/react-navigation-material-bottom-tabs-tests.tsx @@ -0,0 +1,29 @@ +import * as React from 'react'; +import { View } from 'react-native'; +import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs'; + +const Tab1 = () => ; +const Tab2 = () => ; + +export default createMaterialBottomTabNavigator( + { + tab1: { + screen: Tab1 + }, + tab2: { + screen: Tab2 + } + }, + { + activeTintColor: 'blue', + inactiveTintColor: 'red', + labeled: false, + barStyle: { + backgroundColor: '#fff' + }, + shifting: false, + initialRouteName: 'tab2', + order: ['tab2', 'tab1'], + backBehavior: 'none' + } +); diff --git a/types/react-navigation-material-bottom-tabs/tsconfig.json b/types/react-navigation-material-bottom-tabs/tsconfig.json new file mode 100644 index 0000000000..3e6dd8c735 --- /dev/null +++ b/types/react-navigation-material-bottom-tabs/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react-native", + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "react-navigation-material-bottom-tabs-tests.tsx"] +} diff --git a/types/react-navigation-material-bottom-tabs/tslint.json b/types/react-navigation-material-bottom-tabs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-navigation-material-bottom-tabs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }