mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-04 07:52:51 +00:00
Merge pull request #27975 from iRoachie/react-navigation-material-bottom-tabs
Add types for react-navigation-material-bottom-tabs
This commit is contained in:
commit
d1ebd24ebd
29
types/react-navigation-material-bottom-tabs/index.d.ts
vendored
Normal file
29
types/react-navigation-material-bottom-tabs/index.d.ts
vendored
Normal file
@ -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 <https://github.com/iRoachie>
|
||||
// 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<ViewStyle>;
|
||||
initialRouteName?: string;
|
||||
order?: string[];
|
||||
paths?: NavigationPathsConfig;
|
||||
backBehavior?: 'initialRoute' | 'none';
|
||||
}
|
||||
|
||||
export function createMaterialBottomTabNavigator(
|
||||
routeConfigMap: NavigationRouteConfigMap,
|
||||
config?: TabConfig
|
||||
): NavigationContainer;
|
||||
@ -0,0 +1,29 @@
|
||||
import * as React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
|
||||
|
||||
const Tab1 = () => <View />;
|
||||
const Tab2 = () => <View />;
|
||||
|
||||
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'
|
||||
}
|
||||
);
|
||||
17
types/react-navigation-material-bottom-tabs/tsconfig.json
Normal file
17
types/react-navigation-material-bottom-tabs/tsconfig.json
Normal file
@ -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"]
|
||||
}
|
||||
1
types/react-navigation-material-bottom-tabs/tslint.json
Normal file
1
types/react-navigation-material-bottom-tabs/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user