From 0256689812720454c439f9bad237fa7040b0d85d Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Wed, 8 Aug 2018 16:08:33 -0400 Subject: [PATCH 1/2] Add types for react-navigation-material-bottom-tabs --- .../index.d.ts | 30 +++++++++++++++++++ ...-navigation-material-bottom-tabs-tests.tsx | 29 ++++++++++++++++++ .../tsconfig.json | 17 +++++++++++ .../tslint.json | 1 + 4 files changed, 77 insertions(+) create mode 100644 types/react-navigation-material-bottom-tabs/index.d.ts create mode 100644 types/react-navigation-material-bottom-tabs/react-navigation-material-bottom-tabs-tests.tsx create mode 100644 types/react-navigation-material-bottom-tabs/tsconfig.json create mode 100644 types/react-navigation-material-bottom-tabs/tslint.json 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..e058a396c0 --- /dev/null +++ b/types/react-navigation-material-bottom-tabs/index.d.ts @@ -0,0 +1,30 @@ +// 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" } From af7cd209c8bb5dc00765ed7fbe16fa5718502e18 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Wed, 8 Aug 2018 16:48:16 -0400 Subject: [PATCH 2/2] Trigger travis --- types/react-navigation-material-bottom-tabs/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-navigation-material-bottom-tabs/index.d.ts b/types/react-navigation-material-bottom-tabs/index.d.ts index e058a396c0..e9938c7bb4 100644 --- a/types/react-navigation-material-bottom-tabs/index.d.ts +++ b/types/react-navigation-material-bottom-tabs/index.d.ts @@ -2,7 +2,6 @@ // 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';